about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml6
-rw-r--r--.gitmodules11
-rw-r--r--.reuse/dep55
-rw-r--r--Cargo.lock49
-rw-r--r--LICENSES/NCSA.txt15
-rw-r--r--compiler/rustc/build.rs2
-rw-r--r--compiler/rustc_abi/src/layout.rs8
-rw-r--r--compiler/rustc_abi/src/lib.rs19
-rw-r--r--compiler/rustc_apfloat/Cargo.toml8
-rw-r--r--compiler/rustc_apfloat/src/ieee.rs2757
-rw-r--r--compiler/rustc_apfloat/src/lib.rs695
-rw-r--r--compiler/rustc_apfloat/src/ppc.rs434
-rw-r--r--compiler/rustc_apfloat/tests/ieee.rs3301
-rw-r--r--compiler/rustc_apfloat/tests/ppc.rs530
-rw-r--r--compiler/rustc_ast/src/ast.rs2
-rw-r--r--compiler/rustc_ast/src/attr/mod.rs37
-rw-r--r--compiler/rustc_ast/src/mut_visit.rs3
-rw-r--r--compiler/rustc_ast/src/token.rs17
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs33
-rw-r--r--compiler/rustc_ast/src/visit.rs11
-rw-r--r--compiler/rustc_ast_lowering/src/item.rs55
-rw-r--r--compiler/rustc_ast_passes/src/ast_validation.rs9
-rw-r--r--compiler/rustc_ast_passes/src/feature_gate.rs14
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/item.rs35
-rw-r--r--compiler/rustc_borrowck/src/borrowck_errors.rs46
-rw-r--r--compiler/rustc_borrowck/src/dataflow.rs2
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs76
-rw-r--r--compiler/rustc_borrowck/src/facts.rs2
-rw-r--r--compiler/rustc_borrowck/src/lib.rs6
-rw-r--r--compiler/rustc_borrowck/src/nll.rs6
-rw-r--r--compiler/rustc_borrowck/src/region_infer/dump_mir.rs11
-rw-r--r--compiler/rustc_borrowck/src/region_infer/graphviz.rs4
-rw-r--r--compiler/rustc_borrowck/src/region_infer/mod.rs2
-rw-r--r--compiler/rustc_borrowck/src/region_infer/opaque_types.rs2
-rw-r--r--compiler/rustc_borrowck/src/region_infer/values.rs6
-rw-r--r--compiler/rustc_borrowck/src/type_check/mod.rs6
-rw-r--r--compiler/rustc_builtin_macros/src/asm.rs16
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/clone.rs8
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/decodable.rs2
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/encodable.rs2
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/generic/mod.rs9
-rw-r--r--compiler/rustc_builtin_macros/src/format.rs8
-rw-r--r--compiler/rustc_builtin_macros/src/format_foreign.rs17
-rw-r--r--compiler/rustc_builtin_macros/src/global_allocator.rs2
-rw-r--r--compiler/rustc_builtin_macros/src/proc_macro_harness.rs3
-rw-r--r--compiler/rustc_builtin_macros/src/source_util.rs2
-rw-r--r--compiler/rustc_builtin_macros/src/test.rs1
-rw-r--r--compiler/rustc_codegen_gcc/src/lib.rs8
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs64
-rw-r--r--compiler/rustc_codegen_llvm/src/back/archive.rs10
-rw-r--r--compiler/rustc_codegen_llvm/src/back/lto.rs16
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs6
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs11
-rw-r--r--compiler/rustc_codegen_llvm/src/common.rs4
-rw-r--r--compiler/rustc_codegen_llvm/src/consts.rs3
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs2
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs16
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/utils.rs3
-rw-r--r--compiler/rustc_codegen_llvm/src/intrinsic.rs64
-rw-r--r--compiler/rustc_codegen_llvm/src/lib.rs22
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs10
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs29
-rw-r--r--compiler/rustc_codegen_ssa/src/back/linker.rs46
-rw-r--r--compiler/rustc_codegen_ssa/src/back/metadata.rs7
-rw-r--r--compiler/rustc_codegen_ssa/src/back/rpath.rs2
-rw-r--r--compiler/rustc_codegen_ssa/src/back/write.rs333
-rw-r--r--compiler/rustc_codegen_ssa/src/base.rs21
-rw-r--r--compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs18
-rw-r--r--compiler/rustc_codegen_ssa/src/errors.rs20
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs16
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/debuginfo.rs2
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/rvalue.rs3
-rw-r--r--compiler/rustc_codegen_ssa/src/mono_item.rs4
-rw-r--r--compiler/rustc_codegen_ssa/src/target_features.rs6
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/backend.rs9
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/write.rs4
-rw-r--r--compiler/rustc_const_eval/Cargo.toml2
-rw-r--r--compiler/rustc_const_eval/src/const_eval/error.rs5
-rw-r--r--compiler/rustc_const_eval/src/const_eval/eval_queries.rs4
-rw-r--r--compiler/rustc_const_eval/src/const_eval/fn_queries.rs13
-rw-r--r--compiler/rustc_const_eval/src/const_eval/valtrees.rs2
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs11
-rw-r--r--compiler/rustc_const_eval/src/interpret/intrinsics.rs17
-rw-r--r--compiler/rustc_const_eval/src/interpret/memory.rs4
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs6
-rw-r--r--compiler/rustc_const_eval/src/interpret/operator.rs5
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs2
-rw-r--r--compiler/rustc_const_eval/src/interpret/validity.rs10
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/check.rs37
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/ops.rs8
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/post_drop_elaboration.rs6
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs3
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs61
-rw-r--r--compiler/rustc_const_eval/src/util/compare_types.rs15
-rw-r--r--compiler/rustc_data_structures/src/binary_search_util/mod.rs38
-rw-r--r--compiler/rustc_data_structures/src/sync/worker_local.rs2
-rw-r--r--compiler/rustc_error_messages/src/lib.rs10
-rw-r--r--compiler/rustc_errors/messages.ftl22
-rw-r--r--compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs20
-rw-r--r--compiler/rustc_errors/src/diagnostic_impls.rs61
-rw-r--r--compiler/rustc_errors/src/emitter.rs14
-rw-r--r--compiler/rustc_errors/src/json.rs8
-rw-r--r--compiler/rustc_errors/src/lib.rs70
-rw-r--r--compiler/rustc_errors/src/markdown/tests/term.rs2
-rw-r--r--compiler/rustc_expand/src/build.rs11
-rw-r--r--compiler/rustc_expand/src/config.rs12
-rw-r--r--compiler/rustc_expand/src/expand.rs4
-rw-r--r--compiler/rustc_expand/src/mbe/diagnostics.rs2
-rw-r--r--compiler/rustc_expand/src/mbe/macro_check.rs4
-rw-r--r--compiler/rustc_expand/src/mbe/macro_parser.rs10
-rw-r--r--compiler/rustc_expand/src/mbe/macro_rules.rs17
-rw-r--r--compiler/rustc_expand/src/mbe/quoted.rs44
-rw-r--r--compiler/rustc_expand/src/parse/tests.rs9
-rw-r--r--compiler/rustc_expand/src/proc_macro.rs4
-rw-r--r--compiler/rustc_expand/src/proc_macro_server.rs6
-rw-r--r--compiler/rustc_feature/src/active.rs6
-rw-r--r--compiler/rustc_hir/src/hir.rs23
-rw-r--r--compiler/rustc_hir/src/intravisit.rs8
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/errors.rs6
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/generics.rs8
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/lint.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/mod.rs10
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs22
-rw-r--r--compiler/rustc_hir_analysis/src/check/compare_impl_item.rs152
-rw-r--r--compiler/rustc_hir_analysis/src/check/dropck.rs5
-rw-r--r--compiler/rustc_hir_analysis/src/check/intrinsic.rs8
-rw-r--r--compiler/rustc_hir_analysis/src/check/intrinsicck.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/check/mod.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs122
-rw-r--r--compiler/rustc_hir_analysis/src/check_unused.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/builtin.rs3
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs3
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs8
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/orphan.rs15
-rw-r--r--compiler/rustc_hir_analysis/src/collect.rs16
-rw-r--r--compiler/rustc_hir_analysis/src/collect/generics_of.rs1
-rw-r--r--compiler/rustc_hir_analysis/src/collect/item_bounds.rs48
-rw-r--r--compiler/rustc_hir_analysis/src/collect/predicates_of.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs115
-rw-r--r--compiler/rustc_hir_analysis/src/collect/type_of.rs10
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/hir_wf_check.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check.rs5
-rw-r--r--compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs12
-rw-r--r--compiler/rustc_hir_analysis/src/variance/terms.rs4
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs12
-rw-r--r--compiler/rustc_hir_typeck/messages.ftl4
-rw-r--r--compiler/rustc_hir_typeck/src/_match.rs5
-rw-r--r--compiler/rustc_hir_typeck/src/callee.rs10
-rw-r--r--compiler/rustc_hir_typeck/src/cast.rs6
-rw-r--r--compiler/rustc_hir_typeck/src/closure.rs7
-rw-r--r--compiler/rustc_hir_typeck/src/coercion.rs3
-rw-r--r--compiler/rustc_hir_typeck/src/errors.rs39
-rw-r--r--compiler/rustc_hir_typeck/src/expr.rs20
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs8
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs47
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs130
-rw-r--r--compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs4
-rw-r--r--compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/mod.rs4
-rw-r--r--compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs7
-rw-r--r--compiler/rustc_hir_typeck/src/generator_interior/mod.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/intrinsicck.rs13
-rw-r--r--compiler/rustc_hir_typeck/src/lib.rs14
-rw-r--r--compiler/rustc_hir_typeck/src/method/confirm.rs5
-rw-r--r--compiler/rustc_hir_typeck/src/method/prelude2021.rs20
-rw-r--r--compiler/rustc_hir_typeck/src/method/suggest.rs68
-rw-r--r--compiler/rustc_hir_typeck/src/pat.rs32
-rw-r--r--compiler/rustc_hir_typeck/src/upvar.rs15
-rw-r--r--compiler/rustc_hir_typeck/src/writeback.rs10
-rw-r--r--compiler/rustc_incremental/src/assert_dep_graph.rs10
-rw-r--r--compiler/rustc_incremental/src/persist/dirty_clean.rs2
-rw-r--r--compiler/rustc_incremental/src/persist/fs.rs8
-rw-r--r--compiler/rustc_infer/src/errors/mod.rs16
-rw-r--r--compiler/rustc_infer/src/errors/note_and_explain.rs2
-rw-r--r--compiler/rustc_infer/src/infer/canonical/canonicalizer.rs2
-rw-r--r--compiler/rustc_infer/src/infer/combine.rs2
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/mod.rs57
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs2
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs19
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/note.rs20
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs9
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/suggest.rs4
-rw-r--r--compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs5
-rw-r--r--compiler/rustc_infer/src/infer/nll_relate/mod.rs2
-rw-r--r--compiler/rustc_infer/src/infer/opaque_types.rs7
-rw-r--r--compiler/rustc_infer/src/infer/outlives/obligations.rs2
-rw-r--r--compiler/rustc_infer/src/infer/outlives/verify.rs2
-rw-r--r--compiler/rustc_infer/src/infer/region_constraints/mod.rs8
-rw-r--r--compiler/rustc_infer/src/traits/error_reporting/mod.rs6
-rw-r--r--compiler/rustc_infer/src/traits/mod.rs9
-rw-r--r--compiler/rustc_infer/src/traits/project.rs8
-rw-r--r--compiler/rustc_infer/src/traits/structural_impls.rs10
-rw-r--r--compiler/rustc_interface/Cargo.toml1
-rw-r--r--compiler/rustc_interface/src/util.rs3
-rw-r--r--compiler/rustc_lint/messages.ftl8
-rw-r--r--compiler/rustc_lint/src/builtin.rs24
-rw-r--r--compiler/rustc_lint/src/context.rs37
-rw-r--r--compiler/rustc_lint/src/levels.rs2
-rw-r--r--compiler/rustc_lint/src/lib.rs6
-rw-r--r--compiler/rustc_lint/src/lints.rs17
-rw-r--r--compiler/rustc_lint/src/multiple_supertrait_upcastable.rs1
-rw-r--r--compiler/rustc_lint/src/noop_method_call.rs14
-rw-r--r--compiler/rustc_lint/src/reference_casting.rs (renamed from compiler/rustc_lint/src/cast_ref_to_mut.rs)15
-rw-r--r--compiler/rustc_lint/src/unused.rs10
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs75
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs18
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h2
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp3
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp41
-rw-r--r--compiler/rustc_log/src/lib.rs2
-rw-r--r--compiler/rustc_macros/Cargo.toml3
-rw-r--r--compiler/rustc_macros/src/serialize.rs2
-rw-r--r--compiler/rustc_metadata/src/locator.rs2
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs1
-rw-r--r--compiler/rustc_metadata/src/rmeta/encoder.rs14
-rw-r--r--compiler/rustc_metadata/src/rmeta/mod.rs3
-rw-r--r--compiler/rustc_middle/Cargo.toml2
-rw-r--r--compiler/rustc_middle/messages.ftl3
-rw-r--r--compiler/rustc_middle/src/dep_graph/dep_node.rs2
-rw-r--r--compiler/rustc_middle/src/dep_graph/mod.rs2
-rw-r--r--compiler/rustc_middle/src/error.rs3
-rw-r--r--compiler/rustc_middle/src/hir/map/mod.rs4
-rw-r--r--compiler/rustc_middle/src/lint.rs14
-rw-r--r--compiler/rustc_middle/src/middle/privacy.rs9
-rw-r--r--compiler/rustc_middle/src/middle/stability.rs14
-rw-r--r--compiler/rustc_middle/src/mir/generic_graph.rs4
-rw-r--r--compiler/rustc_middle/src/mir/generic_graphviz.rs10
-rw-r--r--compiler/rustc_middle/src/mir/graphviz.rs2
-rw-r--r--compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs6
-rw-r--r--compiler/rustc_middle/src/mir/interpret/error.rs2
-rw-r--r--compiler/rustc_middle/src/mir/interpret/mod.rs2
-rw-r--r--compiler/rustc_middle/src/mir/interpret/queries.rs9
-rw-r--r--compiler/rustc_middle/src/mir/interpret/value.rs12
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs128
-rw-r--r--compiler/rustc_middle/src/mir/mono.rs8
-rw-r--r--compiler/rustc_middle/src/mir/pretty.rs89
-rw-r--r--compiler/rustc_middle/src/mir/query.rs2
-rw-r--r--compiler/rustc_middle/src/mir/spanview.rs17
-rw-r--r--compiler/rustc_middle/src/mir/terminator.rs26
-rw-r--r--compiler/rustc_middle/src/query/mod.rs9
-rw-r--r--compiler/rustc_middle/src/thir.rs22
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs39
-rw-r--r--compiler/rustc_middle/src/traits/solve.rs3
-rw-r--r--compiler/rustc_middle/src/traits/solve/inspect/format.rs4
-rw-r--r--compiler/rustc_middle/src/traits/specialization_graph.rs2
-rw-r--r--compiler/rustc_middle/src/traits/structural_impls.rs4
-rw-r--r--compiler/rustc_middle/src/ty/closure.rs2
-rw-r--r--compiler/rustc_middle/src/ty/codec.rs4
-rw-r--r--compiler/rustc_middle/src/ty/consts.rs4
-rw-r--r--compiler/rustc_middle/src/ty/consts/int.rs2
-rw-r--r--compiler/rustc_middle/src/ty/consts/kind.rs2
-rw-r--r--compiler/rustc_middle/src/ty/diagnostics.rs18
-rw-r--r--compiler/rustc_middle/src/ty/error.rs8
-rw-r--r--compiler/rustc_middle/src/ty/instance.rs16
-rw-r--r--compiler/rustc_middle/src/ty/layout.rs13
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs114
-rw-r--r--compiler/rustc_middle/src/ty/normalize_erasing_regions.rs4
-rw-r--r--compiler/rustc_middle/src/ty/opaque_types.rs16
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs41
-rw-r--r--compiler/rustc_middle/src/ty/structural_impls.rs14
-rw-r--r--compiler/rustc_middle/src/ty/util.rs2
-rw-r--r--compiler/rustc_middle/src/ty/vtable.rs4
-rw-r--r--compiler/rustc_middle/src/util/bug.rs2
-rw-r--r--compiler/rustc_middle/src/util/common.rs2
-rw-r--r--compiler/rustc_mir_build/Cargo.toml2
-rw-r--r--compiler/rustc_mir_build/src/build/custom/parse.rs2
-rw-r--r--compiler/rustc_mir_build/src/build/expr/as_rvalue.rs3
-rw-r--r--compiler/rustc_mir_build/src/build/matches/mod.rs4
-rw-r--r--compiler/rustc_mir_build/src/build/matches/test.rs6
-rw-r--r--compiler/rustc_mir_build/src/build/mod.rs17
-rw-r--r--compiler/rustc_mir_build/src/errors.rs8
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/expr.rs4
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs25
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs18
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/usefulness.rs4
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs4
-rw-r--r--compiler/rustc_mir_transform/src/coverage/counters.rs8
-rw-r--r--compiler/rustc_mir_transform/src/coverage/debug.rs4
-rw-r--r--compiler/rustc_mir_transform/src/coverage/graph.rs15
-rw-r--r--compiler/rustc_mir_transform/src/coverage/spans.rs7
-rw-r--r--compiler/rustc_mir_transform/src/coverage/test_macros/src/lib.rs2
-rw-r--r--compiler/rustc_mir_transform/src/elaborate_drops.rs5
-rw-r--r--compiler/rustc_mir_transform/src/function_item_references.rs6
-rw-r--r--compiler/rustc_mir_transform/src/generator.rs2
-rw-r--r--compiler/rustc_mir_transform/src/instsimplify.rs2
-rw-r--r--compiler/rustc_mir_transform/src/lib.rs2
-rw-r--r--compiler/rustc_mir_transform/src/match_branches.rs2
-rw-r--r--compiler/rustc_mir_transform/src/multiple_return_terminators.rs2
-rw-r--r--compiler/rustc_mir_transform/src/nrvo.rs2
-rw-r--r--compiler/rustc_mir_transform/src/pass_manager.rs4
-rw-r--r--compiler/rustc_mir_transform/src/remove_unneeded_drops.rs2
-rw-r--r--compiler/rustc_mir_transform/src/remove_zsts.rs2
-rw-r--r--compiler/rustc_monomorphize/src/partitioning.rs2
-rw-r--r--compiler/rustc_parse/messages.ftl12
-rw-r--r--compiler/rustc_parse/src/errors.rs39
-rw-r--r--compiler/rustc_parse/src/lexer/diagnostics.rs2
-rw-r--r--compiler/rustc_parse/src/lexer/tokentrees.rs2
-rw-r--r--compiler/rustc_parse/src/lexer/unescape_error_reporting.rs15
-rw-r--r--compiler/rustc_parse/src/lexer/unicode_chars.rs2
-rw-r--r--compiler/rustc_parse/src/lib.rs2
-rw-r--r--compiler/rustc_parse/src/parser/attr_wrapper.rs19
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs51
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs6
-rw-r--r--compiler/rustc_parse/src/parser/item.rs148
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs52
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs6
-rw-r--r--compiler/rustc_parse/src/parser/path.rs2
-rw-r--r--compiler/rustc_parse/src/parser/stmt.rs9
-rw-r--r--compiler/rustc_passes/src/check_const.rs6
-rw-r--r--compiler/rustc_passes/src/hir_id_validator.rs5
-rw-r--r--compiler/rustc_passes/src/hir_stats.rs8
-rw-r--r--compiler/rustc_passes/src/liveness.rs2
-rw-r--r--compiler/rustc_passes/src/reachable.rs2
-rw-r--r--compiler/rustc_privacy/src/lib.rs6
-rw-r--r--compiler/rustc_query_system/src/dep_graph/graph.rs4
-rw-r--r--compiler/rustc_resolve/src/build_reduced_graph.rs6
-rw-r--r--compiler/rustc_resolve/src/check_unused.rs2
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs133
-rw-r--r--compiler/rustc_resolve/src/ident.rs8
-rw-r--r--compiler/rustc_resolve/src/imports.rs182
-rw-r--r--compiler/rustc_resolve/src/late.rs178
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs70
-rw-r--r--compiler/rustc_resolve/src/lib.rs30
-rw-r--r--compiler/rustc_resolve/src/macros.rs26
-rw-r--r--compiler/rustc_session/Cargo.toml1
-rw-r--r--compiler/rustc_session/src/config.rs17
-rw-r--r--compiler/rustc_session/src/options.rs4
-rw-r--r--compiler/rustc_smir/src/rustc_smir/mod.rs12
-rw-r--r--compiler/rustc_smir/src/stable_mir/mir/body.rs3
-rw-r--r--compiler/rustc_span/src/lib.rs2
-rw-r--r--compiler/rustc_span/src/symbol.rs6
-rw-r--r--compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs79
-rw-r--r--compiler/rustc_target/src/spec/mod.rs1
-rw-r--r--compiler/rustc_target/src/spec/riscv64_linux_android.rs19
-rw-r--r--compiler/rustc_trait_selection/src/solve/assembly/mod.rs8
-rw-r--r--compiler/rustc_trait_selection/src/solve/canonicalize.rs25
-rw-r--r--compiler/rustc_trait_selection/src/solve/eval_ctxt.rs8
-rw-r--r--compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs2
-rw-r--r--compiler/rustc_trait_selection/src/solve/project_goals.rs2
-rw-r--r--compiler/rustc_trait_selection/src/solve/search_graph/mod.rs10
-rw-r--r--compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs4
-rw-r--r--compiler/rustc_trait_selection/src/solve/trait_goals.rs457
-rw-r--r--compiler/rustc_trait_selection/src/traits/auto_trait.rs10
-rw-r--r--compiler/rustc_trait_selection/src/traits/coherence.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs64
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs158
-rw-r--r--compiler/rustc_trait_selection/src/traits/mod.rs19
-rw-r--r--compiler/rustc_trait_selection/src/traits/object_safety.rs12
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs13
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/normalize.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs1
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs5
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs69
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs20
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/mod.rs101
-rw-r--r--compiler/rustc_trait_selection/src/traits/specialize/mod.rs9
-rw-r--r--compiler/rustc_trait_selection/src/traits/util.rs4
-rw-r--r--compiler/rustc_trait_selection/src/traits/vtable.rs6
-rw-r--r--compiler/rustc_transmute/src/layout/tree.rs2
-rw-r--r--compiler/rustc_ty_utils/src/assoc.rs12
-rw-r--r--compiler/rustc_ty_utils/src/implied_bounds.rs86
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs15
-rw-r--r--compiler/rustc_ty_utils/src/lib.rs1
-rw-r--r--compiler/rustc_ty_utils/src/needs_drop.rs2
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs88
-rw-r--r--compiler/rustc_type_ir/src/lib.rs2
-rw-r--r--config.example.toml8
-rw-r--r--library/alloc/src/collections/btree/map.rs62
-rw-r--r--library/alloc/src/collections/btree/set.rs13
-rw-r--r--library/alloc/src/rc.rs2
-rw-r--r--library/alloc/src/sync.rs2
-rw-r--r--library/alloc/src/vec/mod.rs2
-rw-r--r--library/core/benches/iter.rs1
-rw-r--r--library/core/src/borrow.rs2
-rw-r--r--library/core/src/fmt/builders.rs6
-rw-r--r--library/core/src/lib.rs3
-rw-r--r--library/core/src/option.rs1
-rw-r--r--library/core/src/ptr/non_null.rs5
-rw-r--r--library/core/src/result.rs1
-rw-r--r--library/core/src/str/mod.rs13
-rw-r--r--library/core/src/sync/atomic.rs62
-rw-r--r--library/portable-simd/crates/core_simd/examples/dot_product.rs2
-rw-r--r--library/std/src/backtrace.rs58
-rw-r--r--library/std/src/backtrace/tests.rs6
-rw-r--r--library/std/src/io/util.rs100
-rw-r--r--library/std/src/io/util/tests.rs13
-rw-r--r--library/std/src/lib.rs1
-rw-r--r--library/std/src/os/android/raw.rs2
-rw-r--r--library/std/src/panicking.rs2
-rw-r--r--library/std/src/sync/condvar.rs18
-rw-r--r--library/std/src/sync/lazy_lock.rs9
-rw-r--r--library/std/src/sys_common/backtrace.rs19
-rw-r--r--library/std/tests/process_spawning.rs (renamed from tests/ui/std/issue-15149.rs)31
-rw-r--r--library/std/tests/switch-stdout.rs (renamed from tests/ui/std/switch-stdout.rs)23
-rw-r--r--library/test/src/types.rs2
-rw-r--r--src/bootstrap/bin/main.rs8
-rw-r--r--src/bootstrap/bin/rustc.rs23
-rw-r--r--src/bootstrap/bin/rustdoc.rs8
-rw-r--r--src/bootstrap/bolt.rs60
-rw-r--r--src/bootstrap/build.rs2
-rw-r--r--src/bootstrap/builder.rs39
-rw-r--r--src/bootstrap/cache.rs4
-rw-r--r--src/bootstrap/cc_detect.rs2
-rw-r--r--src/bootstrap/check.rs4
-rw-r--r--src/bootstrap/clean.rs84
-rw-r--r--src/bootstrap/compile.rs29
-rw-r--r--src/bootstrap/config.rs47
-rw-r--r--src/bootstrap/dist.rs145
-rw-r--r--src/bootstrap/doc.rs6
-rw-r--r--src/bootstrap/download.rs8
-rw-r--r--src/bootstrap/flags.rs13
-rw-r--r--src/bootstrap/format.rs8
-rw-r--r--src/bootstrap/lib.rs49
-rw-r--r--src/bootstrap/llvm.rs24
-rw-r--r--src/bootstrap/sanity.rs2
-rw-r--r--src/bootstrap/setup.rs14
-rw-r--r--src/bootstrap/tarball.rs4
-rw-r--r--src/bootstrap/test.rs33
-rw-r--r--src/bootstrap/toolstate.rs32
-rw-r--r--src/bootstrap/util.rs24
-rw-r--r--src/ci/docker/host-aarch64/aarch64-gnu/Dockerfile8
-rw-r--r--src/ci/docker/host-x86_64/armhf-gnu/Dockerfile16
-rw-r--r--src/ci/docker/host-x86_64/armhf-gnu/vexpress_config617
-rw-r--r--src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile3
-rw-r--r--src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile8
-rw-r--r--src/ci/docker/host-x86_64/dist-various-1/Dockerfile14
-rw-r--r--src/ci/docker/host-x86_64/dist-various-2/Dockerfile23
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile3
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile10
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-netbsd/Dockerfile12
-rw-r--r--src/ci/docker/host-x86_64/test-various/Dockerfile15
-rwxr-xr-xsrc/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py7
-rw-r--r--src/ci/docker/host-x86_64/wasm32/Dockerfile9
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile5
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile54
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile24
-rwxr-xr-xsrc/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh (renamed from src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/script.sh)0
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile20
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu-nopt/Dockerfile8
-rw-r--r--src/ci/docker/host-x86_64/x86_64-gnu/Dockerfile5
-rw-r--r--src/ci/github-actions/ci.yml7
-rw-r--r--src/doc/rustc/book.toml3
-rw-r--r--src/doc/rustc/src/SUMMARY.md2
-rw-r--r--src/doc/rustc/src/codegen-options/index.md6
-rw-r--r--src/doc/rustc/src/command-line-arguments.md4
-rw-r--r--src/doc/rustc/src/platform-support.md1
-rw-r--r--src/doc/rustc/src/symbol-mangling/index.md52
-rw-r--r--src/doc/rustc/src/symbol-mangling/v0.md1222
-rw-r--r--src/doc/style-guide/src/expressions.md7
-rw-r--r--src/doc/unstable-book/src/compiler-flags/no-parallel-llvm.md8
-rw-r--r--src/doc/unstable-book/src/compiler-flags/path-options.md11
-rw-r--r--src/etc/completions/x.py.fish49
-rw-r--r--src/etc/completions/x.py.ps149
-rw-r--r--src/etc/completions/x.py.sh68
-rw-r--r--src/etc/rust_analyzer_settings.json5
-rw-r--r--src/librustdoc/clean/inline.rs5
-rw-r--r--src/librustdoc/clean/mod.rs281
-rw-r--r--src/librustdoc/clean/simplify.rs35
-rw-r--r--src/librustdoc/clean/types.rs44
-rw-r--r--src/librustdoc/clean/utils.rs34
-rw-r--r--src/librustdoc/html/format.rs35
-rw-r--r--src/librustdoc/html/markdown.rs2
-rw-r--r--src/librustdoc/html/markdown/tests.rs2
-rw-r--r--src/librustdoc/html/render/context.rs2
-rw-r--r--src/librustdoc/html/render/mod.rs227
-rw-r--r--src/librustdoc/html/render/print_item.rs6
-rw-r--r--src/librustdoc/html/render/span_map.rs2
-rw-r--r--src/librustdoc/html/templates/type_layout.html5
-rw-r--r--src/librustdoc/json/conversions.rs9
-rw-r--r--src/librustdoc/passes/check_doc_test_visibility.rs2
-rw-r--r--src/librustdoc/passes/strip_hidden.rs2
-rw-r--r--src/librustdoc/passes/stripper.rs2
-rw-r--r--src/librustdoc/visit_ast.rs30
m---------src/llvm-project0
-rw-r--r--src/tools/build-manifest/Cargo.toml2
m---------src/tools/cargo0
-rw-r--r--src/tools/clippy/clippy_lints/src/derive.rs3
-rw-r--r--src/tools/clippy/clippy_lints/src/large_const_arrays.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/manual_float_methods.rs8
-rw-r--r--src/tools/clippy/clippy_lints/src/non_copy_const.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/operators/bit_mask.rs6
-rw-r--r--src/tools/clippy/clippy_lints/src/renamed_lints.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/types/mod.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/ast_utils.rs8
-rw-r--r--src/tools/clippy/clippy_utils/src/consts.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/lib.rs2
-rw-r--r--src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs52
-rw-r--r--src/tools/clippy/tests/compile-test.rs4
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.fixed1
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.rs1
-rw-r--r--src/tools/clippy/tests/ui/explicit_deref_methods.stderr24
-rw-r--r--src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs1
-rw-r--r--src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr8
-rw-r--r--src/tools/clippy/tests/ui/rename.fixed4
-rw-r--r--src/tools/clippy/tests/ui/rename.rs2
-rw-r--r--src/tools/clippy/tests/ui/rename.stderr4
-rw-r--r--src/tools/clippy/tests/ui/result_map_or_into_option.fixed2
-rw-r--r--src/tools/clippy/tests/ui/result_map_or_into_option.rs2
-rw-r--r--src/tools/compiletest/src/header/cfg.rs4
-rw-r--r--src/tools/compiletest/src/lib.rs2
-rw-r--r--src/tools/compiletest/src/runtest.rs9
-rw-r--r--src/tools/miri/.github/workflows/ci.yml13
-rw-r--r--src/tools/miri/README.md2
-rwxr-xr-xsrc/tools/miri/miri2
-rw-r--r--src/tools/miri/rust-version2
-rw-r--r--src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs15
-rw-r--r--src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs87
-rw-r--r--src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs243
-rw-r--r--src/tools/miri/src/mono_hash_map.rs2
-rw-r--r--src/tools/miri/src/shims/backtrace.rs10
-rw-r--r--src/tools/miri/src/shims/foreign_items.rs10
-rw-r--r--src/tools/miri/src/shims/time.rs5
-rw-r--r--src/tools/miri/src/shims/unix/macos/foreign_items.rs12
-rw-r--r--src/tools/miri/src/shims/unix/sync.rs4
-rwxr-xr-xsrc/tools/miri/test-cargo-miri/run-test.py5
-rw-r--r--src/tools/miri/tests/compiletest.rs7
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.rs2
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/modifying_constants.rs2
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/outside-range.stderr4
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr8
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr8
-rw-r--r--src/tools/miri/tests/pass/intrinsics.rs2
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/cell-alternate-writes.stderr8
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/end-of-protector.stderr16
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/formatting.stderr8
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/reborrow-is-read.stderr8
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/reserved.stderr24
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/tree-borrows.rs18
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/unique.default.stderr12
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/unique.uniq.stderr12
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/vec_unique.default.stderr4
-rw-r--r--src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr4
-rw-r--r--src/tools/opt-dist/Cargo.toml1
-rw-r--r--src/tools/opt-dist/src/bolt.rs98
-rw-r--r--src/tools/opt-dist/src/environment/linux.rs4
-rw-r--r--src/tools/opt-dist/src/environment/mod.rs2
-rw-r--r--src/tools/opt-dist/src/environment/windows.rs4
-rw-r--r--src/tools/opt-dist/src/exec.rs20
-rw-r--r--src/tools/opt-dist/src/main.rs41
-rw-r--r--src/tools/opt-dist/src/training.rs2
-rw-r--r--src/tools/opt-dist/src/utils/io.rs26
-rw-r--r--src/tools/rustfmt/src/macros.rs28
-rw-r--r--src/tools/rustfmt/src/test/mod.rs8
-rw-r--r--src/tools/tidy/src/deps.rs2
-rw-r--r--src/tools/tidy/src/issues.txt4282
-rw-r--r--src/tools/tidy/src/style.rs4
-rw-r--r--src/tools/tidy/src/ui_tests.rs57
-rw-r--r--tests/assembly/is_aligned.rs1
-rw-r--r--tests/assembly/slice-is_ascii.rs1
-rw-r--r--tests/assembly/strict_provenance.rs1
-rw-r--r--tests/codegen/abi-main-signature-16bit-c-int.rs20
-rw-r--r--tests/codegen/abi-main-signature-32bit-c-int.rs3
-rw-r--r--tests/codegen/addr-of-mutate.rs1
-rw-r--r--tests/codegen/adjustments.rs6
-rw-r--r--tests/codegen/align-enum.rs2
-rw-r--r--tests/codegen/align-offset.rs1
-rw-r--r--tests/codegen/align-struct.rs4
-rw-r--r--tests/codegen/array-codegen.rs1
-rw-r--r--tests/codegen/array-equality.rs8
-rw-r--r--tests/codegen/atomic-operations.rs60
-rw-r--r--tests/codegen/avr/avr-func-addrspace.rs6
-rw-r--r--tests/codegen/box-maybe-uninit.rs1
-rw-r--r--tests/codegen/comparison-operators-2-tuple.rs1
-rw-r--r--tests/codegen/comparison-operators-newtype.rs1
-rw-r--r--tests/codegen/consts.rs1
-rw-r--r--tests/codegen/drop-in-place-noalias.rs4
-rw-r--r--tests/codegen/fastcall-inreg.rs2
-rw-r--r--tests/codegen/function-arguments-noopt.rs10
-rw-r--r--tests/codegen/function-arguments.rs64
-rw-r--r--tests/codegen/global_asm.rs24
-rw-r--r--tests/codegen/global_asm_include.rs24
-rw-r--r--tests/codegen/global_asm_x2.rs24
-rw-r--r--tests/codegen/intrinsics/mask.rs2
-rw-r--r--tests/codegen/intrinsics/nontemporal.rs2
-rw-r--r--tests/codegen/intrinsics/offset.rs1
-rw-r--r--tests/codegen/intrinsics/transmute-niched.rs1
-rw-r--r--tests/codegen/intrinsics/transmute-x64.rs1
-rw-r--r--tests/codegen/intrinsics/transmute.rs1
-rw-r--r--tests/codegen/issues/issue-105386-ub-in-debuginfo.rs5
-rw-r--r--tests/codegen/issues/issue-37945.rs8
-rw-r--r--tests/codegen/issues/issue-56267-2.rs2
-rw-r--r--tests/codegen/issues/issue-56267.rs2
-rw-r--r--tests/codegen/issues/issue-56927.rs14
-rw-r--r--tests/codegen/issues/issue-58881.rs2
-rw-r--r--tests/codegen/issues/issue-85872-multiple-reverse.rs1
-rw-r--r--tests/codegen/issues/issue-86106.rs1
-rw-r--r--tests/codegen/issues/issue-96274.rs1
-rw-r--r--tests/codegen/issues/issue-96497-slice-size-nowrap.rs1
-rw-r--r--tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs1
-rw-r--r--tests/codegen/lifetime_start_end.rs8
-rw-r--r--tests/codegen/loads.rs34
-rw-r--r--tests/codegen/match-optimized.rs6
-rw-r--r--tests/codegen/mem-replace-big-type.rs4
-rw-r--r--tests/codegen/mem-replace-simple-type.rs1
-rw-r--r--tests/codegen/move-operands.rs4
-rw-r--r--tests/codegen/option-nonzero-eq.rs2
-rw-r--r--tests/codegen/packed.rs40
-rw-r--r--tests/codegen/personality_lifetimes.rs2
-rw-r--r--tests/codegen/refs.rs6
-rw-r--r--tests/codegen/repeat-trusted-len.rs4
-rw-r--r--tests/codegen/repr-transparent-aggregates-1.rs89
-rw-r--r--tests/codegen/repr-transparent-aggregates-2.rs90
-rw-r--r--tests/codegen/repr/transparent-imm-array.rs86
-rw-r--r--tests/codegen/repr/transparent-mips64.rs (renamed from tests/codegen/repr-transparent-aggregates-3.rs)2
-rw-r--r--tests/codegen/repr/transparent-struct-ptr.rs87
-rw-r--r--tests/codegen/repr/transparent-sysv64.rs (renamed from tests/codegen/repr-transparent-sysv64.rs)0
-rw-r--r--tests/codegen/repr/transparent.rs (renamed from tests/codegen/repr-transparent.rs)15
-rw-r--r--tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs10
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-checks.rs2
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs6
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs6
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs6
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs6
-rw-r--r--tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs45
-rw-r--r--tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs46
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs4
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs4
-rw-r--r--tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs12
-rw-r--r--tests/codegen/simd_arith_offset.rs2
-rw-r--r--tests/codegen/slice-init.rs6
-rw-r--r--tests/codegen/slice-iter-len-eq-zero.rs2
-rw-r--r--tests/codegen/slice-ref-equality.rs12
-rw-r--r--tests/codegen/slice_as_from_ptr_range.rs1
-rw-r--r--tests/codegen/stores.rs8
-rw-r--r--tests/codegen/swap-large-types.rs6
-rw-r--r--tests/codegen/transmute-optimized.rs1
-rw-r--r--tests/codegen/transmute-scalar.rs1
-rw-r--r--tests/codegen/try_question_mark_nop.rs1
-rw-r--r--tests/codegen/unchecked_shifts.rs1
-rw-r--r--tests/codegen/uninit-consts.rs1
-rw-r--r--tests/codegen/union-abi.rs10
-rw-r--r--tests/codegen/vec-as-ptr.rs4
-rw-r--r--tests/codegen/vec-calloc.rs1
-rw-r--r--tests/debuginfo/thread-names.rs13
-rw-r--r--tests/run-make/coverage-llvmir/filecheck.testprog.txt4
-rw-r--r--tests/run-make/dump-ice-to-disk/Makefile1
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt4
-rw-r--r--tests/run-make/print-cfg/Makefile8
-rw-r--r--tests/run-make/short-ice/Makefile1
-rw-r--r--tests/rustdoc-gui/rust-logo.goml16
-rw-r--r--tests/rustdoc/alias-reexport.rs1
-rw-r--r--tests/rustdoc/alias-reexport2.rs1
-rw-r--r--tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs1
-rw-r--r--tests/rustdoc/extern-impl-trait.rs2
-rw-r--r--tests/rustdoc/generic-const-items.rs38
-rw-r--r--tests/rustdoc/impl-everywhere.rs2
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs22
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/impl-sized.rs21
-rw-r--r--tests/rustdoc/inline_cross/generic-const-items.rs26
-rw-r--r--tests/rustdoc/inline_cross/impl-sized.rs27
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs13
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api-generics.rs13
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api-hidden.rs16
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api-private.rs32
-rw-r--r--tests/rustdoc/issue-81141-private-reexport-in-public-api.rs124
-rw-r--r--tests/rustdoc/private-use.rs13
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs8
-rw-r--r--tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr52
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs30
-rw-r--r--tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr273
-rw-r--r--tests/ui/abi/stack-probes-lto.rs12
-rw-r--r--tests/ui/abi/stack-probes.rs11
-rw-r--r--tests/ui/annotate-snippet/auxiliary/other_file.rs6
-rw-r--r--tests/ui/annotate-snippet/multiple-files.rs8
-rw-r--r--tests/ui/annotate-snippet/multiple-files.stderr11
-rw-r--r--tests/ui/asm/x86_64/issue-96797.rs1
-rw-r--r--tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr2
-rw-r--r--tests/ui/async-await/in-trait/async-generics-and-bounds.stderr8
-rw-r--r--tests/ui/async-await/in-trait/async-generics.stderr8
-rw-r--r--tests/ui/auto-traits/issue-83857-ub.rs31
-rw-r--r--tests/ui/auto-traits/issue-83857-ub.stderr22
-rw-r--r--tests/ui/codegen/issue-55976.rs2
-rw-r--r--tests/ui/const-generics/issue-93647.rs1
-rw-r--r--tests/ui/const-generics/issue-93647.stderr19
-rw-r--r--tests/ui/const-generics/issues/issue-100313.rs1
-rw-r--r--tests/ui/const-generics/issues/issue-100313.stderr12
-rw-r--r--tests/ui/const-generics/late-bound-vars/in_closure.rs4
-rw-r--r--tests/ui/const-generics/late-bound-vars/in_closure.stderr4
-rw-r--r--tests/ui/const-generics/late-bound-vars/simple.rs2
-rw-r--r--tests/ui/const_prop/apfloat-f64-roundtrip.rs9
-rw-r--r--tests/ui/const_prop/apfloat-remainder-regression.rs15
-rw-r--r--tests/ui/consts/const-block-const-bound.rs4
-rw-r--r--tests/ui/consts/const-block-const-bound.stderr20
-rw-r--r--tests/ui/consts/const-eval/const-eval-query-stack.rs2
-rw-r--r--tests/ui/consts/const-eval/nonnull_as_ref.rs8
-rw-r--r--tests/ui/consts/const-eval/nonnull_as_ref_ub.rs6
-rw-r--r--tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr16
-rw-r--r--tests/ui/consts/const_cmp_type_id.stderr44
-rw-r--r--tests/ui/consts/invalid-inline-const-in-match-arm.rs1
-rw-r--r--tests/ui/consts/invalid-inline-const-in-match-arm.stderr19
-rw-r--r--tests/ui/consts/issue-28113.rs1
-rw-r--r--tests/ui/consts/issue-28113.stderr19
-rw-r--r--tests/ui/consts/issue-56164.rs1
-rw-r--r--tests/ui/consts/issue-56164.stderr21
-rw-r--r--tests/ui/consts/issue-68542-closure-in-array-len.rs1
-rw-r--r--tests/ui/consts/issue-68542-closure-in-array-len.stderr19
-rw-r--r--tests/ui/consts/issue-73976-monomorphic.stderr18
-rw-r--r--tests/ui/consts/issue-94675.rs8
-rw-r--r--tests/ui/consts/issue-94675.stderr22
-rw-r--r--tests/ui/consts/precise-drop-with-promoted.rs8
-rw-r--r--tests/ui/consts/precise-drop-with-promoted.stderr6
-rw-r--r--tests/ui/consts/promoted_const_call.rs14
-rw-r--r--tests/ui/consts/promoted_const_call.stderr25
-rw-r--r--tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs12
-rw-r--r--tests/ui/diagnostic_namespace/can_use_the_diagnostic_name_in_other_places.rs13
-rw-r--r--tests/ui/diagnostic_namespace/existing_proc_macros.rs24
-rw-r--r--tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.rs13
-rw-r--r--tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.stderr35
-rw-r--r--tests/ui/diagnostic_namespace/non_existing_attributes_accepted.rs13
-rw-r--r--tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr16
-rw-r--r--tests/ui/diagnostic_namespace/requires_path.rs9
-rw-r--r--tests/ui/diagnostic_namespace/requires_path.stderr8
-rw-r--r--tests/ui/dyn-star/llvm-old-style-ptrs.rs2
-rw-r--r--tests/ui/feature-gates/print-with-path.cfg.stderr2
-rw-r--r--tests/ui/feature-gates/print-with-path.rs7
-rw-r--r--tests/ui/feature-gates/print-with-path.target-cpus.stderr2
-rw-r--r--tests/ui/feature-gates/print-with-path.target-features.stderr2
-rw-r--r--tests/ui/generator/auto-trait-regions.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.rs3
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.stderr4
-rw-r--r--tests/ui/generic-const-items/associated-const-equality.rs22
-rw-r--r--tests/ui/generic-const-items/basic.rs61
-rw-r--r--tests/ui/generic-const-items/compare-impl-item.rs30
-rw-r--r--tests/ui/generic-const-items/compare-impl-item.stderr66
-rw-r--r--tests/ui/generic-const-items/const-trait-impl.rs24
-rw-r--r--tests/ui/generic-const-items/duplicate-where-clause.rs27
-rw-r--r--tests/ui/generic-const-items/duplicate-where-clause.stderr27
-rw-r--r--tests/ui/generic-const-items/elided-lifetimes.rs18
-rw-r--r--tests/ui/generic-const-items/elided-lifetimes.stderr35
-rw-r--r--tests/ui/generic-const-items/evaluatable-bounds.rs31
-rw-r--r--tests/ui/generic-const-items/evaluatable-bounds.unconstrained.stderr10
-rw-r--r--tests/ui/generic-const-items/feature-gate-generic_const_items.rs37
-rw-r--r--tests/ui/generic-const-items/feature-gate-generic_const_items.stderr77
-rw-r--r--tests/ui/generic-const-items/inference-failure.rs15
-rw-r--r--tests/ui/generic-const-items/inference-failure.stderr20
-rw-r--r--tests/ui/generic-const-items/misplaced-where-clause.fixed18
-rw-r--r--tests/ui/generic-const-items/misplaced-where-clause.rs20
-rw-r--r--tests/ui/generic-const-items/misplaced-where-clause.stderr36
-rw-r--r--tests/ui/generic-const-items/parameter-defaults.rs14
-rw-r--r--tests/ui/generic-const-items/parameter-defaults.stderr8
-rw-r--r--tests/ui/generic-const-items/recursive.rs12
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs12
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr18
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.rs12
-rw-r--r--tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.stderr11
-rw-r--r--tests/ui/generic-const-items/unsatisfied-bounds.rs34
-rw-r--r--tests/ui/generic-const-items/unsatisfied-bounds.stderr62
-rw-r--r--tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.rs12
-rw-r--r--tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.stderr9
-rw-r--r--tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs17
-rw-r--r--tests/ui/generic-const-items/unsatisfied-outlives-bounds.stderr18
-rw-r--r--tests/ui/generics/issue-94923.rs1
-rw-r--r--tests/ui/hello_world/main.rs2
-rw-r--r--tests/ui/impl-trait/auto-trait-leak0
-rw-r--r--tests/ui/impl-trait/autoderef.rs2
-rw-r--r--tests/ui/impl-trait/hidden-type-is-opaque-2.rs6
-rw-r--r--tests/ui/impl-trait/hidden-type-is-opaque-2.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs29
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs11
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr33
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs24
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs10
-rw-r--r--tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs18
-rw-r--r--tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.stderr4
-rw-r--r--tests/ui/impl-trait/normalize-tait-in-const.rs5
-rw-r--r--tests/ui/impl-trait/normalize-tait-in-const.stderr14
-rw-r--r--tests/ui/impl-trait/recursive-auto-trait.rs10
-rw-r--r--tests/ui/imports/ambiguous-1.rs30
-rw-r--r--tests/ui/imports/ambiguous-1.stderr36
-rw-r--r--tests/ui/imports/ambiguous-10.rs19
-rw-r--r--tests/ui/imports/ambiguous-10.stderr25
-rw-r--r--tests/ui/imports/ambiguous-11.rs14
-rw-r--r--tests/ui/imports/ambiguous-11.stderr23
-rw-r--r--tests/ui/imports/ambiguous-12.rs25
-rw-r--r--tests/ui/imports/ambiguous-12.stderr25
-rw-r--r--tests/ui/imports/ambiguous-13.rs22
-rw-r--r--tests/ui/imports/ambiguous-13.stderr25
-rw-r--r--tests/ui/imports/ambiguous-14.rs26
-rw-r--r--tests/ui/imports/ambiguous-14.stderr25
-rw-r--r--tests/ui/imports/ambiguous-15.rs27
-rw-r--r--tests/ui/imports/ambiguous-15.stderr25
-rw-r--r--tests/ui/imports/ambiguous-16.rs27
-rw-r--r--tests/ui/imports/ambiguous-16.stderr25
-rw-r--r--tests/ui/imports/ambiguous-17.rs29
-rw-r--r--tests/ui/imports/ambiguous-17.stderr35
-rw-r--r--tests/ui/imports/ambiguous-2.rs9
-rw-r--r--tests/ui/imports/ambiguous-3.rs21
-rw-r--r--tests/ui/imports/ambiguous-3.stderr25
-rw-r--r--tests/ui/imports/ambiguous-4-extern.rs26
-rw-r--r--tests/ui/imports/ambiguous-4-extern.stderr35
-rw-r--r--tests/ui/imports/ambiguous-4.rs9
-rw-r--r--tests/ui/imports/ambiguous-5.rs24
-rw-r--r--tests/ui/imports/ambiguous-5.stderr25
-rw-r--r--tests/ui/imports/ambiguous-6.rs20
-rw-r--r--tests/ui/imports/ambiguous-6.stderr25
-rw-r--r--tests/ui/imports/ambiguous-7.rs18
-rw-r--r--tests/ui/imports/ambiguous-7.stderr23
-rw-r--r--tests/ui/imports/ambiguous-8.rs14
-rw-r--r--tests/ui/imports/ambiguous-8.stderr23
-rw-r--r--tests/ui/imports/ambiguous-9.rs29
-rw-r--r--tests/ui/imports/ambiguous-9.stderr65
-rw-r--r--tests/ui/imports/auxiliary/ambiguous-11-extern.rs6
-rw-r--r--tests/ui/imports/auxiliary/ambiguous-8-extern.rs12
-rw-r--r--tests/ui/imports/auxiliary/extern-with-ambiguous-1-extern.rs4
-rw-r--r--tests/ui/imports/auxiliary/extern-with-ambiguous-2-extern.rs9
-rw-r--r--tests/ui/imports/auxiliary/extern-with-ambiguous-3-extern.rs14
-rw-r--r--tests/ui/imports/duplicate.rs2
-rw-r--r--tests/ui/imports/duplicate.stderr37
-rw-r--r--tests/ui/imports/extern-with-ambiguous-1.rs19
-rw-r--r--tests/ui/imports/extern-with-ambiguous-1.stderr23
-rw-r--r--tests/ui/imports/extern-with-ambiguous-2.rs16
-rw-r--r--tests/ui/imports/extern-with-ambiguous-3.rs17
-rw-r--r--tests/ui/imports/import-after-macro-expand-1.rs19
-rw-r--r--tests/ui/imports/import-after-macro-expand-2.rs27
-rw-r--r--tests/ui/imports/import-after-macro-expand-3.rs24
-rw-r--r--tests/ui/imports/import-after-macro-expand-4.rs30
-rw-r--r--tests/ui/imports/import-after-macro-expand-4.stderr53
-rw-r--r--tests/ui/imports/import-after-macro-expand-5.rs31
-rw-r--r--tests/ui/imports/import-after-macro-expand-6.rs24
-rw-r--r--tests/ui/imports/import-after-macro-expand-7.rs21
-rw-r--r--tests/ui/imports/import-after-macro-expand-8.rs22
-rw-r--r--tests/ui/imports/issue-81413.rs23
-rw-r--r--tests/ui/imports/issue-81413.stderr11
-rw-r--r--tests/ui/issues/issue-11820.rs2
-rw-r--r--tests/ui/layout/malformed-unsized-type-in-union.rs8
-rw-r--r--tests/ui/layout/malformed-unsized-type-in-union.stderr9
-rw-r--r--tests/ui/lazy-type-alias/enum-variant.rs (renamed from tests/ui/type-alias/lazy-type-alias-enum-variant.rs)1
-rw-r--r--tests/ui/lazy-type-alias/enum-variant.stderr11
-rw-r--r--tests/ui/lazy-type-alias/type-alias-bounds-are-enforced.rs14
-rw-r--r--tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.rs8
-rw-r--r--tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.stderr14
-rw-r--r--tests/ui/lint/lint-cap-trait-bounds.rs8
-rw-r--r--tests/ui/lint/noop-method-call.fixed51
-rw-r--r--tests/ui/lint/noop-method-call.rs30
-rw-r--r--tests/ui/lint/noop-method-call.stderr64
-rw-r--r--tests/ui/lint/reference_casting.rs (renamed from tests/ui/lint/cast_ref_to_mut.rs)1
-rw-r--r--tests/ui/lint/reference_casting.stderr (renamed from tests/ui/lint/cast_ref_to_mut.stderr)26
-rw-r--r--tests/ui/lint/suspicious-double-ref-op.rs27
-rw-r--r--tests/ui/lint/suspicious-double-ref-op.stderr33
-rw-r--r--tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs6
-rw-r--r--tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr15
-rw-r--r--tests/ui/mismatched_types/closure-ref-114180.rs8
-rw-r--r--tests/ui/mismatched_types/closure-ref-114180.stderr22
-rw-r--r--tests/ui/mismatched_types/ref-pat-suggestions.stderr44
-rw-r--r--tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs15
-rw-r--r--tests/ui/object-safety/assoc_const_bounds.rs9
-rw-r--r--tests/ui/object-safety/assoc_const_bounds.stderr15
-rw-r--r--tests/ui/object-safety/assoc_const_bounds_sized.rs9
-rw-r--r--tests/ui/object-safety/assoc_const_bounds_sized.stderr15
-rw-r--r--tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr2
-rw-r--r--tests/ui/panics/short-ice-remove-middle-frames.run.stderr1
-rw-r--r--tests/ui/parser/generic-statics.rs4
-rw-r--r--tests/ui/parser/generic-statics.stderr8
-rw-r--r--tests/ui/parser/ternary_operator.rs69
-rw-r--r--tests/ui/parser/ternary_operator.stderr115
-rw-r--r--tests/ui/privacy/issue-113860-1.rs16
-rw-r--r--tests/ui/privacy/issue-113860-1.stderr49
-rw-r--r--tests/ui/privacy/issue-113860-2.rs16
-rw-r--r--tests/ui/privacy/issue-113860-2.stderr49
-rw-r--r--tests/ui/privacy/issue-113860.rs16
-rw-r--r--tests/ui/privacy/issue-113860.stderr49
-rw-r--r--tests/ui/privacy/unnameable_types.rs4
-rw-r--r--tests/ui/privacy/unnameable_types.stderr14
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowed.rs2
-rw-r--r--tests/ui/proc-macro/derive-in-mod.rs2
-rw-r--r--tests/ui/proc-macro/edition-imports-2018.rs2
-rw-r--r--tests/ui/proc-macro/extern-prelude-extern-crate-proc-macro.rs2
-rw-r--r--tests/ui/proc-macro/helper-attr-blocked-by-import.rs2
-rw-r--r--tests/ui/proc-macro/issue-53481.rs2
-rw-r--r--tests/ui/proc-macro/macro-use-attr.rs2
-rw-r--r--tests/ui/proc-macro/macro-use-bang.rs2
-rw-r--r--tests/ui/process/println-with-broken-pipe.rs44
-rw-r--r--tests/ui/process/println-with-broken-pipe.run.stderr2
-rw-r--r--tests/ui/process/println-with-broken-pipe.run.stdout1
-rw-r--r--tests/ui/resolve/derive-macro-1.rs (renamed from tests/ui/resolve/issue-112831.rs)6
-rw-r--r--tests/ui/resolve/derive-macro-2.rs18
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs2
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr12
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr17
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr15
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr19
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs2
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr12
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs3
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr9
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr55
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr61
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr63
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr19
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs7
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr19
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr12
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr22
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr15
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs2
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr6
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs7
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr36
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs6
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr19
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs3
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr11
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr22
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr16
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs8
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr16
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr16
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs5
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr20
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs6
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr35
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.rs28
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.stderr80
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-pass.rs35
-rw-r--r--tests/ui/simd/intrinsic/generic-bswap-byte.rs22
-rw-r--r--tests/ui/suggestions/copied-and-cloned.fixed16
-rw-r--r--tests/ui/suggestions/copied-and-cloned.rs16
-rw-r--r--tests/ui/suggestions/copied-and-cloned.stderr30
-rw-r--r--tests/ui/suggestions/missing-lifetime-in-assoc-const-type.default.stderr (renamed from tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr)8
-rw-r--r--tests/ui/suggestions/missing-lifetime-in-assoc-const-type.generic_const_items.stderr47
-rw-r--r--tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs4
-rw-r--r--tests/ui/target-feature/gate.rs15
-rw-r--r--tests/ui/target-feature/gate.stderr2
-rw-r--r--tests/ui/target-feature/invalid-attribute.rs14
-rw-r--r--tests/ui/target-feature/invalid-attribute.stderr44
-rw-r--r--tests/ui/traits/new-solver/dont-loop-fulfill-on-region-constraints.rs32
-rw-r--r--tests/ui/type-alias-impl-trait/broken_mir.rs16
-rw-r--r--tests/ui/underscore-imports/cycle.rs2
-rw-r--r--tests/ui/underscore-imports/hygiene.rs1
-rw-r--r--triagebot.toml10
956 files changed, 12248 insertions, 18694 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0842b69c219..bc66dcddc4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -55,7 +55,7 @@ jobs:
           - name: mingw-check-tidy
             os: ubuntu-20.04-16core-64gb
             env: {}
-          - name: x86_64-gnu-llvm-14
+          - name: x86_64-gnu-llvm-15
             os: ubuntu-20.04-16core-64gb
             env: {}
           - name: x86_64-gnu-tools
@@ -293,10 +293,6 @@ jobs:
             env:
               RUST_BACKTRACE: 1
             os: ubuntu-20.04-8core-32gb
-          - name: x86_64-gnu-llvm-14
-            env:
-              RUST_BACKTRACE: 1
-            os: ubuntu-20.04-8core-32gb
           - name: x86_64-gnu-nopt
             os: ubuntu-20.04-4core-16gb
             env: {}
diff --git a/.gitmodules b/.gitmodules
index 6b7160bfe15..b48fddf963f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,34 +1,45 @@
 [submodule "src/doc/nomicon"]
 	path = src/doc/nomicon
 	url = https://github.com/rust-lang/nomicon.git
+	shallow = true
 [submodule "src/tools/cargo"]
 	path = src/tools/cargo
 	url = https://github.com/rust-lang/cargo.git
+	shallow = true
 [submodule "src/doc/reference"]
 	path = src/doc/reference
 	url = https://github.com/rust-lang/reference.git
+	shallow = true
 [submodule "src/doc/book"]
 	path = src/doc/book
 	url = https://github.com/rust-lang/book.git
+	shallow = true
 [submodule "src/doc/rust-by-example"]
 	path = src/doc/rust-by-example
 	url = https://github.com/rust-lang/rust-by-example.git
+	shallow = true
 [submodule "library/stdarch"]
 	path = library/stdarch
 	url = https://github.com/rust-lang/stdarch.git
+	shallow = true
 [submodule "src/doc/rustc-dev-guide"]
 	path = src/doc/rustc-dev-guide
 	url = https://github.com/rust-lang/rustc-dev-guide.git
+	shallow = true
 [submodule "src/doc/edition-guide"]
 	path = src/doc/edition-guide
 	url = https://github.com/rust-lang/edition-guide.git
+	shallow = true
 [submodule "src/llvm-project"]
 	path = src/llvm-project
 	url = https://github.com/rust-lang/llvm-project.git
 	branch = rustc/16.0-2023-06-05
+	shallow = true
 [submodule "src/doc/embedded-book"]
 	path = src/doc/embedded-book
 	url = https://github.com/rust-embedded/book.git
+	shallow = true
 [submodule "library/backtrace"]
 	path = library/backtrace
 	url = https://github.com/rust-lang/backtrace-rs.git
+	shallow = true
diff --git a/.reuse/dep5 b/.reuse/dep5
index 9a59f455fe9..5546a7cf391 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -38,11 +38,6 @@ Files: compiler/*
 Copyright: The Rust Project Developers (see https://thanks.rust-lang.org)
 License: MIT or Apache-2.0
 
-Files: compiler/rustc_apfloat/*
-Copyright: LLVM APFloat authors
-           The Rust Project Developers (see https://thanks.rust-lang.org)
-License: NCSA AND (MIT OR Apache-2.0)
-
 Files: compiler/rustc_codegen_cranelift/src/cranelift_native.rs
 Copyright: The Cranelift Project Developers
            The Rust Project Developers (see https://thanks.rust-lang.org)
diff --git a/Cargo.lock b/Cargo.lock
index 72f0236fd08..53e1e4d7567 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -220,7 +220,7 @@ dependencies = [
  "proc-macro2",
  "quote",
  "serde",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -502,7 +502,7 @@ dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -527,7 +527,7 @@ dependencies = [
  "regex",
  "rustc_tools_util",
  "serde",
- "syn 2.0.8",
+ "syn 2.0.27",
  "tempfile",
  "termize",
  "tester",
@@ -842,7 +842,7 @@ version = "0.1.73"
 dependencies = [
  "itertools",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -943,7 +943,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -1309,7 +1309,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -2456,7 +2456,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -2495,6 +2495,7 @@ dependencies = [
  "serde_json",
  "sysinfo",
  "tar",
+ "tempfile",
  "xz",
  "zip",
 ]
@@ -2643,7 +2644,7 @@ dependencies = [
  "pest_meta",
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -3135,7 +3136,9 @@ dependencies = [
 
 [[package]]
 name = "rustc_apfloat"
-version = "0.0.0"
+version = "0.2.0+llvm-462a31f5a5ab"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "465187772033a5ee566f69fe008df03628fce549a0899aae76f0a0c2e34696be"
 dependencies = [
  "bitflags 1.3.2",
  "smallvec",
@@ -3584,7 +3587,7 @@ dependencies = [
  "fluent-syntax",
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
  "unic-langid",
 ]
 
@@ -3732,7 +3735,6 @@ dependencies = [
 name = "rustc_interface"
 version = "0.0.0"
 dependencies = [
- "atty",
  "libloading",
  "rustc-rayon",
  "rustc-rayon-core",
@@ -3854,7 +3856,7 @@ version = "0.1.0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
  "synstructure 0.13.0",
 ]
 
@@ -4196,7 +4198,6 @@ dependencies = [
 name = "rustc_session"
 version = "0.0.0"
 dependencies = [
- "atty",
  "bitflags 1.3.2",
  "getopts",
  "libc",
@@ -4462,7 +4463,7 @@ dependencies = [
  "proc-macro2",
  "quote",
  "serde",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -4629,7 +4630,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -4725,9 +4726,9 @@ dependencies = [
 
 [[package]]
 name = "smallvec"
-version = "1.10.0"
+version = "1.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
+checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
 
 [[package]]
 name = "snap"
@@ -4910,9 +4911,9 @@ dependencies = [
 
 [[package]]
 name = "syn"
-version = "2.0.8"
+version = "2.0.27"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"
+checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -4939,7 +4940,7 @@ checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
  "unicode-xid",
 ]
 
@@ -5089,7 +5090,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -5310,7 +5311,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
 ]
 
 [[package]]
@@ -5740,7 +5741,7 @@ dependencies = [
  "once_cell",
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
  "wasm-bindgen-shared",
 ]
 
@@ -5774,7 +5775,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.8",
+ "syn 2.0.27",
  "wasm-bindgen-backend",
  "wasm-bindgen-shared",
 ]
diff --git a/LICENSES/NCSA.txt b/LICENSES/NCSA.txt
deleted file mode 100644
index cf5413effa2..00000000000
--- a/LICENSES/NCSA.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-University of Illinois/NCSA Open Source License
-
-Copyright (c) <Year> <Owner Organization Name>. All rights reserved.
-
-Developed by: <Name of Development Group> <Name of Institution> <URL for Development Group/Institution>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
-
-     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
-
-     * Neither the names of <Name of Development Group, Name of Institution>, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
diff --git a/compiler/rustc/build.rs b/compiler/rustc/build.rs
index 39cf3e094c8..8b7d28d2b8a 100644
--- a/compiler/rustc/build.rs
+++ b/compiler/rustc/build.rs
@@ -18,7 +18,7 @@ fn set_windows_exe_options() {
     let mut manifest = env::current_dir().unwrap();
     manifest.push(WINDOWS_MANIFEST_FILE);
 
-    println!("cargo:rerun-if-changed={}", WINDOWS_MANIFEST_FILE);
+    println!("cargo:rerun-if-changed={WINDOWS_MANIFEST_FILE}");
     // Embed the Windows application manifest file.
     println!("cargo:rustc-link-arg-bin=rustc-main=/MANIFEST:EMBED");
     println!("cargo:rustc-link-arg-bin=rustc-main=/MANIFESTINPUT:{}", manifest.to_str().unwrap());
diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs
index 489a8403c3b..a8a1a90572d 100644
--- a/compiler/rustc_abi/src/layout.rs
+++ b/compiler/rustc_abi/src/layout.rs
@@ -260,8 +260,7 @@ pub trait LayoutCalculator {
                 }
                 _ => assert!(
                     start == Bound::Unbounded && end == Bound::Unbounded,
-                    "nonscalar layout for layout_scalar_valid_range type: {:#?}",
-                    st,
+                    "nonscalar layout for layout_scalar_valid_range type: {st:#?}",
                 ),
             }
 
@@ -463,7 +462,7 @@ pub trait LayoutCalculator {
             min = 0;
             max = 0;
         }
-        assert!(min <= max, "discriminant range is {}...{}", min, max);
+        assert!(min <= max, "discriminant range is {min}...{max}");
         let (min_ity, signed) = discr_range_of_repr(min, max); //Integer::repr_discr(tcx, ty, &repr, min, max);
 
         let mut align = dl.aggregate_align;
@@ -537,8 +536,7 @@ pub trait LayoutCalculator {
             // space necessary to represent would have to be discarded (or layout is wrong
             // on thinking it needs 16 bits)
             panic!(
-                "layout decided on a larger discriminant type ({:?}) than typeck ({:?})",
-                min_ity, typeck_ity
+                "layout decided on a larger discriminant type ({min_ity:?}) than typeck ({typeck_ity:?})"
             );
             // However, it is fine to make discr type however large (as an optimisation)
             // after this point – we’ll just truncate the value we load in codegen.
diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs
index 835143407d2..1442747fe1e 100644
--- a/compiler/rustc_abi/src/lib.rs
+++ b/compiler/rustc_abi/src/lib.rs
@@ -332,7 +332,7 @@ impl TargetDataLayout {
             16 => 1 << 15,
             32 => 1 << 31,
             64 => 1 << 47,
-            bits => panic!("obj_size_bound: unknown pointer bit size {}", bits),
+            bits => panic!("obj_size_bound: unknown pointer bit size {bits}"),
         }
     }
 
@@ -342,7 +342,7 @@ impl TargetDataLayout {
             16 => I16,
             32 => I32,
             64 => I64,
-            bits => panic!("ptr_sized_integer: unknown pointer bit size {}", bits),
+            bits => panic!("ptr_sized_integer: unknown pointer bit size {bits}"),
         }
     }
 
@@ -399,7 +399,7 @@ impl FromStr for Endian {
         match s {
             "little" => Ok(Self::Little),
             "big" => Ok(Self::Big),
-            _ => Err(format!(r#"unknown endian: "{}""#, s)),
+            _ => Err(format!(r#"unknown endian: "{s}""#)),
         }
     }
 }
@@ -456,7 +456,7 @@ impl Size {
     pub fn bits(self) -> u64 {
         #[cold]
         fn overflow(bytes: u64) -> ! {
-            panic!("Size::bits: {} bytes in bits doesn't fit in u64", bytes)
+            panic!("Size::bits: {bytes} bytes in bits doesn't fit in u64")
         }
 
         self.bytes().checked_mul(8).unwrap_or_else(|| overflow(self.bytes()))
@@ -1179,17 +1179,12 @@ impl FieldsShape {
                 unreachable!("FieldsShape::offset: `Primitive`s have no fields")
             }
             FieldsShape::Union(count) => {
-                assert!(
-                    i < count.get(),
-                    "tried to access field {} of union with {} fields",
-                    i,
-                    count
-                );
+                assert!(i < count.get(), "tried to access field {i} of union with {count} fields");
                 Size::ZERO
             }
             FieldsShape::Array { stride, count } => {
                 let i = u64::try_from(i).unwrap();
-                assert!(i < count, "tried to access field {} of array with {} fields", i, count);
+                assert!(i < count, "tried to access field {i} of array with {count} fields");
                 stride * i
             }
             FieldsShape::Arbitrary { ref offsets, .. } => offsets[FieldIdx::from_usize(i)],
@@ -1294,7 +1289,7 @@ impl Abi {
                 Primitive::Int(_, signed) => signed,
                 _ => false,
             },
-            _ => panic!("`is_signed` on non-scalar ABI {:?}", self),
+            _ => panic!("`is_signed` on non-scalar ABI {self:?}"),
         }
     }
 
diff --git a/compiler/rustc_apfloat/Cargo.toml b/compiler/rustc_apfloat/Cargo.toml
deleted file mode 100644
index 98305201bc9..00000000000
--- a/compiler/rustc_apfloat/Cargo.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[package]
-name = "rustc_apfloat"
-version = "0.0.0"
-edition = "2021"
-
-[dependencies]
-bitflags = "1.2.1"
-smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
diff --git a/compiler/rustc_apfloat/src/ieee.rs b/compiler/rustc_apfloat/src/ieee.rs
deleted file mode 100644
index 2286712f025..00000000000
--- a/compiler/rustc_apfloat/src/ieee.rs
+++ /dev/null
@@ -1,2757 +0,0 @@
-use crate::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
-use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
-
-use core::cmp::{self, Ordering};
-use core::fmt::{self, Write};
-use core::marker::PhantomData;
-use core::mem;
-use core::ops::Neg;
-use smallvec::{smallvec, SmallVec};
-
-#[must_use]
-pub struct IeeeFloat<S> {
-    /// Absolute significand value (including the integer bit).
-    sig: [Limb; 1],
-
-    /// The signed unbiased exponent of the value.
-    exp: ExpInt,
-
-    /// What kind of floating point number this is.
-    category: Category,
-
-    /// Sign bit of the number.
-    sign: bool,
-
-    marker: PhantomData<S>,
-}
-
-/// Fundamental unit of big integer arithmetic, but also
-/// large to store the largest significands by itself.
-type Limb = u128;
-const LIMB_BITS: usize = 128;
-fn limbs_for_bits(bits: usize) -> usize {
-    (bits + LIMB_BITS - 1) / LIMB_BITS
-}
-
-/// Enum that represents what fraction of the LSB truncated bits of an fp number
-/// represent.
-///
-/// This essentially combines the roles of guard and sticky bits.
-#[must_use]
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-enum Loss {
-    // Example of truncated bits:
-    ExactlyZero,  // 000000
-    LessThanHalf, // 0xxxxx  x's not all zero
-    ExactlyHalf,  // 100000
-    MoreThanHalf, // 1xxxxx  x's not all zero
-}
-
-/// Represents floating point arithmetic semantics.
-pub trait Semantics: Sized {
-    /// Total number of bits in the in-memory format.
-    const BITS: usize;
-
-    /// Number of bits in the significand. This includes the integer bit.
-    const PRECISION: usize;
-
-    /// The largest E such that 2<sup>E</sup> is representable; this matches the
-    /// definition of IEEE 754.
-    const MAX_EXP: ExpInt;
-
-    /// The smallest E such that 2<sup>E</sup> is a normalized number; this
-    /// matches the definition of IEEE 754.
-    const MIN_EXP: ExpInt = -Self::MAX_EXP + 1;
-
-    /// The significand bit that marks NaN as quiet.
-    const QNAN_BIT: usize = Self::PRECISION - 2;
-
-    /// The significand bitpattern to mark a NaN as quiet.
-    /// NOTE: for X87DoubleExtended we need to set two bits instead of 2.
-    const QNAN_SIGNIFICAND: Limb = 1 << Self::QNAN_BIT;
-
-    fn from_bits(bits: u128) -> IeeeFloat<Self> {
-        assert!(Self::BITS > Self::PRECISION);
-
-        let sign = bits & (1 << (Self::BITS - 1));
-        let exponent = (bits & !sign) >> (Self::PRECISION - 1);
-        let mut r = IeeeFloat {
-            sig: [bits & ((1 << (Self::PRECISION - 1)) - 1)],
-            // Convert the exponent from its bias representation to a signed integer.
-            exp: (exponent as ExpInt) - Self::MAX_EXP,
-            category: Category::Zero,
-            sign: sign != 0,
-            marker: PhantomData,
-        };
-
-        if r.exp == Self::MIN_EXP - 1 && r.sig == [0] {
-            // Exponent, significand meaningless.
-            r.category = Category::Zero;
-        } else if r.exp == Self::MAX_EXP + 1 && r.sig == [0] {
-            // Exponent, significand meaningless.
-            r.category = Category::Infinity;
-        } else if r.exp == Self::MAX_EXP + 1 && r.sig != [0] {
-            // Sign, exponent, significand meaningless.
-            r.category = Category::NaN;
-        } else {
-            r.category = Category::Normal;
-            if r.exp == Self::MIN_EXP - 1 {
-                // Denormal.
-                r.exp = Self::MIN_EXP;
-            } else {
-                // Set integer bit.
-                sig::set_bit(&mut r.sig, Self::PRECISION - 1);
-            }
-        }
-
-        r
-    }
-
-    fn to_bits(x: IeeeFloat<Self>) -> u128 {
-        assert!(Self::BITS > Self::PRECISION);
-
-        // Split integer bit from significand.
-        let integer_bit = sig::get_bit(&x.sig, Self::PRECISION - 1);
-        let mut significand = x.sig[0] & ((1 << (Self::PRECISION - 1)) - 1);
-        let exponent = match x.category {
-            Category::Normal => {
-                if x.exp == Self::MIN_EXP && !integer_bit {
-                    // Denormal.
-                    Self::MIN_EXP - 1
-                } else {
-                    x.exp
-                }
-            }
-            Category::Zero => {
-                // FIXME(eddyb) Maybe we should guarantee an invariant instead?
-                significand = 0;
-                Self::MIN_EXP - 1
-            }
-            Category::Infinity => {
-                // FIXME(eddyb) Maybe we should guarantee an invariant instead?
-                significand = 0;
-                Self::MAX_EXP + 1
-            }
-            Category::NaN => Self::MAX_EXP + 1,
-        };
-
-        // Convert the exponent from a signed integer to its bias representation.
-        let exponent = (exponent + Self::MAX_EXP) as u128;
-
-        ((x.sign as u128) << (Self::BITS - 1)) | (exponent << (Self::PRECISION - 1)) | significand
-    }
-}
-
-impl<S> Copy for IeeeFloat<S> {}
-impl<S> Clone for IeeeFloat<S> {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-
-macro_rules! ieee_semantics {
-    ($($name:ident = $sem:ident($bits:tt : $exp_bits:tt)),*) => {
-        $(pub struct $sem;)*
-        $(pub type $name = IeeeFloat<$sem>;)*
-        $(impl Semantics for $sem {
-            const BITS: usize = $bits;
-            const PRECISION: usize = ($bits - 1 - $exp_bits) + 1;
-            const MAX_EXP: ExpInt = (1 << ($exp_bits - 1)) - 1;
-        })*
-    }
-}
-
-ieee_semantics! {
-    Half = HalfS(16:5),
-    Single = SingleS(32:8),
-    Double = DoubleS(64:11),
-    Quad = QuadS(128:15)
-}
-
-pub struct X87DoubleExtendedS;
-pub type X87DoubleExtended = IeeeFloat<X87DoubleExtendedS>;
-impl Semantics for X87DoubleExtendedS {
-    const BITS: usize = 80;
-    const PRECISION: usize = 64;
-    const MAX_EXP: ExpInt = (1 << (15 - 1)) - 1;
-
-    /// For x87 extended precision, we want to make a NaN, not a
-    /// pseudo-NaN. Maybe we should expose the ability to make
-    /// pseudo-NaNs?
-    const QNAN_SIGNIFICAND: Limb = 0b11 << Self::QNAN_BIT;
-
-    /// Integer bit is explicit in this format. Intel hardware (387 and later)
-    /// does not support these bit patterns:
-    ///  exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity")
-    ///  exponent = all 1's, integer bit 0, significand nonzero ("pseudoNaN")
-    ///  exponent = 0, integer bit 1 ("pseudodenormal")
-    ///  exponent != 0 nor all 1's, integer bit 0 ("unnormal")
-    /// At the moment, the first two are treated as NaNs, the second two as Normal.
-    fn from_bits(bits: u128) -> IeeeFloat<Self> {
-        let sign = bits & (1 << (Self::BITS - 1));
-        let exponent = (bits & !sign) >> Self::PRECISION;
-        let mut r = IeeeFloat {
-            sig: [bits & ((1 << (Self::PRECISION - 1)) - 1)],
-            // Convert the exponent from its bias representation to a signed integer.
-            exp: (exponent as ExpInt) - Self::MAX_EXP,
-            category: Category::Zero,
-            sign: sign != 0,
-            marker: PhantomData,
-        };
-
-        if r.exp == Self::MIN_EXP - 1 && r.sig == [0] {
-            // Exponent, significand meaningless.
-            r.category = Category::Zero;
-        } else if r.exp == Self::MAX_EXP + 1 && r.sig == [1 << (Self::PRECISION - 1)] {
-            // Exponent, significand meaningless.
-            r.category = Category::Infinity;
-        } else if r.exp == Self::MAX_EXP + 1 && r.sig != [1 << (Self::PRECISION - 1)] {
-            // Sign, exponent, significand meaningless.
-            r.category = Category::NaN;
-        } else {
-            r.category = Category::Normal;
-            if r.exp == Self::MIN_EXP - 1 {
-                // Denormal.
-                r.exp = Self::MIN_EXP;
-            }
-        }
-
-        r
-    }
-
-    fn to_bits(x: IeeeFloat<Self>) -> u128 {
-        // Get integer bit from significand.
-        let integer_bit = sig::get_bit(&x.sig, Self::PRECISION - 1);
-        let mut significand = x.sig[0] & ((1 << Self::PRECISION) - 1);
-        let exponent = match x.category {
-            Category::Normal => {
-                if x.exp == Self::MIN_EXP && !integer_bit {
-                    // Denormal.
-                    Self::MIN_EXP - 1
-                } else {
-                    x.exp
-                }
-            }
-            Category::Zero => {
-                // FIXME(eddyb) Maybe we should guarantee an invariant instead?
-                significand = 0;
-                Self::MIN_EXP - 1
-            }
-            Category::Infinity => {
-                // FIXME(eddyb) Maybe we should guarantee an invariant instead?
-                significand = 1 << (Self::PRECISION - 1);
-                Self::MAX_EXP + 1
-            }
-            Category::NaN => Self::MAX_EXP + 1,
-        };
-
-        // Convert the exponent from a signed integer to its bias representation.
-        let exponent = (exponent + Self::MAX_EXP) as u128;
-
-        ((x.sign as u128) << (Self::BITS - 1)) | (exponent << Self::PRECISION) | significand
-    }
-}
-
-float_common_impls!(IeeeFloat<S>);
-
-impl<S: Semantics> PartialEq for IeeeFloat<S> {
-    fn eq(&self, rhs: &Self) -> bool {
-        self.partial_cmp(rhs) == Some(Ordering::Equal)
-    }
-}
-
-impl<S: Semantics> PartialOrd for IeeeFloat<S> {
-    fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> {
-        match (self.category, rhs.category) {
-            (Category::NaN, _) | (_, Category::NaN) => None,
-
-            (Category::Infinity, Category::Infinity) => Some((!self.sign).cmp(&(!rhs.sign))),
-
-            (Category::Zero, Category::Zero) => Some(Ordering::Equal),
-
-            (Category::Infinity, _) | (Category::Normal, Category::Zero) => {
-                Some((!self.sign).cmp(&self.sign))
-            }
-
-            (_, Category::Infinity) | (Category::Zero, Category::Normal) => {
-                Some(rhs.sign.cmp(&(!rhs.sign)))
-            }
-
-            (Category::Normal, Category::Normal) => {
-                // Two normal numbers. Do they have the same sign?
-                Some((!self.sign).cmp(&(!rhs.sign)).then_with(|| {
-                    // Compare absolute values; invert result if negative.
-                    let result = self.cmp_abs_normal(*rhs);
-
-                    if self.sign { result.reverse() } else { result }
-                }))
-            }
-        }
-    }
-}
-
-impl<S> Neg for IeeeFloat<S> {
-    type Output = Self;
-    fn neg(mut self) -> Self {
-        self.sign = !self.sign;
-        self
-    }
-}
-
-/// Prints this value as a decimal string.
-///
-/// \param precision The maximum number of digits of
-///   precision to output. If there are fewer digits available,
-///   zero padding will not be used unless the value is
-///   integral and small enough to be expressed in
-///   precision digits. 0 means to use the natural
-///   precision of the number.
-/// \param width The maximum number of zeros to
-///   consider inserting before falling back to scientific
-///   notation. 0 means to always use scientific notation.
-///
-/// \param alternate Indicate whether to remove the trailing zero in
-///   fraction part or not. Also setting this parameter to true forces
-///   producing of output more similar to default printf behavior.
-///   Specifically the lower e is used as exponent delimiter and exponent
-///   always contains no less than two digits.
-///
-/// Number       precision    width      Result
-/// ------       ---------    -----      ------
-/// 1.01E+4              5        2       10100
-/// 1.01E+4              4        2       1.01E+4
-/// 1.01E+4              5        1       1.01E+4
-/// 1.01E-2              5        2       0.0101
-/// 1.01E-2              4        2       0.0101
-/// 1.01E-2              4        1       1.01E-2
-impl<S: Semantics> fmt::Display for IeeeFloat<S> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        let width = f.width().unwrap_or(3);
-        let alternate = f.alternate();
-
-        match self.category {
-            Category::Infinity => {
-                if self.sign {
-                    return f.write_str("-Inf");
-                } else {
-                    return f.write_str("+Inf");
-                }
-            }
-
-            Category::NaN => return f.write_str("NaN"),
-
-            Category::Zero => {
-                if self.sign {
-                    f.write_char('-')?;
-                }
-
-                if width == 0 {
-                    if alternate {
-                        f.write_str("0.0")?;
-                        if let Some(n) = f.precision() {
-                            for _ in 1..n {
-                                f.write_char('0')?;
-                            }
-                        }
-                        f.write_str("e+00")?;
-                    } else {
-                        f.write_str("0.0E+0")?;
-                    }
-                } else {
-                    f.write_char('0')?;
-                }
-                return Ok(());
-            }
-
-            Category::Normal => {}
-        }
-
-        if self.sign {
-            f.write_char('-')?;
-        }
-
-        // We use enough digits so the number can be round-tripped back to an
-        // APFloat. The formula comes from "How to Print Floating-Point Numbers
-        // Accurately" by Steele and White.
-        // FIXME: Using a formula based purely on the precision is conservative;
-        // we can print fewer digits depending on the actual value being printed.
-
-        // precision = 2 + floor(S::PRECISION / lg_2(10))
-        let precision = f.precision().unwrap_or(2 + S::PRECISION * 59 / 196);
-
-        // Decompose the number into an APInt and an exponent.
-        let mut exp = self.exp - (S::PRECISION as ExpInt - 1);
-        let mut sig = vec![self.sig[0]];
-
-        // Ignore trailing binary zeros.
-        let trailing_zeros = sig[0].trailing_zeros();
-        let _: Loss = sig::shift_right(&mut sig, &mut exp, trailing_zeros as usize);
-
-        // Change the exponent from 2^e to 10^e.
-        if exp == 0 {
-            // Nothing to do.
-        } else if exp > 0 {
-            // Just shift left.
-            let shift = exp as usize;
-            sig.resize(limbs_for_bits(S::PRECISION + shift), 0);
-            sig::shift_left(&mut sig, &mut exp, shift);
-        } else {
-            // exp < 0
-            let mut texp = -exp as usize;
-
-            // We transform this using the identity:
-            //   (N)(2^-e) == (N)(5^e)(10^-e)
-
-            // Multiply significand by 5^e.
-            //   N * 5^0101 == N * 5^(1*1) * 5^(0*2) * 5^(1*4) * 5^(0*8)
-            let mut sig_scratch = vec![];
-            let mut p5 = vec![];
-            let mut p5_scratch = vec![];
-            while texp != 0 {
-                if p5.is_empty() {
-                    p5.push(5);
-                } else {
-                    p5_scratch.resize(p5.len() * 2, 0);
-                    let _: Loss =
-                        sig::mul(&mut p5_scratch, &mut 0, &p5, &p5, p5.len() * 2 * LIMB_BITS);
-                    while p5_scratch.last() == Some(&0) {
-                        p5_scratch.pop();
-                    }
-                    mem::swap(&mut p5, &mut p5_scratch);
-                }
-                if texp & 1 != 0 {
-                    sig_scratch.resize(sig.len() + p5.len(), 0);
-                    let _: Loss = sig::mul(
-                        &mut sig_scratch,
-                        &mut 0,
-                        &sig,
-                        &p5,
-                        (sig.len() + p5.len()) * LIMB_BITS,
-                    );
-                    while sig_scratch.last() == Some(&0) {
-                        sig_scratch.pop();
-                    }
-                    mem::swap(&mut sig, &mut sig_scratch);
-                }
-                texp >>= 1;
-            }
-        }
-
-        // Fill the buffer.
-        let mut buffer = vec![];
-
-        // Ignore digits from the significand until it is no more
-        // precise than is required for the desired precision.
-        // 196/59 is a very slight overestimate of lg_2(10).
-        let required = (precision * 196 + 58) / 59;
-        let mut discard_digits = sig::omsb(&sig).saturating_sub(required) * 59 / 196;
-        let mut in_trail = true;
-        while !sig.is_empty() {
-            // Perform short division by 10 to extract the rightmost digit.
-            // rem <- sig % 10
-            // sig <- sig / 10
-            let mut rem = 0;
-
-            // Use 64-bit division and remainder, with 32-bit chunks from sig.
-            sig::each_chunk(&mut sig, 32, |chunk| {
-                let chunk = chunk as u32;
-                let combined = ((rem as u64) << 32) | (chunk as u64);
-                rem = (combined % 10) as u8;
-                (combined / 10) as u32 as Limb
-            });
-
-            // Reduce the significand to avoid wasting time dividing 0's.
-            while sig.last() == Some(&0) {
-                sig.pop();
-            }
-
-            let digit = rem;
-
-            // Ignore digits we don't need.
-            if discard_digits > 0 {
-                discard_digits -= 1;
-                exp += 1;
-                continue;
-            }
-
-            // Drop trailing zeros.
-            if in_trail && digit == 0 {
-                exp += 1;
-            } else {
-                in_trail = false;
-                buffer.push(b'0' + digit);
-            }
-        }
-
-        assert!(!buffer.is_empty(), "no characters in buffer!");
-
-        // Drop down to precision.
-        // FIXME: don't do more precise calculations above than are required.
-        if buffer.len() > precision {
-            // The most significant figures are the last ones in the buffer.
-            let mut first_sig = buffer.len() - precision;
-
-            // Round.
-            // FIXME: this probably shouldn't use 'round half up'.
-
-            // Rounding down is just a truncation, except we also want to drop
-            // trailing zeros from the new result.
-            if buffer[first_sig - 1] < b'5' {
-                while first_sig < buffer.len() && buffer[first_sig] == b'0' {
-                    first_sig += 1;
-                }
-            } else {
-                // Rounding up requires a decimal add-with-carry. If we continue
-                // the carry, the newly-introduced zeros will just be truncated.
-                for x in &mut buffer[first_sig..] {
-                    if *x == b'9' {
-                        first_sig += 1;
-                    } else {
-                        *x += 1;
-                        break;
-                    }
-                }
-            }
-
-            exp += first_sig as ExpInt;
-            buffer.drain(..first_sig);
-
-            // If we carried through, we have exactly one digit of precision.
-            if buffer.is_empty() {
-                buffer.push(b'1');
-            }
-        }
-
-        let digits = buffer.len();
-
-        // Check whether we should use scientific notation.
-        let scientific = if width == 0 {
-            true
-        } else if exp >= 0 {
-            // 765e3 --> 765000
-            //              ^^^
-            // But we shouldn't make the number look more precise than it is.
-            exp as usize > width || digits + exp as usize > precision
-        } else {
-            // Power of the most significant digit.
-            let msd = exp + (digits - 1) as ExpInt;
-            if msd >= 0 {
-                // 765e-2 == 7.65
-                false
-            } else {
-                // 765e-5 == 0.00765
-                //           ^ ^^
-                -msd as usize > width
-            }
-        };
-
-        // Scientific formatting is pretty straightforward.
-        if scientific {
-            exp += digits as ExpInt - 1;
-
-            f.write_char(buffer[digits - 1] as char)?;
-            f.write_char('.')?;
-            let truncate_zero = !alternate;
-            if digits == 1 && truncate_zero {
-                f.write_char('0')?;
-            } else {
-                for &d in buffer[..digits - 1].iter().rev() {
-                    f.write_char(d as char)?;
-                }
-            }
-            // Fill with zeros up to precision.
-            if !truncate_zero && precision > digits - 1 {
-                for _ in 0..=precision - digits {
-                    f.write_char('0')?;
-                }
-            }
-            // For alternate we use lower 'e'.
-            f.write_char(if alternate { 'e' } else { 'E' })?;
-
-            // Exponent always at least two digits if we do not truncate zeros.
-            if truncate_zero {
-                write!(f, "{:+}", exp)?;
-            } else {
-                write!(f, "{:+03}", exp)?;
-            }
-
-            return Ok(());
-        }
-
-        // Non-scientific, positive exponents.
-        if exp >= 0 {
-            for &d in buffer.iter().rev() {
-                f.write_char(d as char)?;
-            }
-            for _ in 0..exp {
-                f.write_char('0')?;
-            }
-            return Ok(());
-        }
-
-        // Non-scientific, negative exponents.
-        let unit_place = -exp as usize;
-        if unit_place < digits {
-            for &d in buffer[unit_place..].iter().rev() {
-                f.write_char(d as char)?;
-            }
-            f.write_char('.')?;
-            for &d in buffer[..unit_place].iter().rev() {
-                f.write_char(d as char)?;
-            }
-        } else {
-            f.write_str("0.")?;
-            for _ in digits..unit_place {
-                f.write_char('0')?;
-            }
-            for &d in buffer.iter().rev() {
-                f.write_char(d as char)?;
-            }
-        }
-
-        Ok(())
-    }
-}
-
-impl<S: Semantics> fmt::Debug for IeeeFloat<S> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        write!(
-            f,
-            "{}({:?} | {}{:?} * 2^{})",
-            self,
-            self.category,
-            if self.sign { "-" } else { "+" },
-            self.sig,
-            self.exp
-        )
-    }
-}
-
-impl<S: Semantics> Float for IeeeFloat<S> {
-    const BITS: usize = S::BITS;
-    const PRECISION: usize = S::PRECISION;
-    const MAX_EXP: ExpInt = S::MAX_EXP;
-    const MIN_EXP: ExpInt = S::MIN_EXP;
-
-    const ZERO: Self = IeeeFloat {
-        sig: [0],
-        exp: S::MIN_EXP - 1,
-        category: Category::Zero,
-        sign: false,
-        marker: PhantomData,
-    };
-
-    const INFINITY: Self = IeeeFloat {
-        sig: [0],
-        exp: S::MAX_EXP + 1,
-        category: Category::Infinity,
-        sign: false,
-        marker: PhantomData,
-    };
-
-    // FIXME(eddyb) remove when qnan becomes const fn.
-    const NAN: Self = IeeeFloat {
-        sig: [S::QNAN_SIGNIFICAND],
-        exp: S::MAX_EXP + 1,
-        category: Category::NaN,
-        sign: false,
-        marker: PhantomData,
-    };
-
-    fn qnan(payload: Option<u128>) -> Self {
-        IeeeFloat {
-            sig: [S::QNAN_SIGNIFICAND
-                | payload.map_or(0, |payload| {
-                    // Zero out the excess bits of the significand.
-                    payload & ((1 << S::QNAN_BIT) - 1)
-                })],
-            exp: S::MAX_EXP + 1,
-            category: Category::NaN,
-            sign: false,
-            marker: PhantomData,
-        }
-    }
-
-    fn snan(payload: Option<u128>) -> Self {
-        let mut snan = Self::qnan(payload);
-
-        // We always have to clear the QNaN bit to make it an SNaN.
-        sig::clear_bit(&mut snan.sig, S::QNAN_BIT);
-
-        // If there are no bits set in the payload, we have to set
-        // *something* to make it a NaN instead of an infinity;
-        // conventionally, this is the next bit down from the QNaN bit.
-        if snan.sig[0] & !S::QNAN_SIGNIFICAND == 0 {
-            sig::set_bit(&mut snan.sig, S::QNAN_BIT - 1);
-        }
-
-        snan
-    }
-
-    fn largest() -> Self {
-        // We want (in interchange format):
-        //   exponent = 1..10
-        //   significand = 1..1
-        IeeeFloat {
-            sig: [(1 << S::PRECISION) - 1],
-            exp: S::MAX_EXP,
-            category: Category::Normal,
-            sign: false,
-            marker: PhantomData,
-        }
-    }
-
-    // We want (in interchange format):
-    //   exponent = 0..0
-    //   significand = 0..01
-    const SMALLEST: Self = IeeeFloat {
-        sig: [1],
-        exp: S::MIN_EXP,
-        category: Category::Normal,
-        sign: false,
-        marker: PhantomData,
-    };
-
-    fn smallest_normalized() -> Self {
-        // We want (in interchange format):
-        //   exponent = 0..0
-        //   significand = 10..0
-        IeeeFloat {
-            sig: [1 << (S::PRECISION - 1)],
-            exp: S::MIN_EXP,
-            category: Category::Normal,
-            sign: false,
-            marker: PhantomData,
-        }
-    }
-
-    fn add_r(mut self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        let status = match (self.category, rhs.category) {
-            (Category::Infinity, Category::Infinity) => {
-                // Differently signed infinities can only be validly
-                // subtracted.
-                if self.sign != rhs.sign {
-                    self = Self::NAN;
-                    Status::INVALID_OP
-                } else {
-                    Status::OK
-                }
-            }
-
-            // Sign may depend on rounding mode; handled below.
-            (_, Category::Zero) | (Category::NaN, _) | (Category::Infinity, Category::Normal) => {
-                Status::OK
-            }
-
-            (Category::Zero, _) | (_, Category::NaN | Category::Infinity) => {
-                self = rhs;
-                Status::OK
-            }
-
-            // This return code means it was not a simple case.
-            (Category::Normal, Category::Normal) => {
-                let loss = sig::add_or_sub(
-                    &mut self.sig,
-                    &mut self.exp,
-                    &mut self.sign,
-                    &mut [rhs.sig[0]],
-                    rhs.exp,
-                    rhs.sign,
-                );
-                let status;
-                self = unpack!(status=, self.normalize(round, loss));
-
-                // Can only be zero if we lost no fraction.
-                assert!(self.category != Category::Zero || loss == Loss::ExactlyZero);
-
-                status
-            }
-        };
-
-        // If two numbers add (exactly) to zero, IEEE 754 decrees it is a
-        // positive zero unless rounding to minus infinity, except that
-        // adding two like-signed zeroes gives that zero.
-        if self.category == Category::Zero
-            && (rhs.category != Category::Zero || self.sign != rhs.sign)
-        {
-            self.sign = round == Round::TowardNegative;
-        }
-
-        status.and(self)
-    }
-
-    fn mul_r(mut self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        self.sign ^= rhs.sign;
-
-        match (self.category, rhs.category) {
-            (Category::NaN, _) => {
-                self.sign = false;
-                Status::OK.and(self)
-            }
-
-            (_, Category::NaN) => {
-                self.sign = false;
-                self.category = Category::NaN;
-                self.sig = rhs.sig;
-                Status::OK.and(self)
-            }
-
-            (Category::Zero, Category::Infinity) | (Category::Infinity, Category::Zero) => {
-                Status::INVALID_OP.and(Self::NAN)
-            }
-
-            (_, Category::Infinity) | (Category::Infinity, _) => {
-                self.category = Category::Infinity;
-                Status::OK.and(self)
-            }
-
-            (Category::Zero, _) | (_, Category::Zero) => {
-                self.category = Category::Zero;
-                Status::OK.and(self)
-            }
-
-            (Category::Normal, Category::Normal) => {
-                self.exp += rhs.exp;
-                let mut wide_sig = [0; 2];
-                let loss =
-                    sig::mul(&mut wide_sig, &mut self.exp, &self.sig, &rhs.sig, S::PRECISION);
-                self.sig = [wide_sig[0]];
-                let mut status;
-                self = unpack!(status=, self.normalize(round, loss));
-                if loss != Loss::ExactlyZero {
-                    status |= Status::INEXACT;
-                }
-                status.and(self)
-            }
-        }
-    }
-
-    fn mul_add_r(mut self, multiplicand: Self, addend: Self, round: Round) -> StatusAnd<Self> {
-        // If and only if all arguments are normal do we need to do an
-        // extended-precision calculation.
-        if !self.is_finite_non_zero() || !multiplicand.is_finite_non_zero() || !addend.is_finite() {
-            let mut status;
-            self = unpack!(status=, self.mul_r(multiplicand, round));
-
-            // FS can only be Status::OK or Status::INVALID_OP. There is no more work
-            // to do in the latter case. The IEEE-754R standard says it is
-            // implementation-defined in this case whether, if ADDEND is a
-            // quiet NaN, we raise invalid op; this implementation does so.
-            //
-            // If we need to do the addition we can do so with normal
-            // precision.
-            if status == Status::OK {
-                self = unpack!(status=, self.add_r(addend, round));
-            }
-            return status.and(self);
-        }
-
-        // Post-multiplication sign, before addition.
-        self.sign ^= multiplicand.sign;
-
-        // Allocate space for twice as many bits as the original significand, plus one
-        // extra bit for the addition to overflow into.
-        assert!(limbs_for_bits(S::PRECISION * 2 + 1) <= 2);
-        let mut wide_sig = sig::widening_mul(self.sig[0], multiplicand.sig[0]);
-
-        let mut loss = Loss::ExactlyZero;
-        let mut omsb = sig::omsb(&wide_sig);
-        self.exp += multiplicand.exp;
-
-        // Assume the operands involved in the multiplication are single-precision
-        // FP, and the two multiplicants are:
-        //     lhs = a23 . a22 ... a0 * 2^e1
-        //     rhs = b23 . b22 ... b0 * 2^e2
-        // the result of multiplication is:
-        //     lhs = c48 c47 c46 . c45 ... c0 * 2^(e1+e2)
-        // Note that there are three significant bits at the left-hand side of the
-        // radix point: two for the multiplication, and an overflow bit for the
-        // addition (that will always be zero at this point). Move the radix point
-        // toward left by two bits, and adjust exponent accordingly.
-        self.exp += 2;
-
-        if addend.is_non_zero() {
-            // Normalize our MSB to one below the top bit to allow for overflow.
-            let ext_precision = 2 * S::PRECISION + 1;
-            if omsb != ext_precision - 1 {
-                assert!(ext_precision > omsb);
-                sig::shift_left(&mut wide_sig, &mut self.exp, (ext_precision - 1) - omsb);
-            }
-
-            // The intermediate result of the multiplication has "2 * S::PRECISION"
-            // significant bit; adjust the addend to be consistent with mul result.
-            let mut ext_addend_sig = [addend.sig[0], 0];
-
-            // Extend the addend significand to ext_precision - 1. This guarantees
-            // that the high bit of the significand is zero (same as wide_sig),
-            // so the addition will overflow (if it does overflow at all) into the top bit.
-            sig::shift_left(&mut ext_addend_sig, &mut 0, ext_precision - 1 - S::PRECISION);
-            loss = sig::add_or_sub(
-                &mut wide_sig,
-                &mut self.exp,
-                &mut self.sign,
-                &mut ext_addend_sig,
-                addend.exp + 1,
-                addend.sign,
-            );
-
-            omsb = sig::omsb(&wide_sig);
-        }
-
-        // Convert the result having "2 * S::PRECISION" significant-bits back to the one
-        // having "S::PRECISION" significant-bits. First, move the radix point from
-        // position "2*S::PRECISION - 1" to "S::PRECISION - 1". The exponent need to be
-        // adjusted by "2*S::PRECISION - 1" - "S::PRECISION - 1" = "S::PRECISION".
-        self.exp -= S::PRECISION as ExpInt + 1;
-
-        // In case MSB resides at the left-hand side of radix point, shift the
-        // mantissa right by some amount to make sure the MSB reside right before
-        // the radix point (i.e., "MSB . rest-significant-bits").
-        if omsb > S::PRECISION {
-            let bits = omsb - S::PRECISION;
-            loss = sig::shift_right(&mut wide_sig, &mut self.exp, bits).combine(loss);
-        }
-
-        self.sig[0] = wide_sig[0];
-
-        let mut status;
-        self = unpack!(status=, self.normalize(round, loss));
-        if loss != Loss::ExactlyZero {
-            status |= Status::INEXACT;
-        }
-
-        // If two numbers add (exactly) to zero, IEEE 754 decrees it is a
-        // positive zero unless rounding to minus infinity, except that
-        // adding two like-signed zeroes gives that zero.
-        if self.category == Category::Zero
-            && !status.intersects(Status::UNDERFLOW)
-            && self.sign != addend.sign
-        {
-            self.sign = round == Round::TowardNegative;
-        }
-
-        status.and(self)
-    }
-
-    fn div_r(mut self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        self.sign ^= rhs.sign;
-
-        match (self.category, rhs.category) {
-            (Category::NaN, _) => {
-                self.sign = false;
-                Status::OK.and(self)
-            }
-
-            (_, Category::NaN) => {
-                self.category = Category::NaN;
-                self.sig = rhs.sig;
-                self.sign = false;
-                Status::OK.and(self)
-            }
-
-            (Category::Infinity, Category::Infinity) | (Category::Zero, Category::Zero) => {
-                Status::INVALID_OP.and(Self::NAN)
-            }
-
-            (Category::Infinity | Category::Zero, _) => Status::OK.and(self),
-
-            (Category::Normal, Category::Infinity) => {
-                self.category = Category::Zero;
-                Status::OK.and(self)
-            }
-
-            (Category::Normal, Category::Zero) => {
-                self.category = Category::Infinity;
-                Status::DIV_BY_ZERO.and(self)
-            }
-
-            (Category::Normal, Category::Normal) => {
-                self.exp -= rhs.exp;
-                let dividend = self.sig[0];
-                let loss = sig::div(
-                    &mut self.sig,
-                    &mut self.exp,
-                    &mut [dividend],
-                    &mut [rhs.sig[0]],
-                    S::PRECISION,
-                );
-                let mut status;
-                self = unpack!(status=, self.normalize(round, loss));
-                if loss != Loss::ExactlyZero {
-                    status |= Status::INEXACT;
-                }
-                status.and(self)
-            }
-        }
-    }
-
-    fn c_fmod(mut self, rhs: Self) -> StatusAnd<Self> {
-        match (self.category, rhs.category) {
-            (Category::NaN, _)
-            | (Category::Zero, Category::Infinity | Category::Normal)
-            | (Category::Normal, Category::Infinity) => Status::OK.and(self),
-
-            (_, Category::NaN) => {
-                self.sign = false;
-                self.category = Category::NaN;
-                self.sig = rhs.sig;
-                Status::OK.and(self)
-            }
-
-            (Category::Infinity, _) | (_, Category::Zero) => Status::INVALID_OP.and(Self::NAN),
-
-            (Category::Normal, Category::Normal) => {
-                while self.is_finite_non_zero()
-                    && rhs.is_finite_non_zero()
-                    && self.cmp_abs_normal(rhs) != Ordering::Less
-                {
-                    let mut v = rhs.scalbn(self.ilogb() - rhs.ilogb());
-                    if self.cmp_abs_normal(v) == Ordering::Less {
-                        v = v.scalbn(-1);
-                    }
-                    v.sign = self.sign;
-
-                    let status;
-                    self = unpack!(status=, self - v);
-                    assert_eq!(status, Status::OK);
-                }
-                Status::OK.and(self)
-            }
-        }
-    }
-
-    fn round_to_integral(self, round: Round) -> StatusAnd<Self> {
-        // If the exponent is large enough, we know that this value is already
-        // integral, and the arithmetic below would potentially cause it to saturate
-        // to +/-Inf. Bail out early instead.
-        if self.is_finite_non_zero() && self.exp + 1 >= S::PRECISION as ExpInt {
-            return Status::OK.and(self);
-        }
-
-        // The algorithm here is quite simple: we add 2^(p-1), where p is the
-        // precision of our format, and then subtract it back off again. The choice
-        // of rounding modes for the addition/subtraction determines the rounding mode
-        // for our integral rounding as well.
-        // NOTE: When the input value is negative, we do subtraction followed by
-        // addition instead.
-        assert!(S::PRECISION <= 128);
-        let mut status;
-        let magic_const = unpack!(status=, Self::from_u128(1 << (S::PRECISION - 1)));
-        let magic_const = magic_const.copy_sign(self);
-
-        if status != Status::OK {
-            return status.and(self);
-        }
-
-        let mut r = self;
-        r = unpack!(status=, r.add_r(magic_const, round));
-        if status != Status::OK && status != Status::INEXACT {
-            return status.and(self);
-        }
-
-        // Restore the input sign to handle 0.0/-0.0 cases correctly.
-        r.sub_r(magic_const, round).map(|r| r.copy_sign(self))
-    }
-
-    fn next_up(mut self) -> StatusAnd<Self> {
-        // Compute nextUp(x), handling each float category separately.
-        match self.category {
-            Category::Infinity => {
-                if self.sign {
-                    // nextUp(-inf) = -largest
-                    Status::OK.and(-Self::largest())
-                } else {
-                    // nextUp(+inf) = +inf
-                    Status::OK.and(self)
-                }
-            }
-            Category::NaN => {
-                // IEEE-754R 2008 6.2 Par 2: nextUp(sNaN) = qNaN. Set Invalid flag.
-                // IEEE-754R 2008 6.2: nextUp(qNaN) = qNaN. Must be identity so we do not
-                //                     change the payload.
-                if self.is_signaling() {
-                    // For consistency, propagate the sign of the sNaN to the qNaN.
-                    Status::INVALID_OP.and(Self::NAN.copy_sign(self))
-                } else {
-                    Status::OK.and(self)
-                }
-            }
-            Category::Zero => {
-                // nextUp(pm 0) = +smallest
-                Status::OK.and(Self::SMALLEST)
-            }
-            Category::Normal => {
-                // nextUp(-smallest) = -0
-                if self.is_smallest() && self.sign {
-                    return Status::OK.and(-Self::ZERO);
-                }
-
-                // nextUp(largest) == INFINITY
-                if self.is_largest() && !self.sign {
-                    return Status::OK.and(Self::INFINITY);
-                }
-
-                // Excluding the integral bit. This allows us to test for binade boundaries.
-                let sig_mask = (1 << (S::PRECISION - 1)) - 1;
-
-                // nextUp(normal) == normal + inc.
-                if self.sign {
-                    // If we are negative, we need to decrement the significand.
-
-                    // We only cross a binade boundary that requires adjusting the exponent
-                    // if:
-                    //   1. exponent != S::MIN_EXP. This implies we are not in the
-                    //   smallest binade or are dealing with denormals.
-                    //   2. Our significand excluding the integral bit is all zeros.
-                    let crossing_binade_boundary =
-                        self.exp != S::MIN_EXP && self.sig[0] & sig_mask == 0;
-
-                    // Decrement the significand.
-                    //
-                    // We always do this since:
-                    //   1. If we are dealing with a non-binade decrement, by definition we
-                    //   just decrement the significand.
-                    //   2. If we are dealing with a normal -> normal binade decrement, since
-                    //   we have an explicit integral bit the fact that all bits but the
-                    //   integral bit are zero implies that subtracting one will yield a
-                    //   significand with 0 integral bit and 1 in all other spots. Thus we
-                    //   must just adjust the exponent and set the integral bit to 1.
-                    //   3. If we are dealing with a normal -> denormal binade decrement,
-                    //   since we set the integral bit to 0 when we represent denormals, we
-                    //   just decrement the significand.
-                    sig::decrement(&mut self.sig);
-
-                    if crossing_binade_boundary {
-                        // Our result is a normal number. Do the following:
-                        // 1. Set the integral bit to 1.
-                        // 2. Decrement the exponent.
-                        sig::set_bit(&mut self.sig, S::PRECISION - 1);
-                        self.exp -= 1;
-                    }
-                } else {
-                    // If we are positive, we need to increment the significand.
-
-                    // We only cross a binade boundary that requires adjusting the exponent if
-                    // the input is not a denormal and all of said input's significand bits
-                    // are set. If all of said conditions are true: clear the significand, set
-                    // the integral bit to 1, and increment the exponent. If we have a
-                    // denormal always increment since moving denormals and the numbers in the
-                    // smallest normal binade have the same exponent in our representation.
-                    let crossing_binade_boundary =
-                        !self.is_denormal() && self.sig[0] & sig_mask == sig_mask;
-
-                    if crossing_binade_boundary {
-                        self.sig = [0];
-                        sig::set_bit(&mut self.sig, S::PRECISION - 1);
-                        assert_ne!(
-                            self.exp,
-                            S::MAX_EXP,
-                            "We can not increment an exponent beyond the MAX_EXP \
-                             allowed by the given floating point semantics."
-                        );
-                        self.exp += 1;
-                    } else {
-                        sig::increment(&mut self.sig);
-                    }
-                }
-                Status::OK.and(self)
-            }
-        }
-    }
-
-    fn from_bits(input: u128) -> Self {
-        // Dispatch to semantics.
-        S::from_bits(input)
-    }
-
-    fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self> {
-        IeeeFloat {
-            sig: [input],
-            exp: S::PRECISION as ExpInt - 1,
-            category: Category::Normal,
-            sign: false,
-            marker: PhantomData,
-        }
-        .normalize(round, Loss::ExactlyZero)
-    }
-
-    fn from_str_r(mut s: &str, mut round: Round) -> Result<StatusAnd<Self>, ParseError> {
-        if s.is_empty() {
-            return Err(ParseError("Invalid string length"));
-        }
-
-        // Handle special cases.
-        match s {
-            "inf" | "INFINITY" => return Ok(Status::OK.and(Self::INFINITY)),
-            "-inf" | "-INFINITY" => return Ok(Status::OK.and(-Self::INFINITY)),
-            "nan" | "NaN" => return Ok(Status::OK.and(Self::NAN)),
-            "-nan" | "-NaN" => return Ok(Status::OK.and(-Self::NAN)),
-            _ => {}
-        }
-
-        // Handle a leading minus sign.
-        let minus = s.starts_with('-');
-        if minus || s.starts_with('+') {
-            s = &s[1..];
-            if s.is_empty() {
-                return Err(ParseError("String has no digits"));
-            }
-        }
-
-        // Adjust the rounding mode for the absolute value below.
-        if minus {
-            round = -round;
-        }
-
-        let r = if s.starts_with("0x") || s.starts_with("0X") {
-            s = &s[2..];
-            if s.is_empty() {
-                return Err(ParseError("Invalid string"));
-            }
-            Self::from_hexadecimal_string(s, round)?
-        } else {
-            Self::from_decimal_string(s, round)?
-        };
-
-        Ok(r.map(|r| if minus { -r } else { r }))
-    }
-
-    fn to_bits(self) -> u128 {
-        // Dispatch to semantics.
-        S::to_bits(self)
-    }
-
-    fn to_u128_r(self, width: usize, round: Round, is_exact: &mut bool) -> StatusAnd<u128> {
-        // The result of trying to convert a number too large.
-        let overflow = if self.sign {
-            // Negative numbers cannot be represented as unsigned.
-            0
-        } else {
-            // Largest unsigned integer of the given width.
-            !0 >> (128 - width)
-        };
-
-        *is_exact = false;
-
-        match self.category {
-            Category::NaN => Status::INVALID_OP.and(0),
-
-            Category::Infinity => Status::INVALID_OP.and(overflow),
-
-            Category::Zero => {
-                // Negative zero can't be represented as an int.
-                *is_exact = !self.sign;
-                Status::OK.and(0)
-            }
-
-            Category::Normal => {
-                let mut r = 0;
-
-                // Step 1: place our absolute value, with any fraction truncated, in
-                // the destination.
-                let truncated_bits = if self.exp < 0 {
-                    // Our absolute value is less than one; truncate everything.
-                    // For exponent -1 the integer bit represents .5, look at that.
-                    // For smaller exponents leftmost truncated bit is 0.
-                    S::PRECISION - 1 + (-self.exp) as usize
-                } else {
-                    // We want the most significant (exponent + 1) bits; the rest are
-                    // truncated.
-                    let bits = self.exp as usize + 1;
-
-                    // Hopelessly large in magnitude?
-                    if bits > width {
-                        return Status::INVALID_OP.and(overflow);
-                    }
-
-                    if bits < S::PRECISION {
-                        // We truncate (S::PRECISION - bits) bits.
-                        r = self.sig[0] >> (S::PRECISION - bits);
-                        S::PRECISION - bits
-                    } else {
-                        // We want at least as many bits as are available.
-                        r = self.sig[0] << (bits - S::PRECISION);
-                        0
-                    }
-                };
-
-                // Step 2: work out any lost fraction, and increment the absolute
-                // value if we would round away from zero.
-                let mut loss = Loss::ExactlyZero;
-                if truncated_bits > 0 {
-                    loss = Loss::through_truncation(&self.sig, truncated_bits);
-                    if loss != Loss::ExactlyZero
-                        && self.round_away_from_zero(round, loss, truncated_bits)
-                    {
-                        r = r.wrapping_add(1);
-                        if r == 0 {
-                            return Status::INVALID_OP.and(overflow); // Overflow.
-                        }
-                    }
-                }
-
-                // Step 3: check if we fit in the destination.
-                if r > overflow {
-                    return Status::INVALID_OP.and(overflow);
-                }
-
-                if loss == Loss::ExactlyZero {
-                    *is_exact = true;
-                    Status::OK.and(r)
-                } else {
-                    Status::INEXACT.and(r)
-                }
-            }
-        }
-    }
-
-    fn cmp_abs_normal(self, rhs: Self) -> Ordering {
-        assert!(self.is_finite_non_zero());
-        assert!(rhs.is_finite_non_zero());
-
-        // If exponents are equal, do an unsigned comparison of the significands.
-        self.exp.cmp(&rhs.exp).then_with(|| sig::cmp(&self.sig, &rhs.sig))
-    }
-
-    fn bitwise_eq(self, rhs: Self) -> bool {
-        if self.category != rhs.category || self.sign != rhs.sign {
-            return false;
-        }
-
-        if self.category == Category::Zero || self.category == Category::Infinity {
-            return true;
-        }
-
-        if self.is_finite_non_zero() && self.exp != rhs.exp {
-            return false;
-        }
-
-        self.sig == rhs.sig
-    }
-
-    fn is_negative(self) -> bool {
-        self.sign
-    }
-
-    fn is_denormal(self) -> bool {
-        self.is_finite_non_zero()
-            && self.exp == S::MIN_EXP
-            && !sig::get_bit(&self.sig, S::PRECISION - 1)
-    }
-
-    fn is_signaling(self) -> bool {
-        // IEEE-754R 2008 6.2.1: A signaling NaN bit string should be encoded with the
-        // first bit of the trailing significand being 0.
-        self.is_nan() && !sig::get_bit(&self.sig, S::QNAN_BIT)
-    }
-
-    fn category(self) -> Category {
-        self.category
-    }
-
-    fn get_exact_inverse(self) -> Option<Self> {
-        // Special floats and denormals have no exact inverse.
-        if !self.is_finite_non_zero() {
-            return None;
-        }
-
-        // Check that the number is a power of two by making sure that only the
-        // integer bit is set in the significand.
-        if self.sig != [1 << (S::PRECISION - 1)] {
-            return None;
-        }
-
-        // Get the inverse.
-        let mut reciprocal = Self::from_u128(1).value;
-        let status;
-        reciprocal = unpack!(status=, reciprocal / self);
-        if status != Status::OK {
-            return None;
-        }
-
-        // Avoid multiplication with a denormal, it is not safe on all platforms and
-        // may be slower than a normal division.
-        if reciprocal.is_denormal() {
-            return None;
-        }
-
-        assert!(reciprocal.is_finite_non_zero());
-        assert_eq!(reciprocal.sig, [1 << (S::PRECISION - 1)]);
-
-        Some(reciprocal)
-    }
-
-    fn ilogb(mut self) -> ExpInt {
-        if self.is_nan() {
-            return IEK_NAN;
-        }
-        if self.is_zero() {
-            return IEK_ZERO;
-        }
-        if self.is_infinite() {
-            return IEK_INF;
-        }
-        if !self.is_denormal() {
-            return self.exp;
-        }
-
-        let sig_bits = (S::PRECISION - 1) as ExpInt;
-        self.exp += sig_bits;
-        self = self.normalize(Round::NearestTiesToEven, Loss::ExactlyZero).value;
-        self.exp - sig_bits
-    }
-
-    fn scalbn_r(mut self, exp: ExpInt, round: Round) -> Self {
-        // If exp is wildly out-of-scale, simply adding it to self.exp will
-        // overflow; clamp it to a safe range before adding, but ensure that the range
-        // is large enough that the clamp does not change the result. The range we
-        // need to support is the difference between the largest possible exponent and
-        // the normalized exponent of half the smallest denormal.
-
-        let sig_bits = (S::PRECISION - 1) as i32;
-        let max_change = S::MAX_EXP as i32 - (S::MIN_EXP as i32 - sig_bits) + 1;
-
-        // Clamp to one past the range ends to let normalize handle overflow.
-        let exp_change = cmp::min(cmp::max(exp as i32, -max_change - 1), max_change);
-        self.exp = self.exp.saturating_add(exp_change as ExpInt);
-        self = self.normalize(round, Loss::ExactlyZero).value;
-        if self.is_nan() {
-            sig::set_bit(&mut self.sig, S::QNAN_BIT);
-        }
-        self
-    }
-
-    fn frexp_r(mut self, exp: &mut ExpInt, round: Round) -> Self {
-        *exp = self.ilogb();
-
-        // Quiet signalling nans.
-        if *exp == IEK_NAN {
-            sig::set_bit(&mut self.sig, S::QNAN_BIT);
-            return self;
-        }
-
-        if *exp == IEK_INF {
-            return self;
-        }
-
-        // 1 is added because frexp is defined to return a normalized fraction in
-        // +/-[0.5, 1.0), rather than the usual +/-[1.0, 2.0).
-        if *exp == IEK_ZERO {
-            *exp = 0;
-        } else {
-            *exp += 1;
-        }
-        self.scalbn_r(-*exp, round)
-    }
-}
-
-impl<S: Semantics, T: Semantics> FloatConvert<IeeeFloat<T>> for IeeeFloat<S> {
-    fn convert_r(self, round: Round, loses_info: &mut bool) -> StatusAnd<IeeeFloat<T>> {
-        let mut r = IeeeFloat {
-            sig: self.sig,
-            exp: self.exp,
-            category: self.category,
-            sign: self.sign,
-            marker: PhantomData,
-        };
-
-        // x86 has some unusual NaNs which cannot be represented in any other
-        // format; note them here.
-        fn is_x87_double_extended<S: Semantics>() -> bool {
-            S::QNAN_SIGNIFICAND == X87DoubleExtendedS::QNAN_SIGNIFICAND
-        }
-        let x87_special_nan = is_x87_double_extended::<S>()
-            && !is_x87_double_extended::<T>()
-            && r.category == Category::NaN
-            && (r.sig[0] & S::QNAN_SIGNIFICAND) != S::QNAN_SIGNIFICAND;
-
-        // If this is a truncation of a denormal number, and the target semantics
-        // has larger exponent range than the source semantics (this can happen
-        // when truncating from PowerPC double-double to double format), the
-        // right shift could lose result mantissa bits. Adjust exponent instead
-        // of performing excessive shift.
-        let mut shift = T::PRECISION as ExpInt - S::PRECISION as ExpInt;
-        if shift < 0 && r.is_finite_non_zero() {
-            let mut exp_change = sig::omsb(&r.sig) as ExpInt - S::PRECISION as ExpInt;
-            if r.exp + exp_change < T::MIN_EXP {
-                exp_change = T::MIN_EXP - r.exp;
-            }
-            if exp_change < shift {
-                exp_change = shift;
-            }
-            if exp_change < 0 {
-                shift -= exp_change;
-                r.exp += exp_change;
-            }
-        }
-
-        // If this is a truncation, perform the shift.
-        let loss = if shift < 0 && (r.is_finite_non_zero() || r.category == Category::NaN) {
-            sig::shift_right(&mut r.sig, &mut 0, -shift as usize)
-        } else {
-            Loss::ExactlyZero
-        };
-
-        // If this is an extension, perform the shift.
-        if shift > 0 && (r.is_finite_non_zero() || r.category == Category::NaN) {
-            sig::shift_left(&mut r.sig, &mut 0, shift as usize);
-        }
-
-        let status;
-        if r.is_finite_non_zero() {
-            r = unpack!(status=, r.normalize(round, loss));
-            *loses_info = status != Status::OK;
-        } else if r.category == Category::NaN {
-            *loses_info = loss != Loss::ExactlyZero || x87_special_nan;
-
-            // For x87 extended precision, we want to make a NaN, not a special NaN if
-            // the input wasn't special either.
-            if !x87_special_nan && is_x87_double_extended::<T>() {
-                sig::set_bit(&mut r.sig, T::PRECISION - 1);
-            }
-
-            // Convert of sNaN creates qNaN and raises an exception (invalid op).
-            // This also guarantees that a sNaN does not become Inf on a truncation
-            // that loses all payload bits.
-            if self.is_signaling() {
-                // Quiet signaling NaN.
-                sig::set_bit(&mut r.sig, T::QNAN_BIT);
-                status = Status::INVALID_OP;
-            } else {
-                status = Status::OK;
-            }
-        } else {
-            *loses_info = false;
-            status = Status::OK;
-        }
-
-        status.and(r)
-    }
-}
-
-impl<S: Semantics> IeeeFloat<S> {
-    /// Handle positive overflow. We either return infinity or
-    /// the largest finite number. For negative overflow,
-    /// negate the `round` argument before calling.
-    fn overflow_result(round: Round) -> StatusAnd<Self> {
-        match round {
-            // Infinity?
-            Round::NearestTiesToEven | Round::NearestTiesToAway | Round::TowardPositive => {
-                (Status::OVERFLOW | Status::INEXACT).and(Self::INFINITY)
-            }
-            // Otherwise we become the largest finite number.
-            Round::TowardNegative | Round::TowardZero => Status::INEXACT.and(Self::largest()),
-        }
-    }
-
-    /// Returns `true` if, when truncating the current number, with `bit` the
-    /// new LSB, with the given lost fraction and rounding mode, the result
-    /// would need to be rounded away from zero (i.e., by increasing the
-    /// signficand). This routine must work for `Category::Zero` of both signs, and
-    /// `Category::Normal` numbers.
-    fn round_away_from_zero(&self, round: Round, loss: Loss, bit: usize) -> bool {
-        // NaNs and infinities should not have lost fractions.
-        assert!(self.is_finite_non_zero() || self.is_zero());
-
-        // Current callers never pass this so we don't handle it.
-        assert_ne!(loss, Loss::ExactlyZero);
-
-        match round {
-            Round::NearestTiesToAway => loss == Loss::ExactlyHalf || loss == Loss::MoreThanHalf,
-            Round::NearestTiesToEven => {
-                if loss == Loss::MoreThanHalf {
-                    return true;
-                }
-
-                // Our zeros don't have a significand to test.
-                if loss == Loss::ExactlyHalf && self.category != Category::Zero {
-                    return sig::get_bit(&self.sig, bit);
-                }
-
-                false
-            }
-            Round::TowardZero => false,
-            Round::TowardPositive => !self.sign,
-            Round::TowardNegative => self.sign,
-        }
-    }
-
-    fn normalize(mut self, round: Round, mut loss: Loss) -> StatusAnd<Self> {
-        if !self.is_finite_non_zero() {
-            return Status::OK.and(self);
-        }
-
-        // Before rounding normalize the exponent of Category::Normal numbers.
-        let mut omsb = sig::omsb(&self.sig);
-
-        if omsb > 0 {
-            // OMSB is numbered from 1. We want to place it in the integer
-            // bit numbered PRECISION if possible, with a compensating change in
-            // the exponent.
-            let mut final_exp = self.exp.saturating_add(omsb as ExpInt - S::PRECISION as ExpInt);
-
-            // If the resulting exponent is too high, overflow according to
-            // the rounding mode.
-            if final_exp > S::MAX_EXP {
-                let round = if self.sign { -round } else { round };
-                return Self::overflow_result(round).map(|r| r.copy_sign(self));
-            }
-
-            // Subnormal numbers have exponent MIN_EXP, and their MSB
-            // is forced based on that.
-            if final_exp < S::MIN_EXP {
-                final_exp = S::MIN_EXP;
-            }
-
-            // Shifting left is easy as we don't lose precision.
-            if final_exp < self.exp {
-                assert_eq!(loss, Loss::ExactlyZero);
-
-                let exp_change = (self.exp - final_exp) as usize;
-                sig::shift_left(&mut self.sig, &mut self.exp, exp_change);
-
-                return Status::OK.and(self);
-            }
-
-            // Shift right and capture any new lost fraction.
-            if final_exp > self.exp {
-                let exp_change = (final_exp - self.exp) as usize;
-                loss = sig::shift_right(&mut self.sig, &mut self.exp, exp_change).combine(loss);
-
-                // Keep OMSB up-to-date.
-                omsb = omsb.saturating_sub(exp_change);
-            }
-        }
-
-        // Now round the number according to round given the lost
-        // fraction.
-
-        // As specified in IEEE 754, since we do not trap we do not report
-        // underflow for exact results.
-        if loss == Loss::ExactlyZero {
-            // Canonicalize zeros.
-            if omsb == 0 {
-                self.category = Category::Zero;
-            }
-
-            return Status::OK.and(self);
-        }
-
-        // Increment the significand if we're rounding away from zero.
-        if self.round_away_from_zero(round, loss, 0) {
-            if omsb == 0 {
-                self.exp = S::MIN_EXP;
-            }
-
-            // We should never overflow.
-            assert_eq!(sig::increment(&mut self.sig), 0);
-            omsb = sig::omsb(&self.sig);
-
-            // Did the significand increment overflow?
-            if omsb == S::PRECISION + 1 {
-                // Renormalize by incrementing the exponent and shifting our
-                // significand right one. However if we already have the
-                // maximum exponent we overflow to infinity.
-                if self.exp == S::MAX_EXP {
-                    self.category = Category::Infinity;
-
-                    return (Status::OVERFLOW | Status::INEXACT).and(self);
-                }
-
-                let _: Loss = sig::shift_right(&mut self.sig, &mut self.exp, 1);
-
-                return Status::INEXACT.and(self);
-            }
-        }
-
-        // The normal case - we were and are not denormal, and any
-        // significand increment above didn't overflow.
-        if omsb == S::PRECISION {
-            return Status::INEXACT.and(self);
-        }
-
-        // We have a non-zero denormal.
-        assert!(omsb < S::PRECISION);
-
-        // Canonicalize zeros.
-        if omsb == 0 {
-            self.category = Category::Zero;
-        }
-
-        // The Category::Zero case is a denormal that underflowed to zero.
-        (Status::UNDERFLOW | Status::INEXACT).and(self)
-    }
-
-    fn from_hexadecimal_string(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError> {
-        let mut r = IeeeFloat {
-            sig: [0],
-            exp: 0,
-            category: Category::Normal,
-            sign: false,
-            marker: PhantomData,
-        };
-
-        let mut any_digits = false;
-        let mut has_exp = false;
-        let mut bit_pos = LIMB_BITS as isize;
-        let mut loss = None;
-
-        // Without leading or trailing zeros, irrespective of the dot.
-        let mut first_sig_digit = None;
-        let mut dot = s.len();
-
-        for (p, c) in s.char_indices() {
-            // Skip leading zeros and any (hexa)decimal point.
-            if c == '.' {
-                if dot != s.len() {
-                    return Err(ParseError("String contains multiple dots"));
-                }
-                dot = p;
-            } else if let Some(hex_value) = c.to_digit(16) {
-                any_digits = true;
-
-                if first_sig_digit.is_none() {
-                    if hex_value == 0 {
-                        continue;
-                    }
-                    first_sig_digit = Some(p);
-                }
-
-                // Store the number while we have space.
-                bit_pos -= 4;
-                if bit_pos >= 0 {
-                    r.sig[0] |= (hex_value as Limb) << bit_pos;
-                // If zero or one-half (the hexadecimal digit 8) are followed
-                // by non-zero, they're a little more than zero or one-half.
-                } else if let Some(ref mut loss) = loss {
-                    if hex_value != 0 {
-                        if *loss == Loss::ExactlyZero {
-                            *loss = Loss::LessThanHalf;
-                        }
-                        if *loss == Loss::ExactlyHalf {
-                            *loss = Loss::MoreThanHalf;
-                        }
-                    }
-                } else {
-                    loss = Some(match hex_value {
-                        0 => Loss::ExactlyZero,
-                        1..=7 => Loss::LessThanHalf,
-                        8 => Loss::ExactlyHalf,
-                        9..=15 => Loss::MoreThanHalf,
-                        _ => unreachable!(),
-                    });
-                }
-            } else if c == 'p' || c == 'P' {
-                if !any_digits {
-                    return Err(ParseError("Significand has no digits"));
-                }
-
-                if dot == s.len() {
-                    dot = p;
-                }
-
-                let mut chars = s[p + 1..].chars().peekable();
-
-                // Adjust for the given exponent.
-                let exp_minus = chars.peek() == Some(&'-');
-                if exp_minus || chars.peek() == Some(&'+') {
-                    chars.next();
-                }
-
-                for c in chars {
-                    if let Some(value) = c.to_digit(10) {
-                        has_exp = true;
-                        r.exp = r.exp.saturating_mul(10).saturating_add(value as ExpInt);
-                    } else {
-                        return Err(ParseError("Invalid character in exponent"));
-                    }
-                }
-                if !has_exp {
-                    return Err(ParseError("Exponent has no digits"));
-                }
-
-                if exp_minus {
-                    r.exp = -r.exp;
-                }
-
-                break;
-            } else {
-                return Err(ParseError("Invalid character in significand"));
-            }
-        }
-        if !any_digits {
-            return Err(ParseError("Significand has no digits"));
-        }
-
-        // Hex floats require an exponent but not a hexadecimal point.
-        if !has_exp {
-            return Err(ParseError("Hex strings require an exponent"));
-        }
-
-        // Ignore the exponent if we are zero.
-        let first_sig_digit = match first_sig_digit {
-            Some(p) => p,
-            None => return Ok(Status::OK.and(Self::ZERO)),
-        };
-
-        // Calculate the exponent adjustment implicit in the number of
-        // significant digits and adjust for writing the significand starting
-        // at the most significant nibble.
-        let exp_adjustment = if dot > first_sig_digit {
-            ExpInt::try_from(dot - first_sig_digit).unwrap()
-        } else {
-            -ExpInt::try_from(first_sig_digit - dot - 1).unwrap()
-        };
-        let exp_adjustment = exp_adjustment
-            .saturating_mul(4)
-            .saturating_sub(1)
-            .saturating_add(S::PRECISION as ExpInt)
-            .saturating_sub(LIMB_BITS as ExpInt);
-        r.exp = r.exp.saturating_add(exp_adjustment);
-
-        Ok(r.normalize(round, loss.unwrap_or(Loss::ExactlyZero)))
-    }
-
-    fn from_decimal_string(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError> {
-        // Given a normal decimal floating point number of the form
-        //
-        //   dddd.dddd[eE][+-]ddd
-        //
-        // where the decimal point and exponent are optional, fill out the
-        // variables below. Exponent is appropriate if the significand is
-        // treated as an integer, and normalized_exp if the significand
-        // is taken to have the decimal point after a single leading
-        // non-zero digit.
-        //
-        // If the value is zero, first_sig_digit is None.
-
-        let mut any_digits = false;
-        let mut dec_exp = 0i32;
-
-        // Without leading or trailing zeros, irrespective of the dot.
-        let mut first_sig_digit = None;
-        let mut last_sig_digit = 0;
-        let mut dot = s.len();
-
-        for (p, c) in s.char_indices() {
-            if c == '.' {
-                if dot != s.len() {
-                    return Err(ParseError("String contains multiple dots"));
-                }
-                dot = p;
-            } else if let Some(dec_value) = c.to_digit(10) {
-                any_digits = true;
-
-                if dec_value != 0 {
-                    if first_sig_digit.is_none() {
-                        first_sig_digit = Some(p);
-                    }
-                    last_sig_digit = p;
-                }
-            } else if c == 'e' || c == 'E' {
-                if !any_digits {
-                    return Err(ParseError("Significand has no digits"));
-                }
-
-                if dot == s.len() {
-                    dot = p;
-                }
-
-                let mut chars = s[p + 1..].chars().peekable();
-
-                // Adjust for the given exponent.
-                let exp_minus = chars.peek() == Some(&'-');
-                if exp_minus || chars.peek() == Some(&'+') {
-                    chars.next();
-                }
-
-                any_digits = false;
-                for c in chars {
-                    if let Some(value) = c.to_digit(10) {
-                        any_digits = true;
-                        dec_exp = dec_exp.saturating_mul(10).saturating_add(value as i32);
-                    } else {
-                        return Err(ParseError("Invalid character in exponent"));
-                    }
-                }
-                if !any_digits {
-                    return Err(ParseError("Exponent has no digits"));
-                }
-
-                if exp_minus {
-                    dec_exp = -dec_exp;
-                }
-
-                break;
-            } else {
-                return Err(ParseError("Invalid character in significand"));
-            }
-        }
-        if !any_digits {
-            return Err(ParseError("Significand has no digits"));
-        }
-
-        // Test if we have a zero number allowing for non-zero exponents.
-        let first_sig_digit = match first_sig_digit {
-            Some(p) => p,
-            None => return Ok(Status::OK.and(Self::ZERO)),
-        };
-
-        // Adjust the exponents for any decimal point.
-        if dot > last_sig_digit {
-            dec_exp = dec_exp.saturating_add((dot - last_sig_digit - 1) as i32);
-        } else {
-            dec_exp = dec_exp.saturating_sub((last_sig_digit - dot) as i32);
-        }
-        let significand_digits = last_sig_digit - first_sig_digit + 1
-            - (dot > first_sig_digit && dot < last_sig_digit) as usize;
-        let normalized_exp = dec_exp.saturating_add(significand_digits as i32 - 1);
-
-        // Handle the cases where exponents are obviously too large or too
-        // small. Writing L for log 10 / log 2, a number d.ddddd*10^dec_exp
-        // definitely overflows if
-        //
-        //       (dec_exp - 1) * L >= MAX_EXP
-        //
-        // and definitely underflows to zero where
-        //
-        //       (dec_exp + 1) * L <= MIN_EXP - PRECISION
-        //
-        // With integer arithmetic the tightest bounds for L are
-        //
-        //       93/28 < L < 196/59            [ numerator <= 256 ]
-        //       42039/12655 < L < 28738/8651  [ numerator <= 65536 ]
-
-        // Check for MAX_EXP.
-        if normalized_exp.saturating_sub(1).saturating_mul(42039) >= 12655 * S::MAX_EXP as i32 {
-            // Overflow and round.
-            return Ok(Self::overflow_result(round));
-        }
-
-        // Check for MIN_EXP.
-        if normalized_exp.saturating_add(1).saturating_mul(28738)
-            <= 8651 * (S::MIN_EXP as i32 - S::PRECISION as i32)
-        {
-            // Underflow to zero and round.
-            let r =
-                if round == Round::TowardPositive { IeeeFloat::SMALLEST } else { IeeeFloat::ZERO };
-            return Ok((Status::UNDERFLOW | Status::INEXACT).and(r));
-        }
-
-        // A tight upper bound on number of bits required to hold an
-        // N-digit decimal integer is N * 196 / 59. Allocate enough space
-        // to hold the full significand, and an extra limb required by
-        // tcMultiplyPart.
-        let max_limbs = limbs_for_bits(1 + 196 * significand_digits / 59);
-        let mut dec_sig: SmallVec<[Limb; 1]> = SmallVec::with_capacity(max_limbs);
-
-        // Convert to binary efficiently - we do almost all multiplication
-        // in a Limb. When this would overflow do we do a single
-        // bignum multiplication, and then revert again to multiplication
-        // in a Limb.
-        let mut chars = s[first_sig_digit..=last_sig_digit].chars();
-        loop {
-            let mut val = 0;
-            let mut multiplier = 1;
-
-            loop {
-                let dec_value = match chars.next() {
-                    Some('.') => continue,
-                    Some(c) => c.to_digit(10).unwrap(),
-                    None => break,
-                };
-
-                multiplier *= 10;
-                val = val * 10 + dec_value as Limb;
-
-                // The maximum number that can be multiplied by ten with any
-                // digit added without overflowing a Limb.
-                if multiplier > (!0 - 9) / 10 {
-                    break;
-                }
-            }
-
-            // If we've consumed no digits, we're done.
-            if multiplier == 1 {
-                break;
-            }
-
-            // Multiply out the current limb.
-            let mut carry = val;
-            for x in &mut dec_sig {
-                let [low, mut high] = sig::widening_mul(*x, multiplier);
-
-                // Now add carry.
-                let (low, overflow) = low.overflowing_add(carry);
-                high += overflow as Limb;
-
-                *x = low;
-                carry = high;
-            }
-
-            // If we had carry, we need another limb (likely but not guaranteed).
-            if carry > 0 {
-                dec_sig.push(carry);
-            }
-        }
-
-        // Calculate pow(5, abs(dec_exp)) into `pow5_full`.
-        // The *_calc Vec's are reused scratch space, as an optimization.
-        let (pow5_full, mut pow5_calc, mut sig_calc, mut sig_scratch_calc) = {
-            let mut power = dec_exp.abs() as usize;
-
-            const FIRST_EIGHT_POWERS: [Limb; 8] = [1, 5, 25, 125, 625, 3125, 15625, 78125];
-
-            let mut p5_scratch = smallvec![];
-            let mut p5: SmallVec<[Limb; 1]> = smallvec![FIRST_EIGHT_POWERS[4]];
-
-            let mut r_scratch = smallvec![];
-            let mut r: SmallVec<[Limb; 1]> = smallvec![FIRST_EIGHT_POWERS[power & 7]];
-            power >>= 3;
-
-            while power > 0 {
-                // Calculate pow(5,pow(2,n+3)).
-                p5_scratch.resize(p5.len() * 2, 0);
-                let _: Loss = sig::mul(&mut p5_scratch, &mut 0, &p5, &p5, p5.len() * 2 * LIMB_BITS);
-                while p5_scratch.last() == Some(&0) {
-                    p5_scratch.pop();
-                }
-                mem::swap(&mut p5, &mut p5_scratch);
-
-                if power & 1 != 0 {
-                    r_scratch.resize(r.len() + p5.len(), 0);
-                    let _: Loss =
-                        sig::mul(&mut r_scratch, &mut 0, &r, &p5, (r.len() + p5.len()) * LIMB_BITS);
-                    while r_scratch.last() == Some(&0) {
-                        r_scratch.pop();
-                    }
-                    mem::swap(&mut r, &mut r_scratch);
-                }
-
-                power >>= 1;
-            }
-
-            (r, r_scratch, p5, p5_scratch)
-        };
-
-        // Attempt dec_sig * 10^dec_exp with increasing precision.
-        let mut attempt = 0;
-        loop {
-            let calc_precision = (LIMB_BITS << attempt) - 1;
-            attempt += 1;
-
-            let calc_normal_from_limbs = |sig: &mut SmallVec<[Limb; 1]>,
-                                          limbs: &[Limb]|
-             -> StatusAnd<ExpInt> {
-                sig.resize(limbs_for_bits(calc_precision), 0);
-                let (mut loss, mut exp) = sig::from_limbs(sig, limbs, calc_precision);
-
-                // Before rounding normalize the exponent of Category::Normal numbers.
-                let mut omsb = sig::omsb(sig);
-
-                assert_ne!(omsb, 0);
-
-                // OMSB is numbered from 1. We want to place it in the integer
-                // bit numbered PRECISION if possible, with a compensating change in
-                // the exponent.
-                let final_exp = exp.saturating_add(omsb as ExpInt - calc_precision as ExpInt);
-
-                // Shifting left is easy as we don't lose precision.
-                if final_exp < exp {
-                    assert_eq!(loss, Loss::ExactlyZero);
-
-                    let exp_change = (exp - final_exp) as usize;
-                    sig::shift_left(sig, &mut exp, exp_change);
-
-                    return Status::OK.and(exp);
-                }
-
-                // Shift right and capture any new lost fraction.
-                if final_exp > exp {
-                    let exp_change = (final_exp - exp) as usize;
-                    loss = sig::shift_right(sig, &mut exp, exp_change).combine(loss);
-
-                    // Keep OMSB up-to-date.
-                    omsb = omsb.saturating_sub(exp_change);
-                }
-
-                assert_eq!(omsb, calc_precision);
-
-                // Now round the number according to round given the lost
-                // fraction.
-
-                // As specified in IEEE 754, since we do not trap we do not report
-                // underflow for exact results.
-                if loss == Loss::ExactlyZero {
-                    return Status::OK.and(exp);
-                }
-
-                // Increment the significand if we're rounding away from zero.
-                if loss == Loss::MoreThanHalf || loss == Loss::ExactlyHalf && sig::get_bit(sig, 0) {
-                    // We should never overflow.
-                    assert_eq!(sig::increment(sig), 0);
-                    omsb = sig::omsb(sig);
-
-                    // Did the significand increment overflow?
-                    if omsb == calc_precision + 1 {
-                        let _: Loss = sig::shift_right(sig, &mut exp, 1);
-
-                        return Status::INEXACT.and(exp);
-                    }
-                }
-
-                // The normal case - we were and are not denormal, and any
-                // significand increment above didn't overflow.
-                Status::INEXACT.and(exp)
-            };
-
-            let status;
-            let mut exp = unpack!(status=,
-                calc_normal_from_limbs(&mut sig_calc, &dec_sig));
-            let pow5_status;
-            let pow5_exp = unpack!(pow5_status=,
-                calc_normal_from_limbs(&mut pow5_calc, &pow5_full));
-
-            // Add dec_exp, as 10^n = 5^n * 2^n.
-            exp += dec_exp as ExpInt;
-
-            let mut used_bits = S::PRECISION;
-            let mut truncated_bits = calc_precision - used_bits;
-
-            let half_ulp_err1 = (status != Status::OK) as Limb;
-            let (calc_loss, half_ulp_err2);
-            if dec_exp >= 0 {
-                exp += pow5_exp;
-
-                sig_scratch_calc.resize(sig_calc.len() + pow5_calc.len(), 0);
-                calc_loss = sig::mul(
-                    &mut sig_scratch_calc,
-                    &mut exp,
-                    &sig_calc,
-                    &pow5_calc,
-                    calc_precision,
-                );
-                mem::swap(&mut sig_calc, &mut sig_scratch_calc);
-
-                half_ulp_err2 = (pow5_status != Status::OK) as Limb;
-            } else {
-                exp -= pow5_exp;
-
-                sig_scratch_calc.resize(sig_calc.len(), 0);
-                calc_loss = sig::div(
-                    &mut sig_scratch_calc,
-                    &mut exp,
-                    &mut sig_calc,
-                    &mut pow5_calc,
-                    calc_precision,
-                );
-                mem::swap(&mut sig_calc, &mut sig_scratch_calc);
-
-                // Denormal numbers have less precision.
-                if exp < S::MIN_EXP {
-                    truncated_bits += (S::MIN_EXP - exp) as usize;
-                    used_bits = calc_precision.saturating_sub(truncated_bits);
-                }
-                // Extra half-ulp lost in reciprocal of exponent.
-                half_ulp_err2 =
-                    2 * (pow5_status != Status::OK || calc_loss != Loss::ExactlyZero) as Limb;
-            }
-
-            // Both sig::mul and sig::div return the
-            // result with the integer bit set.
-            assert!(sig::get_bit(&sig_calc, calc_precision - 1));
-
-            // The error from the true value, in half-ulps, on multiplying two
-            // floating point numbers, which differ from the value they
-            // approximate by at most half_ulp_err1 and half_ulp_err2 half-ulps, is strictly less
-            // than the returned value.
-            //
-            // See "How to Read Floating Point Numbers Accurately" by William D Clinger.
-            assert!(half_ulp_err1 < 2 || half_ulp_err2 < 2 || (half_ulp_err1 + half_ulp_err2 < 8));
-
-            let inexact = (calc_loss != Loss::ExactlyZero) as Limb;
-            let half_ulp_err = if half_ulp_err1 + half_ulp_err2 == 0 {
-                inexact * 2 // <= inexact half-ulps.
-            } else {
-                inexact + 2 * (half_ulp_err1 + half_ulp_err2)
-            };
-
-            let ulps_from_boundary = {
-                let bits = calc_precision - used_bits - 1;
-
-                let i = bits / LIMB_BITS;
-                let limb = sig_calc[i] & (!0 >> (LIMB_BITS - 1 - bits % LIMB_BITS));
-                let boundary = match round {
-                    Round::NearestTiesToEven | Round::NearestTiesToAway => 1 << (bits % LIMB_BITS),
-                    _ => 0,
-                };
-                if i == 0 {
-                    let delta = limb.wrapping_sub(boundary);
-                    cmp::min(delta, delta.wrapping_neg())
-                } else if limb == boundary {
-                    if !sig::is_all_zeros(&sig_calc[1..i]) {
-                        !0 // A lot.
-                    } else {
-                        sig_calc[0]
-                    }
-                } else if limb == boundary.wrapping_sub(1) {
-                    if sig_calc[1..i].iter().any(|&x| x.wrapping_neg() != 1) {
-                        !0 // A lot.
-                    } else {
-                        sig_calc[0].wrapping_neg()
-                    }
-                } else {
-                    !0 // A lot.
-                }
-            };
-
-            // Are we guaranteed to round correctly if we truncate?
-            if ulps_from_boundary.saturating_mul(2) >= half_ulp_err {
-                let mut r = IeeeFloat {
-                    sig: [0],
-                    exp,
-                    category: Category::Normal,
-                    sign: false,
-                    marker: PhantomData,
-                };
-                sig::extract(&mut r.sig, &sig_calc, used_bits, calc_precision - used_bits);
-                // If we extracted less bits above we must adjust our exponent
-                // to compensate for the implicit right shift.
-                r.exp += (S::PRECISION - used_bits) as ExpInt;
-                let loss = Loss::through_truncation(&sig_calc, truncated_bits);
-                return Ok(r.normalize(round, loss));
-            }
-        }
-    }
-}
-
-impl Loss {
-    /// Combine the effect of two lost fractions.
-    fn combine(self, less_significant: Loss) -> Loss {
-        let mut more_significant = self;
-        if less_significant != Loss::ExactlyZero {
-            if more_significant == Loss::ExactlyZero {
-                more_significant = Loss::LessThanHalf;
-            } else if more_significant == Loss::ExactlyHalf {
-                more_significant = Loss::MoreThanHalf;
-            }
-        }
-
-        more_significant
-    }
-
-    /// Returns the fraction lost were a bignum truncated losing the least
-    /// significant `bits` bits.
-    fn through_truncation(limbs: &[Limb], bits: usize) -> Loss {
-        if bits == 0 {
-            return Loss::ExactlyZero;
-        }
-
-        let half_bit = bits - 1;
-        let half_limb = half_bit / LIMB_BITS;
-        let (half_limb, rest) = if half_limb < limbs.len() {
-            (limbs[half_limb], &limbs[..half_limb])
-        } else {
-            (0, limbs)
-        };
-        let half = 1 << (half_bit % LIMB_BITS);
-        let has_half = half_limb & half != 0;
-        let has_rest = half_limb & (half - 1) != 0 || !sig::is_all_zeros(rest);
-
-        match (has_half, has_rest) {
-            (false, false) => Loss::ExactlyZero,
-            (false, true) => Loss::LessThanHalf,
-            (true, false) => Loss::ExactlyHalf,
-            (true, true) => Loss::MoreThanHalf,
-        }
-    }
-}
-
-/// Implementation details of IeeeFloat significands, such as big integer arithmetic.
-/// As a rule of thumb, no functions in this module should dynamically allocate.
-mod sig {
-    use super::{limbs_for_bits, ExpInt, Limb, Loss, LIMB_BITS};
-    use core::cmp::Ordering;
-    use core::iter;
-    use core::mem;
-
-    pub(super) fn is_all_zeros(limbs: &[Limb]) -> bool {
-        limbs.iter().all(|&l| l == 0)
-    }
-
-    /// One, not zero, based LSB. That is, returns 0 for a zeroed significand.
-    pub(super) fn olsb(limbs: &[Limb]) -> usize {
-        limbs
-            .iter()
-            .enumerate()
-            .find(|(_, &limb)| limb != 0)
-            .map_or(0, |(i, limb)| i * LIMB_BITS + limb.trailing_zeros() as usize + 1)
-    }
-
-    /// One, not zero, based MSB. That is, returns 0 for a zeroed significand.
-    pub(super) fn omsb(limbs: &[Limb]) -> usize {
-        limbs
-            .iter()
-            .enumerate()
-            .rfind(|(_, &limb)| limb != 0)
-            .map_or(0, |(i, limb)| (i + 1) * LIMB_BITS - limb.leading_zeros() as usize)
-    }
-
-    /// Comparison (unsigned) of two significands.
-    pub(super) fn cmp(a: &[Limb], b: &[Limb]) -> Ordering {
-        assert_eq!(a.len(), b.len());
-        for (a, b) in a.iter().zip(b).rev() {
-            match a.cmp(b) {
-                Ordering::Equal => {}
-                o => return o,
-            }
-        }
-
-        Ordering::Equal
-    }
-
-    /// Extracts the given bit.
-    pub(super) fn get_bit(limbs: &[Limb], bit: usize) -> bool {
-        limbs[bit / LIMB_BITS] & (1 << (bit % LIMB_BITS)) != 0
-    }
-
-    /// Sets the given bit.
-    pub(super) fn set_bit(limbs: &mut [Limb], bit: usize) {
-        limbs[bit / LIMB_BITS] |= 1 << (bit % LIMB_BITS);
-    }
-
-    /// Clear the given bit.
-    pub(super) fn clear_bit(limbs: &mut [Limb], bit: usize) {
-        limbs[bit / LIMB_BITS] &= !(1 << (bit % LIMB_BITS));
-    }
-
-    /// Shifts `dst` left `bits` bits, subtract `bits` from its exponent.
-    pub(super) fn shift_left(dst: &mut [Limb], exp: &mut ExpInt, bits: usize) {
-        if bits > 0 {
-            // Our exponent should not underflow.
-            *exp = exp.checked_sub(bits as ExpInt).unwrap();
-
-            // Jump is the inter-limb jump; shift is the intra-limb shift.
-            let jump = bits / LIMB_BITS;
-            let shift = bits % LIMB_BITS;
-
-            for i in (0..dst.len()).rev() {
-                let mut limb;
-
-                if i < jump {
-                    limb = 0;
-                } else {
-                    // dst[i] comes from the two limbs src[i - jump] and, if we have
-                    // an intra-limb shift, src[i - jump - 1].
-                    limb = dst[i - jump];
-                    if shift > 0 {
-                        limb <<= shift;
-                        if i > jump {
-                            limb |= dst[i - jump - 1] >> (LIMB_BITS - shift);
-                        }
-                    }
-                }
-
-                dst[i] = limb;
-            }
-        }
-    }
-
-    /// Shifts `dst` right `bits` bits noting lost fraction.
-    pub(super) fn shift_right(dst: &mut [Limb], exp: &mut ExpInt, bits: usize) -> Loss {
-        let loss = Loss::through_truncation(dst, bits);
-
-        if bits > 0 {
-            // Our exponent should not overflow.
-            *exp = exp.checked_add(bits as ExpInt).unwrap();
-
-            // Jump is the inter-limb jump; shift is the intra-limb shift.
-            let jump = bits / LIMB_BITS;
-            let shift = bits % LIMB_BITS;
-
-            // Perform the shift. This leaves the most significant `bits` bits
-            // of the result at zero.
-            for i in 0..dst.len() {
-                let mut limb;
-
-                if i + jump >= dst.len() {
-                    limb = 0;
-                } else {
-                    limb = dst[i + jump];
-                    if shift > 0 {
-                        limb >>= shift;
-                        if i + jump + 1 < dst.len() {
-                            limb |= dst[i + jump + 1] << (LIMB_BITS - shift);
-                        }
-                    }
-                }
-
-                dst[i] = limb;
-            }
-        }
-
-        loss
-    }
-
-    /// Copies the bit vector of width `src_bits` from `src`, starting at bit SRC_LSB,
-    /// to `dst`, such that the bit SRC_LSB becomes the least significant bit of `dst`.
-    /// All high bits above `src_bits` in `dst` are zero-filled.
-    pub(super) fn extract(dst: &mut [Limb], src: &[Limb], src_bits: usize, src_lsb: usize) {
-        if src_bits == 0 {
-            return;
-        }
-
-        let dst_limbs = limbs_for_bits(src_bits);
-        assert!(dst_limbs <= dst.len());
-
-        let src = &src[src_lsb / LIMB_BITS..];
-        dst[..dst_limbs].copy_from_slice(&src[..dst_limbs]);
-
-        let shift = src_lsb % LIMB_BITS;
-        let _: Loss = shift_right(&mut dst[..dst_limbs], &mut 0, shift);
-
-        // We now have (dst_limbs * LIMB_BITS - shift) bits from `src`
-        // in `dst`.  If this is less that src_bits, append the rest, else
-        // clear the high bits.
-        let n = dst_limbs * LIMB_BITS - shift;
-        if n < src_bits {
-            let mask = (1 << (src_bits - n)) - 1;
-            dst[dst_limbs - 1] |= (src[dst_limbs] & mask) << (n % LIMB_BITS);
-        } else if n > src_bits && src_bits % LIMB_BITS > 0 {
-            dst[dst_limbs - 1] &= (1 << (src_bits % LIMB_BITS)) - 1;
-        }
-
-        // Clear high limbs.
-        for x in &mut dst[dst_limbs..] {
-            *x = 0;
-        }
-    }
-
-    /// We want the most significant PRECISION bits of `src`. There may not
-    /// be that many; extract what we can.
-    pub(super) fn from_limbs(dst: &mut [Limb], src: &[Limb], precision: usize) -> (Loss, ExpInt) {
-        let omsb = omsb(src);
-
-        if precision <= omsb {
-            extract(dst, src, precision, omsb - precision);
-            (Loss::through_truncation(src, omsb - precision), omsb as ExpInt - 1)
-        } else {
-            extract(dst, src, omsb, 0);
-            (Loss::ExactlyZero, precision as ExpInt - 1)
-        }
-    }
-
-    /// For every consecutive chunk of `bits` bits from `limbs`,
-    /// going from most significant to the least significant bits,
-    /// call `f` to transform those bits and store the result back.
-    pub(super) fn each_chunk<F: FnMut(Limb) -> Limb>(limbs: &mut [Limb], bits: usize, mut f: F) {
-        assert_eq!(LIMB_BITS % bits, 0);
-        for limb in limbs.iter_mut().rev() {
-            let mut r = 0;
-            for i in (0..LIMB_BITS / bits).rev() {
-                r |= f((*limb >> (i * bits)) & ((1 << bits) - 1)) << (i * bits);
-            }
-            *limb = r;
-        }
-    }
-
-    /// Increment in-place, return the carry flag.
-    pub(super) fn increment(dst: &mut [Limb]) -> Limb {
-        for x in dst {
-            *x = x.wrapping_add(1);
-            if *x != 0 {
-                return 0;
-            }
-        }
-
-        1
-    }
-
-    /// Decrement in-place, return the borrow flag.
-    pub(super) fn decrement(dst: &mut [Limb]) -> Limb {
-        for x in dst {
-            *x = x.wrapping_sub(1);
-            if *x != !0 {
-                return 0;
-            }
-        }
-
-        1
-    }
-
-    /// `a += b + c` where `c` is zero or one. Returns the carry flag.
-    pub(super) fn add(a: &mut [Limb], b: &[Limb], mut c: Limb) -> Limb {
-        assert!(c <= 1);
-
-        for (a, &b) in iter::zip(a, b) {
-            let (r, overflow) = a.overflowing_add(b);
-            let (r, overflow2) = r.overflowing_add(c);
-            *a = r;
-            c = (overflow | overflow2) as Limb;
-        }
-
-        c
-    }
-
-    /// `a -= b + c` where `c` is zero or one. Returns the borrow flag.
-    pub(super) fn sub(a: &mut [Limb], b: &[Limb], mut c: Limb) -> Limb {
-        assert!(c <= 1);
-
-        for (a, &b) in iter::zip(a, b) {
-            let (r, overflow) = a.overflowing_sub(b);
-            let (r, overflow2) = r.overflowing_sub(c);
-            *a = r;
-            c = (overflow | overflow2) as Limb;
-        }
-
-        c
-    }
-
-    /// `a += b` or `a -= b`. Does not preserve `b`.
-    pub(super) fn add_or_sub(
-        a_sig: &mut [Limb],
-        a_exp: &mut ExpInt,
-        a_sign: &mut bool,
-        b_sig: &mut [Limb],
-        b_exp: ExpInt,
-        b_sign: bool,
-    ) -> Loss {
-        // Are we bigger exponent-wise than the RHS?
-        let bits = *a_exp - b_exp;
-
-        // Determine if the operation on the absolute values is effectively
-        // an addition or subtraction.
-        // Subtraction is more subtle than one might naively expect.
-        if *a_sign ^ b_sign {
-            let (reverse, loss);
-
-            if bits == 0 {
-                reverse = cmp(a_sig, b_sig) == Ordering::Less;
-                loss = Loss::ExactlyZero;
-            } else if bits > 0 {
-                loss = shift_right(b_sig, &mut 0, (bits - 1) as usize);
-                shift_left(a_sig, a_exp, 1);
-                reverse = false;
-            } else {
-                loss = shift_right(a_sig, a_exp, (-bits - 1) as usize);
-                shift_left(b_sig, &mut 0, 1);
-                reverse = true;
-            }
-
-            let borrow = (loss != Loss::ExactlyZero) as Limb;
-            if reverse {
-                // The code above is intended to ensure that no borrow is necessary.
-                assert_eq!(sub(b_sig, a_sig, borrow), 0);
-                a_sig.copy_from_slice(b_sig);
-                *a_sign = !*a_sign;
-            } else {
-                // The code above is intended to ensure that no borrow is necessary.
-                assert_eq!(sub(a_sig, b_sig, borrow), 0);
-            }
-
-            // Invert the lost fraction - it was on the RHS and subtracted.
-            match loss {
-                Loss::LessThanHalf => Loss::MoreThanHalf,
-                Loss::MoreThanHalf => Loss::LessThanHalf,
-                _ => loss,
-            }
-        } else {
-            let loss = if bits > 0 {
-                shift_right(b_sig, &mut 0, bits as usize)
-            } else {
-                shift_right(a_sig, a_exp, -bits as usize)
-            };
-            // We have a guard bit; generating a carry cannot happen.
-            assert_eq!(add(a_sig, b_sig, 0), 0);
-            loss
-        }
-    }
-
-    /// `[low, high] = a * b`.
-    ///
-    /// This cannot overflow, because
-    ///
-    /// `(n - 1) * (n - 1) + 2 * (n - 1) == (n - 1) * (n + 1)`
-    ///
-    /// which is less than n<sup>2</sup>.
-    pub(super) fn widening_mul(a: Limb, b: Limb) -> [Limb; 2] {
-        let mut wide = [0, 0];
-
-        if a == 0 || b == 0 {
-            return wide;
-        }
-
-        const HALF_BITS: usize = LIMB_BITS / 2;
-
-        let select = |limb, i| (limb >> (i * HALF_BITS)) & ((1 << HALF_BITS) - 1);
-        for i in 0..2 {
-            for j in 0..2 {
-                let mut x = [select(a, i) * select(b, j), 0];
-                shift_left(&mut x, &mut 0, (i + j) * HALF_BITS);
-                assert_eq!(add(&mut wide, &x, 0), 0);
-            }
-        }
-
-        wide
-    }
-
-    /// `dst = a * b` (for normal `a` and `b`). Returns the lost fraction.
-    pub(super) fn mul<'a>(
-        dst: &mut [Limb],
-        exp: &mut ExpInt,
-        mut a: &'a [Limb],
-        mut b: &'a [Limb],
-        precision: usize,
-    ) -> Loss {
-        // Put the narrower number on the `a` for less loops below.
-        if a.len() > b.len() {
-            mem::swap(&mut a, &mut b);
-        }
-
-        for x in &mut dst[..b.len()] {
-            *x = 0;
-        }
-
-        for i in 0..a.len() {
-            let mut carry = 0;
-            for j in 0..b.len() {
-                let [low, mut high] = widening_mul(a[i], b[j]);
-
-                // Now add carry.
-                let (low, overflow) = low.overflowing_add(carry);
-                high += overflow as Limb;
-
-                // And now `dst[i + j]`, and store the new low part there.
-                let (low, overflow) = low.overflowing_add(dst[i + j]);
-                high += overflow as Limb;
-
-                dst[i + j] = low;
-                carry = high;
-            }
-            dst[i + b.len()] = carry;
-        }
-
-        // Assume the operands involved in the multiplication are single-precision
-        // FP, and the two multiplicants are:
-        //     a = a23 . a22 ... a0 * 2^e1
-        //     b = b23 . b22 ... b0 * 2^e2
-        // the result of multiplication is:
-        //     dst = c48 c47 c46 . c45 ... c0 * 2^(e1+e2)
-        // Note that there are three significant bits at the left-hand side of the
-        // radix point: two for the multiplication, and an overflow bit for the
-        // addition (that will always be zero at this point). Move the radix point
-        // toward left by two bits, and adjust exponent accordingly.
-        *exp += 2;
-
-        // Convert the result having "2 * precision" significant-bits back to the one
-        // having "precision" significant-bits. First, move the radix point from
-        // poision "2*precision - 1" to "precision - 1". The exponent need to be
-        // adjusted by "2*precision - 1" - "precision - 1" = "precision".
-        *exp -= precision as ExpInt + 1;
-
-        // In case MSB resides at the left-hand side of radix point, shift the
-        // mantissa right by some amount to make sure the MSB reside right before
-        // the radix point (i.e., "MSB . rest-significant-bits").
-        //
-        // Note that the result is not normalized when "omsb < precision". So, the
-        // caller needs to call IeeeFloat::normalize() if normalized value is
-        // expected.
-        let omsb = omsb(dst);
-        if omsb <= precision { Loss::ExactlyZero } else { shift_right(dst, exp, omsb - precision) }
-    }
-
-    /// `quotient = dividend / divisor`. Returns the lost fraction.
-    /// Does not preserve `dividend` or `divisor`.
-    pub(super) fn div(
-        quotient: &mut [Limb],
-        exp: &mut ExpInt,
-        dividend: &mut [Limb],
-        divisor: &mut [Limb],
-        precision: usize,
-    ) -> Loss {
-        // Normalize the divisor.
-        let bits = precision - omsb(divisor);
-        shift_left(divisor, &mut 0, bits);
-        *exp += bits as ExpInt;
-
-        // Normalize the dividend.
-        let bits = precision - omsb(dividend);
-        shift_left(dividend, exp, bits);
-
-        // Division by 1.
-        let olsb_divisor = olsb(divisor);
-        if olsb_divisor == precision {
-            quotient.copy_from_slice(dividend);
-            return Loss::ExactlyZero;
-        }
-
-        // Ensure the dividend >= divisor initially for the loop below.
-        // Incidentally, this means that the division loop below is
-        // guaranteed to set the integer bit to one.
-        if cmp(dividend, divisor) == Ordering::Less {
-            shift_left(dividend, exp, 1);
-            assert_ne!(cmp(dividend, divisor), Ordering::Less)
-        }
-
-        // Helper for figuring out the lost fraction.
-        let lost_fraction = |dividend: &[Limb], divisor: &[Limb]| match cmp(dividend, divisor) {
-            Ordering::Greater => Loss::MoreThanHalf,
-            Ordering::Equal => Loss::ExactlyHalf,
-            Ordering::Less => {
-                if is_all_zeros(dividend) {
-                    Loss::ExactlyZero
-                } else {
-                    Loss::LessThanHalf
-                }
-            }
-        };
-
-        // Try to perform a (much faster) short division for small divisors.
-        let divisor_bits = precision - (olsb_divisor - 1);
-        macro_rules! try_short_div {
-            ($W:ty, $H:ty, $half:expr) => {
-                if divisor_bits * 2 <= $half {
-                    // Extract the small divisor.
-                    let _: Loss = shift_right(divisor, &mut 0, olsb_divisor - 1);
-                    let divisor = divisor[0] as $H as $W;
-
-                    // Shift the dividend to produce a quotient with the unit bit set.
-                    let top_limb = *dividend.last().unwrap();
-                    let mut rem = (top_limb >> (LIMB_BITS - (divisor_bits - 1))) as $H;
-                    shift_left(dividend, &mut 0, divisor_bits - 1);
-
-                    // Apply short division in place on $H (of $half bits) chunks.
-                    each_chunk(dividend, $half, |chunk| {
-                        let chunk = chunk as $H;
-                        let combined = ((rem as $W) << $half) | (chunk as $W);
-                        rem = (combined % divisor) as $H;
-                        (combined / divisor) as $H as Limb
-                    });
-                    quotient.copy_from_slice(dividend);
-
-                    return lost_fraction(&[(rem as Limb) << 1], &[divisor as Limb]);
-                }
-            };
-        }
-
-        try_short_div!(u32, u16, 16);
-        try_short_div!(u64, u32, 32);
-        try_short_div!(u128, u64, 64);
-
-        // Zero the quotient before setting bits in it.
-        for x in &mut quotient[..limbs_for_bits(precision)] {
-            *x = 0;
-        }
-
-        // Long division.
-        for bit in (0..precision).rev() {
-            if cmp(dividend, divisor) != Ordering::Less {
-                sub(dividend, divisor, 0);
-                set_bit(quotient, bit);
-            }
-            shift_left(dividend, &mut 0, 1);
-        }
-
-        lost_fraction(dividend, divisor)
-    }
-}
diff --git a/compiler/rustc_apfloat/src/lib.rs b/compiler/rustc_apfloat/src/lib.rs
deleted file mode 100644
index dde368e7b92..00000000000
--- a/compiler/rustc_apfloat/src/lib.rs
+++ /dev/null
@@ -1,695 +0,0 @@
-//! Port of LLVM's APFloat software floating-point implementation from the
-//! following C++ sources (please update commit hash when backporting):
-//! <https://github.com/llvm-mirror/llvm/tree/23efab2bbd424ed13495a420ad8641cb2c6c28f9>
-//!
-//! * `include/llvm/ADT/APFloat.h` -> `Float` and `FloatConvert` traits
-//! * `lib/Support/APFloat.cpp` -> `ieee` and `ppc` modules
-//! * `unittests/ADT/APFloatTest.cpp` -> `tests` directory
-//!
-//! The port contains no unsafe code, global state, or side-effects in general,
-//! and the only allocations are in the conversion to/from decimal strings.
-//!
-//! Most of the API and the testcases are intact in some form or another,
-//! with some ergonomic changes, such as idiomatic short names, returning
-//! new values instead of mutating the receiver, and having separate method
-//! variants that take a non-default rounding mode (with the suffix `_r`).
-//! Comments have been preserved where possible, only slightly adapted.
-//!
-//! Instead of keeping a pointer to a configuration struct and inspecting it
-//! dynamically on every operation, types (e.g., `ieee::Double`), traits
-//! (e.g., `ieee::Semantics`) and associated constants are employed for
-//! increased type safety and performance.
-//!
-//! On-heap bigints are replaced everywhere (except in decimal conversion),
-//! with short arrays of `type Limb = u128` elements (instead of `u64`),
-//! This allows fitting the largest supported significands in one integer
-//! (`ieee::Quad` and `ppc::Fallback` use slightly less than 128 bits).
-//! All of the functions in the `ieee::sig` module operate on slices.
-//!
-//! # Note
-//!
-//! This API is completely unstable and subject to change.
-
-#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
-#![no_std]
-#![forbid(unsafe_code)]
-#![deny(rustc::untranslatable_diagnostic)]
-#![deny(rustc::diagnostic_outside_of_impl)]
-
-#[macro_use]
-extern crate alloc;
-
-use core::cmp::Ordering;
-use core::fmt;
-use core::ops::{Add, Div, Mul, Neg, Rem, Sub};
-use core::ops::{AddAssign, DivAssign, MulAssign, RemAssign, SubAssign};
-use core::str::FromStr;
-
-bitflags::bitflags! {
-    /// IEEE-754R 7: Default exception handling.
-    ///
-    /// UNDERFLOW or OVERFLOW are always returned or-ed with INEXACT.
-    #[must_use]
-    pub struct Status: u8 {
-        const OK = 0x00;
-        const INVALID_OP = 0x01;
-        const DIV_BY_ZERO = 0x02;
-        const OVERFLOW = 0x04;
-        const UNDERFLOW = 0x08;
-        const INEXACT = 0x10;
-    }
-}
-
-#[must_use]
-#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
-pub struct StatusAnd<T> {
-    pub status: Status,
-    pub value: T,
-}
-
-impl Status {
-    pub fn and<T>(self, value: T) -> StatusAnd<T> {
-        StatusAnd { status: self, value }
-    }
-}
-
-impl<T> StatusAnd<T> {
-    pub fn map<F: FnOnce(T) -> U, U>(self, f: F) -> StatusAnd<U> {
-        StatusAnd { status: self.status, value: f(self.value) }
-    }
-}
-
-#[macro_export]
-macro_rules! unpack {
-    ($status:ident|=, $e:expr) => {
-        match $e {
-            $crate::StatusAnd { status, value } => {
-                $status |= status;
-                value
-            }
-        }
-    };
-    ($status:ident=, $e:expr) => {
-        match $e {
-            $crate::StatusAnd { status, value } => {
-                $status = status;
-                value
-            }
-        }
-    };
-}
-
-/// Category of internally-represented number.
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-pub enum Category {
-    Infinity,
-    NaN,
-    Normal,
-    Zero,
-}
-
-/// IEEE-754R 4.3: Rounding-direction attributes.
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-pub enum Round {
-    NearestTiesToEven,
-    TowardPositive,
-    TowardNegative,
-    TowardZero,
-    NearestTiesToAway,
-}
-
-impl Neg for Round {
-    type Output = Round;
-    fn neg(self) -> Round {
-        match self {
-            Round::TowardPositive => Round::TowardNegative,
-            Round::TowardNegative => Round::TowardPositive,
-            Round::NearestTiesToEven | Round::TowardZero | Round::NearestTiesToAway => self,
-        }
-    }
-}
-
-/// A signed type to represent a floating point number's unbiased exponent.
-pub type ExpInt = i16;
-
-// \c ilogb error results.
-pub const IEK_INF: ExpInt = ExpInt::MAX;
-pub const IEK_NAN: ExpInt = ExpInt::MIN;
-pub const IEK_ZERO: ExpInt = ExpInt::MIN + 1;
-
-#[derive(Copy, Clone, PartialEq, Eq, Debug)]
-pub struct ParseError(pub &'static str);
-
-/// A self-contained host- and target-independent arbitrary-precision
-/// floating-point software implementation.
-///
-/// `apfloat` uses significand bignum integer arithmetic as provided by functions
-/// in the `ieee::sig`.
-///
-/// Written for clarity rather than speed, in particular with a view to use in
-/// the front-end of a cross compiler so that target arithmetic can be correctly
-/// performed on the host. Performance should nonetheless be reasonable,
-/// particularly for its intended use. It may be useful as a base
-/// implementation for a run-time library during development of a faster
-/// target-specific one.
-///
-/// All 5 rounding modes in the IEEE-754R draft are handled correctly for all
-/// implemented operations. Currently implemented operations are add, subtract,
-/// multiply, divide, fused-multiply-add, conversion-to-float,
-/// conversion-to-integer and conversion-from-integer. New rounding modes
-/// (e.g., away from zero) can be added with three or four lines of code.
-///
-/// Four formats are built-in: IEEE single precision, double precision,
-/// quadruple precision, and x87 80-bit extended double (when operating with
-/// full extended precision). Adding a new format that obeys IEEE semantics
-/// only requires adding two lines of code: a declaration and definition of the
-/// format.
-///
-/// All operations return the status of that operation as an exception bit-mask,
-/// so multiple operations can be done consecutively with their results or-ed
-/// together. The returned status can be useful for compiler diagnostics; e.g.,
-/// inexact, underflow and overflow can be easily diagnosed on constant folding,
-/// and compiler optimizers can determine what exceptions would be raised by
-/// folding operations and optimize, or perhaps not optimize, accordingly.
-///
-/// At present, underflow tininess is detected after rounding; it should be
-/// straight forward to add support for the before-rounding case too.
-///
-/// The library reads hexadecimal floating point numbers as per C99, and
-/// correctly rounds if necessary according to the specified rounding mode.
-/// Syntax is required to have been validated by the caller.
-///
-/// It also reads decimal floating point numbers and correctly rounds according
-/// to the specified rounding mode.
-///
-/// Non-zero finite numbers are represented internally as a sign bit, a 16-bit
-/// signed exponent, and the significand as an array of integer limbs. After
-/// normalization of a number of precision P the exponent is within the range of
-/// the format, and if the number is not denormal the P-th bit of the
-/// significand is set as an explicit integer bit. For denormals the most
-/// significant bit is shifted right so that the exponent is maintained at the
-/// format's minimum, so that the smallest denormal has just the least
-/// significant bit of the significand set. The sign of zeros and infinities
-/// is significant; the exponent and significand of such numbers is not stored,
-/// but has a known implicit (deterministic) value: 0 for the significands, 0
-/// for zero exponent, all 1 bits for infinity exponent. For NaNs the sign and
-/// significand are deterministic, although not really meaningful, and preserved
-/// in non-conversion operations. The exponent is implicitly all 1 bits.
-///
-/// `apfloat` does not provide any exception handling beyond default exception
-/// handling. We represent Signaling NaNs via IEEE-754R 2008 6.2.1 should clause
-/// by encoding Signaling NaNs with the first bit of its trailing significand
-/// as 0.
-///
-/// Future work
-/// ===========
-///
-/// Some features that may or may not be worth adding:
-///
-/// Optional ability to detect underflow tininess before rounding.
-///
-/// New formats: x87 in single and double precision mode (IEEE apart from
-/// extended exponent range) (hard).
-///
-/// New operations: sqrt, nexttoward.
-///
-pub trait Float:
-    Copy
-    + Default
-    + FromStr<Err = ParseError>
-    + PartialOrd
-    + fmt::Display
-    + Neg<Output = Self>
-    + AddAssign
-    + SubAssign
-    + MulAssign
-    + DivAssign
-    + RemAssign
-    + Add<Output = StatusAnd<Self>>
-    + Sub<Output = StatusAnd<Self>>
-    + Mul<Output = StatusAnd<Self>>
-    + Div<Output = StatusAnd<Self>>
-    + Rem<Output = StatusAnd<Self>>
-{
-    /// Total number of bits in the in-memory format.
-    const BITS: usize;
-
-    /// Number of bits in the significand. This includes the integer bit.
-    const PRECISION: usize;
-
-    /// The largest E such that 2<sup>E</sup> is representable; this matches the
-    /// definition of IEEE 754.
-    const MAX_EXP: ExpInt;
-
-    /// The smallest E such that 2<sup>E</sup> is a normalized number; this
-    /// matches the definition of IEEE 754.
-    const MIN_EXP: ExpInt;
-
-    /// Positive Zero.
-    const ZERO: Self;
-
-    /// Positive Infinity.
-    const INFINITY: Self;
-
-    /// NaN (Not a Number).
-    // FIXME(eddyb) provide a default when qnan becomes const fn.
-    const NAN: Self;
-
-    /// Factory for QNaN values.
-    // FIXME(eddyb) should be const fn.
-    fn qnan(payload: Option<u128>) -> Self;
-
-    /// Factory for SNaN values.
-    // FIXME(eddyb) should be const fn.
-    fn snan(payload: Option<u128>) -> Self;
-
-    /// Largest finite number.
-    // FIXME(eddyb) should be const (but FloatPair::largest is nontrivial).
-    fn largest() -> Self;
-
-    /// Smallest (by magnitude) finite number.
-    /// Might be denormalized, which implies a relative loss of precision.
-    const SMALLEST: Self;
-
-    /// Smallest (by magnitude) normalized finite number.
-    // FIXME(eddyb) should be const (but FloatPair::smallest_normalized is nontrivial).
-    fn smallest_normalized() -> Self;
-
-    // Arithmetic
-
-    fn add_r(self, rhs: Self, round: Round) -> StatusAnd<Self>;
-    fn sub_r(self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        self.add_r(-rhs, round)
-    }
-    fn mul_r(self, rhs: Self, round: Round) -> StatusAnd<Self>;
-    fn mul_add_r(self, multiplicand: Self, addend: Self, round: Round) -> StatusAnd<Self>;
-    fn mul_add(self, multiplicand: Self, addend: Self) -> StatusAnd<Self> {
-        self.mul_add_r(multiplicand, addend, Round::NearestTiesToEven)
-    }
-    fn div_r(self, rhs: Self, round: Round) -> StatusAnd<Self>;
-    /// IEEE remainder.
-    // This is not currently correct in all cases.
-    fn ieee_rem(self, rhs: Self) -> StatusAnd<Self> {
-        let mut v = self;
-
-        let status;
-        v = unpack!(status=, v / rhs);
-        if status == Status::DIV_BY_ZERO {
-            return status.and(self);
-        }
-
-        assert!(Self::PRECISION < 128);
-
-        let status;
-        let x = unpack!(status=, v.to_i128_r(128, Round::NearestTiesToEven, &mut false));
-        if status == Status::INVALID_OP {
-            return status.and(self);
-        }
-
-        let status;
-        let mut v = unpack!(status=, Self::from_i128(x));
-        assert_eq!(status, Status::OK); // should always work
-
-        let status;
-        v = unpack!(status=, v * rhs);
-        assert_eq!(status - Status::INEXACT, Status::OK); // should not overflow or underflow
-
-        let status;
-        v = unpack!(status=, self - v);
-        assert_eq!(status - Status::INEXACT, Status::OK); // likewise
-
-        if v.is_zero() {
-            status.and(v.copy_sign(self)) // IEEE754 requires this
-        } else {
-            status.and(v)
-        }
-    }
-    /// C fmod, or llvm frem.
-    fn c_fmod(self, rhs: Self) -> StatusAnd<Self>;
-    fn round_to_integral(self, round: Round) -> StatusAnd<Self>;
-
-    /// IEEE-754R 2008 5.3.1: nextUp.
-    fn next_up(self) -> StatusAnd<Self>;
-
-    /// IEEE-754R 2008 5.3.1: nextDown.
-    ///
-    /// *NOTE* since nextDown(x) = -nextUp(-x), we only implement nextUp with
-    /// appropriate sign switching before/after the computation.
-    fn next_down(self) -> StatusAnd<Self> {
-        (-self).next_up().map(|r| -r)
-    }
-
-    fn abs(self) -> Self {
-        if self.is_negative() { -self } else { self }
-    }
-    fn copy_sign(self, rhs: Self) -> Self {
-        if self.is_negative() != rhs.is_negative() { -self } else { self }
-    }
-
-    // Conversions
-    fn from_bits(input: u128) -> Self;
-    fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self> {
-        if input < 0 {
-            Self::from_u128_r(input.wrapping_neg() as u128, -round).map(|r| -r)
-        } else {
-            Self::from_u128_r(input as u128, round)
-        }
-    }
-    fn from_i128(input: i128) -> StatusAnd<Self> {
-        Self::from_i128_r(input, Round::NearestTiesToEven)
-    }
-    fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self>;
-    fn from_u128(input: u128) -> StatusAnd<Self> {
-        Self::from_u128_r(input, Round::NearestTiesToEven)
-    }
-    fn from_str_r(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError>;
-    fn to_bits(self) -> u128;
-
-    /// Converts a floating point number to an integer according to the
-    /// rounding mode. In case of an invalid operation exception,
-    /// deterministic values are returned, namely zero for NaNs and the
-    /// minimal or maximal value respectively for underflow or overflow.
-    /// If the rounded value is in range but the floating point number is
-    /// not the exact integer, the C standard doesn't require an inexact
-    /// exception to be raised. IEEE-854 does require it so we do that.
-    ///
-    /// Note that for conversions to integer type the C standard requires
-    /// round-to-zero to always be used.
-    ///
-    /// The *is_exact output tells whether the result is exact, in the sense
-    /// that converting it back to the original floating point type produces
-    /// the original value. This is almost equivalent to `result == Status::OK`,
-    /// except for negative zeroes.
-    fn to_i128_r(self, width: usize, round: Round, is_exact: &mut bool) -> StatusAnd<i128> {
-        let status;
-        if self.is_negative() {
-            if self.is_zero() {
-                // Negative zero can't be represented as an int.
-                *is_exact = false;
-            }
-            let r = unpack!(status=, (-self).to_u128_r(width, -round, is_exact));
-
-            // Check for values that don't fit in the signed integer.
-            if r > (1 << (width - 1)) {
-                // Return the most negative integer for the given width.
-                *is_exact = false;
-                Status::INVALID_OP.and(-1 << (width - 1))
-            } else {
-                status.and(r.wrapping_neg() as i128)
-            }
-        } else {
-            // Positive case is simpler, can pretend it's a smaller unsigned
-            // integer, and `to_u128` will take care of all the edge cases.
-            self.to_u128_r(width - 1, round, is_exact).map(|r| r as i128)
-        }
-    }
-    fn to_i128(self, width: usize) -> StatusAnd<i128> {
-        self.to_i128_r(width, Round::TowardZero, &mut true)
-    }
-    fn to_u128_r(self, width: usize, round: Round, is_exact: &mut bool) -> StatusAnd<u128>;
-    fn to_u128(self, width: usize) -> StatusAnd<u128> {
-        self.to_u128_r(width, Round::TowardZero, &mut true)
-    }
-
-    fn cmp_abs_normal(self, rhs: Self) -> Ordering;
-
-    /// Bitwise comparison for equality (QNaNs compare equal, 0!=-0).
-    fn bitwise_eq(self, rhs: Self) -> bool;
-
-    // IEEE-754R 5.7.2 General operations.
-
-    /// Implements IEEE minNum semantics. Returns the smaller of the 2 arguments if
-    /// both are not NaN. If either argument is a NaN, returns the other argument.
-    fn min(self, other: Self) -> Self {
-        if self.is_nan() {
-            other
-        } else if other.is_nan() {
-            self
-        } else if other.partial_cmp(&self) == Some(Ordering::Less) {
-            other
-        } else {
-            self
-        }
-    }
-
-    /// Implements IEEE maxNum semantics. Returns the larger of the 2 arguments if
-    /// both are not NaN. If either argument is a NaN, returns the other argument.
-    fn max(self, other: Self) -> Self {
-        if self.is_nan() {
-            other
-        } else if other.is_nan() {
-            self
-        } else if self.partial_cmp(&other) == Some(Ordering::Less) {
-            other
-        } else {
-            self
-        }
-    }
-
-    /// IEEE-754R isSignMinus: Returns whether the current value is
-    /// negative.
-    ///
-    /// This applies to zeros and NaNs as well.
-    fn is_negative(self) -> bool;
-
-    /// IEEE-754R isNormal: Returns whether the current value is normal.
-    ///
-    /// This implies that the current value of the float is not zero, subnormal,
-    /// infinite, or NaN following the definition of normality from IEEE-754R.
-    fn is_normal(self) -> bool {
-        !self.is_denormal() && self.is_finite_non_zero()
-    }
-
-    /// Returns `true` if the current value is zero, subnormal, or
-    /// normal.
-    ///
-    /// This means that the value is not infinite or NaN.
-    fn is_finite(self) -> bool {
-        !self.is_nan() && !self.is_infinite()
-    }
-
-    /// Returns `true` if the float is plus or minus zero.
-    fn is_zero(self) -> bool {
-        self.category() == Category::Zero
-    }
-
-    /// IEEE-754R isSubnormal(): Returns whether the float is a
-    /// denormal.
-    fn is_denormal(self) -> bool;
-
-    /// IEEE-754R isInfinite(): Returns whether the float is infinity.
-    fn is_infinite(self) -> bool {
-        self.category() == Category::Infinity
-    }
-
-    /// Returns `true` if the float is a quiet or signaling NaN.
-    fn is_nan(self) -> bool {
-        self.category() == Category::NaN
-    }
-
-    /// Returns `true` if the float is a signaling NaN.
-    fn is_signaling(self) -> bool;
-
-    // Simple Queries
-
-    fn category(self) -> Category;
-    fn is_non_zero(self) -> bool {
-        !self.is_zero()
-    }
-    fn is_finite_non_zero(self) -> bool {
-        self.is_finite() && !self.is_zero()
-    }
-    fn is_pos_zero(self) -> bool {
-        self.is_zero() && !self.is_negative()
-    }
-    fn is_neg_zero(self) -> bool {
-        self.is_zero() && self.is_negative()
-    }
-
-    /// Returns `true` if the number has the smallest possible non-zero
-    /// magnitude in the current semantics.
-    fn is_smallest(self) -> bool {
-        Self::SMALLEST.copy_sign(self).bitwise_eq(self)
-    }
-
-    /// Returns `true` if the number has the largest possible finite
-    /// magnitude in the current semantics.
-    fn is_largest(self) -> bool {
-        Self::largest().copy_sign(self).bitwise_eq(self)
-    }
-
-    /// Returns `true` if the number is an exact integer.
-    fn is_integer(self) -> bool {
-        // This could be made more efficient; I'm going for obviously correct.
-        if !self.is_finite() {
-            return false;
-        }
-        self.round_to_integral(Round::TowardZero).value.bitwise_eq(self)
-    }
-
-    /// If this value has an exact multiplicative inverse, return it.
-    fn get_exact_inverse(self) -> Option<Self>;
-
-    /// Returns the exponent of the internal representation of the Float.
-    ///
-    /// Because the radix of Float is 2, this is equivalent to floor(log2(x)).
-    /// For special Float values, this returns special error codes:
-    ///
-    ///   NaN -> \c IEK_NAN
-    ///   0   -> \c IEK_ZERO
-    ///   Inf -> \c IEK_INF
-    ///
-    fn ilogb(self) -> ExpInt;
-
-    /// Returns: self * 2<sup>exp</sup> for integral exponents.
-    /// Equivalent to C standard library function `ldexp`.
-    fn scalbn_r(self, exp: ExpInt, round: Round) -> Self;
-    fn scalbn(self, exp: ExpInt) -> Self {
-        self.scalbn_r(exp, Round::NearestTiesToEven)
-    }
-
-    /// Equivalent to C standard library function with the same name.
-    ///
-    /// While the C standard says exp is an unspecified value for infinity and nan,
-    /// this returns INT_MAX for infinities, and INT_MIN for NaNs (see `ilogb`).
-    fn frexp_r(self, exp: &mut ExpInt, round: Round) -> Self;
-    fn frexp(self, exp: &mut ExpInt) -> Self {
-        self.frexp_r(exp, Round::NearestTiesToEven)
-    }
-}
-
-pub trait FloatConvert<T: Float>: Float {
-    /// Converts a value of one floating point type to another.
-    /// The return value corresponds to the IEEE754 exceptions. *loses_info
-    /// records whether the transformation lost information, i.e., whether
-    /// converting the result back to the original type will produce the
-    /// original value (this is almost the same as return `value == Status::OK`,
-    /// but there are edge cases where this is not so).
-    fn convert_r(self, round: Round, loses_info: &mut bool) -> StatusAnd<T>;
-    fn convert(self, loses_info: &mut bool) -> StatusAnd<T> {
-        self.convert_r(Round::NearestTiesToEven, loses_info)
-    }
-}
-
-macro_rules! float_common_impls {
-    ($ty:ident<$t:tt>) => {
-        impl<$t> Default for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn default() -> Self {
-                Self::ZERO
-            }
-        }
-
-        impl<$t> ::core::str::FromStr for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Err = ParseError;
-            fn from_str(s: &str) -> Result<Self, ParseError> {
-                Self::from_str_r(s, Round::NearestTiesToEven).map(|x| x.value)
-            }
-        }
-
-        // Rounding ties to the nearest even, by default.
-
-        impl<$t> ::core::ops::Add for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Output = StatusAnd<Self>;
-            fn add(self, rhs: Self) -> StatusAnd<Self> {
-                self.add_r(rhs, Round::NearestTiesToEven)
-            }
-        }
-
-        impl<$t> ::core::ops::Sub for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Output = StatusAnd<Self>;
-            fn sub(self, rhs: Self) -> StatusAnd<Self> {
-                self.sub_r(rhs, Round::NearestTiesToEven)
-            }
-        }
-
-        impl<$t> ::core::ops::Mul for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Output = StatusAnd<Self>;
-            fn mul(self, rhs: Self) -> StatusAnd<Self> {
-                self.mul_r(rhs, Round::NearestTiesToEven)
-            }
-        }
-
-        impl<$t> ::core::ops::Div for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Output = StatusAnd<Self>;
-            fn div(self, rhs: Self) -> StatusAnd<Self> {
-                self.div_r(rhs, Round::NearestTiesToEven)
-            }
-        }
-
-        impl<$t> ::core::ops::Rem for $ty<$t>
-        where
-            Self: Float,
-        {
-            type Output = StatusAnd<Self>;
-            fn rem(self, rhs: Self) -> StatusAnd<Self> {
-                self.c_fmod(rhs)
-            }
-        }
-
-        impl<$t> ::core::ops::AddAssign for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn add_assign(&mut self, rhs: Self) {
-                *self = (*self + rhs).value;
-            }
-        }
-
-        impl<$t> ::core::ops::SubAssign for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn sub_assign(&mut self, rhs: Self) {
-                *self = (*self - rhs).value;
-            }
-        }
-
-        impl<$t> ::core::ops::MulAssign for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn mul_assign(&mut self, rhs: Self) {
-                *self = (*self * rhs).value;
-            }
-        }
-
-        impl<$t> ::core::ops::DivAssign for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn div_assign(&mut self, rhs: Self) {
-                *self = (*self / rhs).value;
-            }
-        }
-
-        impl<$t> ::core::ops::RemAssign for $ty<$t>
-        where
-            Self: Float,
-        {
-            fn rem_assign(&mut self, rhs: Self) {
-                *self = (*self % rhs).value;
-            }
-        }
-    };
-}
-
-pub mod ieee;
-pub mod ppc;
diff --git a/compiler/rustc_apfloat/src/ppc.rs b/compiler/rustc_apfloat/src/ppc.rs
deleted file mode 100644
index 65a0f66645b..00000000000
--- a/compiler/rustc_apfloat/src/ppc.rs
+++ /dev/null
@@ -1,434 +0,0 @@
-use crate::ieee;
-use crate::{Category, ExpInt, Float, FloatConvert, ParseError, Round, Status, StatusAnd};
-
-use core::cmp::Ordering;
-use core::fmt;
-use core::ops::Neg;
-
-#[must_use]
-#[derive(Copy, Clone, PartialEq, PartialOrd, Debug)]
-pub struct DoubleFloat<F>(F, F);
-pub type DoubleDouble = DoubleFloat<ieee::Double>;
-
-// These are legacy semantics for the Fallback, inaccurate implementation of
-// IBM double-double, if the accurate DoubleDouble doesn't handle the
-// operation. It's equivalent to having an IEEE number with consecutive 106
-// bits of mantissa and 11 bits of exponent.
-//
-// It's not equivalent to IBM double-double. For example, a legit IBM
-// double-double, 1 + epsilon:
-//
-//   1 + epsilon = 1 + (1 >> 1076)
-//
-// is not representable by a consecutive 106 bits of mantissa.
-//
-// Currently, these semantics are used in the following way:
-//
-//   DoubleDouble -> (Double, Double) ->
-//   DoubleDouble's Fallback -> IEEE operations
-//
-// FIXME: Implement all operations in DoubleDouble, and delete these
-// semantics.
-// FIXME(eddyb) This shouldn't need to be `pub`, it's only used in bounds.
-pub struct FallbackS<F>(#[allow(unused)] F);
-type Fallback<F> = ieee::IeeeFloat<FallbackS<F>>;
-impl<F: Float> ieee::Semantics for FallbackS<F> {
-    // Forbid any conversion to/from bits.
-    const BITS: usize = 0;
-    const PRECISION: usize = F::PRECISION * 2;
-    const MAX_EXP: ExpInt = F::MAX_EXP as ExpInt;
-    const MIN_EXP: ExpInt = F::MIN_EXP as ExpInt + F::PRECISION as ExpInt;
-}
-
-// Convert number to F. To avoid spurious underflows, we re-
-// normalize against the F exponent range first, and only *then*
-// truncate the mantissa. The result of that second conversion
-// may be inexact, but should never underflow.
-// FIXME(eddyb) This shouldn't need to be `pub`, it's only used in bounds.
-pub struct FallbackExtendedS<F>(#[allow(unused)] F);
-type FallbackExtended<F> = ieee::IeeeFloat<FallbackExtendedS<F>>;
-impl<F: Float> ieee::Semantics for FallbackExtendedS<F> {
-    // Forbid any conversion to/from bits.
-    const BITS: usize = 0;
-    const PRECISION: usize = Fallback::<F>::PRECISION;
-    const MAX_EXP: ExpInt = F::MAX_EXP as ExpInt;
-}
-
-impl<F: Float> From<Fallback<F>> for DoubleFloat<F>
-where
-    F: FloatConvert<FallbackExtended<F>>,
-    FallbackExtended<F>: FloatConvert<F>,
-{
-    fn from(x: Fallback<F>) -> Self {
-        let mut status;
-        let mut loses_info = false;
-
-        let extended: FallbackExtended<F> = unpack!(status=, x.convert(&mut loses_info));
-        assert_eq!((status, loses_info), (Status::OK, false));
-
-        let a = unpack!(status=, extended.convert(&mut loses_info));
-        assert_eq!(status - Status::INEXACT, Status::OK);
-
-        // If conversion was exact or resulted in a special case, we're done;
-        // just set the second double to zero. Otherwise, re-convert back to
-        // the extended format and compute the difference. This now should
-        // convert exactly to double.
-        let b = if a.is_finite_non_zero() && loses_info {
-            let u: FallbackExtended<F> = unpack!(status=, a.convert(&mut loses_info));
-            assert_eq!((status, loses_info), (Status::OK, false));
-            let v = unpack!(status=, extended - u);
-            assert_eq!(status, Status::OK);
-            let v = unpack!(status=, v.convert(&mut loses_info));
-            assert_eq!((status, loses_info), (Status::OK, false));
-            v
-        } else {
-            F::ZERO
-        };
-
-        DoubleFloat(a, b)
-    }
-}
-
-impl<F: FloatConvert<Self>> From<DoubleFloat<F>> for Fallback<F> {
-    fn from(DoubleFloat(a, b): DoubleFloat<F>) -> Self {
-        let mut status;
-        let mut loses_info = false;
-
-        // Get the first F and convert to our format.
-        let a = unpack!(status=, a.convert(&mut loses_info));
-        assert_eq!((status, loses_info), (Status::OK, false));
-
-        // Unless we have a special case, add in second F.
-        if a.is_finite_non_zero() {
-            let b = unpack!(status=, b.convert(&mut loses_info));
-            assert_eq!((status, loses_info), (Status::OK, false));
-
-            (a + b).value
-        } else {
-            a
-        }
-    }
-}
-
-float_common_impls!(DoubleFloat<F>);
-
-impl<F: Float> Neg for DoubleFloat<F> {
-    type Output = Self;
-    fn neg(self) -> Self {
-        if self.1.is_finite_non_zero() {
-            DoubleFloat(-self.0, -self.1)
-        } else {
-            DoubleFloat(-self.0, self.1)
-        }
-    }
-}
-
-impl<F: FloatConvert<Fallback<F>>> fmt::Display for DoubleFloat<F> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        fmt::Display::fmt(&Fallback::from(*self), f)
-    }
-}
-
-impl<F: FloatConvert<Fallback<F>>> Float for DoubleFloat<F>
-where
-    Self: From<Fallback<F>>,
-{
-    const BITS: usize = F::BITS * 2;
-    const PRECISION: usize = Fallback::<F>::PRECISION;
-    const MAX_EXP: ExpInt = Fallback::<F>::MAX_EXP;
-    const MIN_EXP: ExpInt = Fallback::<F>::MIN_EXP;
-
-    const ZERO: Self = DoubleFloat(F::ZERO, F::ZERO);
-
-    const INFINITY: Self = DoubleFloat(F::INFINITY, F::ZERO);
-
-    // FIXME(eddyb) remove when qnan becomes const fn.
-    const NAN: Self = DoubleFloat(F::NAN, F::ZERO);
-
-    fn qnan(payload: Option<u128>) -> Self {
-        DoubleFloat(F::qnan(payload), F::ZERO)
-    }
-
-    fn snan(payload: Option<u128>) -> Self {
-        DoubleFloat(F::snan(payload), F::ZERO)
-    }
-
-    fn largest() -> Self {
-        let status;
-        let mut r = DoubleFloat(F::largest(), F::largest());
-        r.1 = r.1.scalbn(-(F::PRECISION as ExpInt + 1));
-        r.1 = unpack!(status=, r.1.next_down());
-        assert_eq!(status, Status::OK);
-        r
-    }
-
-    const SMALLEST: Self = DoubleFloat(F::SMALLEST, F::ZERO);
-
-    fn smallest_normalized() -> Self {
-        DoubleFloat(F::smallest_normalized().scalbn(F::PRECISION as ExpInt), F::ZERO)
-    }
-
-    // Implement addition, subtraction, multiplication and division based on:
-    // "Software for Doubled-Precision Floating-Point Computations",
-    // by Seppo Linnainmaa, ACM TOMS vol 7 no 3, September 1981, pages 272-283.
-
-    fn add_r(mut self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        match (self.category(), rhs.category()) {
-            (Category::Infinity, Category::Infinity) => {
-                if self.is_negative() != rhs.is_negative() {
-                    Status::INVALID_OP.and(Self::NAN.copy_sign(self))
-                } else {
-                    Status::OK.and(self)
-                }
-            }
-
-            (_, Category::Zero) | (Category::NaN, _) | (Category::Infinity, Category::Normal) => {
-                Status::OK.and(self)
-            }
-
-            (Category::Zero, _) | (_, Category::NaN | Category::Infinity) => Status::OK.and(rhs),
-
-            (Category::Normal, Category::Normal) => {
-                let mut status = Status::OK;
-                let (a, aa, c, cc) = (self.0, self.1, rhs.0, rhs.1);
-                let mut z = a;
-                z = unpack!(status|=, z.add_r(c, round));
-                if !z.is_finite() {
-                    if !z.is_infinite() {
-                        return status.and(DoubleFloat(z, F::ZERO));
-                    }
-                    status = Status::OK;
-                    let a_cmp_c = a.cmp_abs_normal(c);
-                    z = cc;
-                    z = unpack!(status|=, z.add_r(aa, round));
-                    if a_cmp_c == Ordering::Greater {
-                        // z = cc + aa + c + a;
-                        z = unpack!(status|=, z.add_r(c, round));
-                        z = unpack!(status|=, z.add_r(a, round));
-                    } else {
-                        // z = cc + aa + a + c;
-                        z = unpack!(status|=, z.add_r(a, round));
-                        z = unpack!(status|=, z.add_r(c, round));
-                    }
-                    if !z.is_finite() {
-                        return status.and(DoubleFloat(z, F::ZERO));
-                    }
-                    self.0 = z;
-                    let mut zz = aa;
-                    zz = unpack!(status|=, zz.add_r(cc, round));
-                    if a_cmp_c == Ordering::Greater {
-                        // self.1 = a - z + c + zz;
-                        self.1 = a;
-                        self.1 = unpack!(status|=, self.1.sub_r(z, round));
-                        self.1 = unpack!(status|=, self.1.add_r(c, round));
-                        self.1 = unpack!(status|=, self.1.add_r(zz, round));
-                    } else {
-                        // self.1 = c - z + a + zz;
-                        self.1 = c;
-                        self.1 = unpack!(status|=, self.1.sub_r(z, round));
-                        self.1 = unpack!(status|=, self.1.add_r(a, round));
-                        self.1 = unpack!(status|=, self.1.add_r(zz, round));
-                    }
-                } else {
-                    // q = a - z;
-                    let mut q = a;
-                    q = unpack!(status|=, q.sub_r(z, round));
-
-                    // zz = q + c + (a - (q + z)) + aa + cc;
-                    // Compute a - (q + z) as -((q + z) - a) to avoid temporary copies.
-                    let mut zz = q;
-                    zz = unpack!(status|=, zz.add_r(c, round));
-                    q = unpack!(status|=, q.add_r(z, round));
-                    q = unpack!(status|=, q.sub_r(a, round));
-                    q = -q;
-                    zz = unpack!(status|=, zz.add_r(q, round));
-                    zz = unpack!(status|=, zz.add_r(aa, round));
-                    zz = unpack!(status|=, zz.add_r(cc, round));
-                    if zz.is_zero() && !zz.is_negative() {
-                        return Status::OK.and(DoubleFloat(z, F::ZERO));
-                    }
-                    self.0 = z;
-                    self.0 = unpack!(status|=, self.0.add_r(zz, round));
-                    if !self.0.is_finite() {
-                        self.1 = F::ZERO;
-                        return status.and(self);
-                    }
-                    self.1 = z;
-                    self.1 = unpack!(status|=, self.1.sub_r(self.0, round));
-                    self.1 = unpack!(status|=, self.1.add_r(zz, round));
-                }
-                status.and(self)
-            }
-        }
-    }
-
-    fn mul_r(mut self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        // Interesting observation: For special categories, finding the lowest
-        // common ancestor of the following layered graph gives the correct
-        // return category:
-        //
-        //    NaN
-        //   /   \
-        // Zero  Inf
-        //   \   /
-        //   Normal
-        //
-        // e.g., NaN * NaN = NaN
-        //      Zero * Inf = NaN
-        //      Normal * Zero = Zero
-        //      Normal * Inf = Inf
-        match (self.category(), rhs.category()) {
-            (Category::NaN, _) => Status::OK.and(self),
-
-            (_, Category::NaN) => Status::OK.and(rhs),
-
-            (Category::Zero, Category::Infinity) | (Category::Infinity, Category::Zero) => {
-                Status::OK.and(Self::NAN)
-            }
-
-            (Category::Zero | Category::Infinity, _) => Status::OK.and(self),
-
-            (_, Category::Zero | Category::Infinity) => Status::OK.and(rhs),
-
-            (Category::Normal, Category::Normal) => {
-                let mut status = Status::OK;
-                let (a, b, c, d) = (self.0, self.1, rhs.0, rhs.1);
-                // t = a * c
-                let mut t = a;
-                t = unpack!(status|=, t.mul_r(c, round));
-                if !t.is_finite_non_zero() {
-                    return status.and(DoubleFloat(t, F::ZERO));
-                }
-
-                // tau = fmsub(a, c, t), that is -fmadd(-a, c, t).
-                let mut tau = a;
-                tau = unpack!(status|=, tau.mul_add_r(c, -t, round));
-                // v = a * d
-                let mut v = a;
-                v = unpack!(status|=, v.mul_r(d, round));
-                // w = b * c
-                let mut w = b;
-                w = unpack!(status|=, w.mul_r(c, round));
-                v = unpack!(status|=, v.add_r(w, round));
-                // tau += v + w
-                tau = unpack!(status|=, tau.add_r(v, round));
-                // u = t + tau
-                let mut u = t;
-                u = unpack!(status|=, u.add_r(tau, round));
-
-                self.0 = u;
-                if !u.is_finite() {
-                    self.1 = F::ZERO;
-                } else {
-                    // self.1 = (t - u) + tau
-                    t = unpack!(status|=, t.sub_r(u, round));
-                    t = unpack!(status|=, t.add_r(tau, round));
-                    self.1 = t;
-                }
-                status.and(self)
-            }
-        }
-    }
-
-    fn mul_add_r(self, multiplicand: Self, addend: Self, round: Round) -> StatusAnd<Self> {
-        Fallback::from(self)
-            .mul_add_r(Fallback::from(multiplicand), Fallback::from(addend), round)
-            .map(Self::from)
-    }
-
-    fn div_r(self, rhs: Self, round: Round) -> StatusAnd<Self> {
-        Fallback::from(self).div_r(Fallback::from(rhs), round).map(Self::from)
-    }
-
-    fn c_fmod(self, rhs: Self) -> StatusAnd<Self> {
-        Fallback::from(self).c_fmod(Fallback::from(rhs)).map(Self::from)
-    }
-
-    fn round_to_integral(self, round: Round) -> StatusAnd<Self> {
-        Fallback::from(self).round_to_integral(round).map(Self::from)
-    }
-
-    fn next_up(self) -> StatusAnd<Self> {
-        Fallback::from(self).next_up().map(Self::from)
-    }
-
-    fn from_bits(input: u128) -> Self {
-        let (a, b) = (input, input >> F::BITS);
-        DoubleFloat(F::from_bits(a & ((1 << F::BITS) - 1)), F::from_bits(b & ((1 << F::BITS) - 1)))
-    }
-
-    fn from_u128_r(input: u128, round: Round) -> StatusAnd<Self> {
-        Fallback::from_u128_r(input, round).map(Self::from)
-    }
-
-    fn from_str_r(s: &str, round: Round) -> Result<StatusAnd<Self>, ParseError> {
-        Fallback::from_str_r(s, round).map(|r| r.map(Self::from))
-    }
-
-    fn to_bits(self) -> u128 {
-        self.0.to_bits() | (self.1.to_bits() << F::BITS)
-    }
-
-    fn to_u128_r(self, width: usize, round: Round, is_exact: &mut bool) -> StatusAnd<u128> {
-        Fallback::from(self).to_u128_r(width, round, is_exact)
-    }
-
-    fn cmp_abs_normal(self, rhs: Self) -> Ordering {
-        self.0.cmp_abs_normal(rhs.0).then_with(|| {
-            let result = self.1.cmp_abs_normal(rhs.1);
-            if result != Ordering::Equal {
-                let against = self.0.is_negative() ^ self.1.is_negative();
-                let rhs_against = rhs.0.is_negative() ^ rhs.1.is_negative();
-                (!against)
-                    .cmp(&!rhs_against)
-                    .then_with(|| if against { result.reverse() } else { result })
-            } else {
-                result
-            }
-        })
-    }
-
-    fn bitwise_eq(self, rhs: Self) -> bool {
-        self.0.bitwise_eq(rhs.0) && self.1.bitwise_eq(rhs.1)
-    }
-
-    fn is_negative(self) -> bool {
-        self.0.is_negative()
-    }
-
-    fn is_denormal(self) -> bool {
-        self.category() == Category::Normal
-            && (self.0.is_denormal() || self.0.is_denormal() ||
-          // (double)(Hi + Lo) == Hi defines a normal number.
-          !(self.0 + self.1).value.bitwise_eq(self.0))
-    }
-
-    fn is_signaling(self) -> bool {
-        self.0.is_signaling()
-    }
-
-    fn category(self) -> Category {
-        self.0.category()
-    }
-
-    fn get_exact_inverse(self) -> Option<Self> {
-        Fallback::from(self).get_exact_inverse().map(Self::from)
-    }
-
-    fn ilogb(self) -> ExpInt {
-        self.0.ilogb()
-    }
-
-    fn scalbn_r(self, exp: ExpInt, round: Round) -> Self {
-        DoubleFloat(self.0.scalbn_r(exp, round), self.1.scalbn_r(exp, round))
-    }
-
-    fn frexp_r(self, exp: &mut ExpInt, round: Round) -> Self {
-        let a = self.0.frexp_r(exp, round);
-        let mut b = self.1;
-        if self.category() == Category::Normal {
-            b = b.scalbn_r(-*exp, round);
-        }
-        DoubleFloat(a, b)
-    }
-}
diff --git a/compiler/rustc_apfloat/tests/ieee.rs b/compiler/rustc_apfloat/tests/ieee.rs
deleted file mode 100644
index f8fac0c2358..00000000000
--- a/compiler/rustc_apfloat/tests/ieee.rs
+++ /dev/null
@@ -1,3301 +0,0 @@
-// ignore-tidy-filelength
-
-use rustc_apfloat::ieee::{Double, Half, Quad, Single, X87DoubleExtended};
-use rustc_apfloat::unpack;
-use rustc_apfloat::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
-use rustc_apfloat::{Float, FloatConvert, ParseError, Round, Status};
-
-trait SingleExt {
-    fn from_f32(input: f32) -> Self;
-    fn to_f32(self) -> f32;
-}
-
-impl SingleExt for Single {
-    fn from_f32(input: f32) -> Self {
-        Self::from_bits(input.to_bits() as u128)
-    }
-
-    fn to_f32(self) -> f32 {
-        f32::from_bits(self.to_bits() as u32)
-    }
-}
-
-trait DoubleExt {
-    fn from_f64(input: f64) -> Self;
-    fn to_f64(self) -> f64;
-}
-
-impl DoubleExt for Double {
-    fn from_f64(input: f64) -> Self {
-        Self::from_bits(input.to_bits() as u128)
-    }
-
-    fn to_f64(self) -> f64 {
-        f64::from_bits(self.to_bits() as u64)
-    }
-}
-
-#[test]
-fn is_signaling() {
-    // We test qNaN, -qNaN, +sNaN, -sNaN with and without payloads.
-    let payload = 4;
-    assert!(!Single::qnan(None).is_signaling());
-    assert!(!(-Single::qnan(None)).is_signaling());
-    assert!(!Single::qnan(Some(payload)).is_signaling());
-    assert!(!(-Single::qnan(Some(payload))).is_signaling());
-    assert!(Single::snan(None).is_signaling());
-    assert!((-Single::snan(None)).is_signaling());
-    assert!(Single::snan(Some(payload)).is_signaling());
-    assert!((-Single::snan(Some(payload))).is_signaling());
-}
-
-#[test]
-fn next() {
-    // 1. Test Special Cases Values.
-    //
-    // Test all special values for nextUp and nextDown perscribed by IEEE-754R
-    // 2008. These are:
-    //   1. +inf
-    //   2. -inf
-    //   3. largest
-    //   4. -largest
-    //   5. smallest
-    //   6. -smallest
-    //   7. qNaN
-    //   8. sNaN
-    //   9. +0
-    //   10. -0
-
-    let mut status;
-
-    // nextUp(+inf) = +inf.
-    let test = unpack!(status=, Quad::INFINITY.next_up());
-    let expected = Quad::INFINITY;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_infinite());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+inf) = -nextUp(-inf) = -(-largest) = largest
-    let test = unpack!(status=, Quad::INFINITY.next_down());
-    let expected = Quad::largest();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-inf) = -largest
-    let test = unpack!(status=, (-Quad::INFINITY).next_up());
-    let expected = -Quad::largest();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-inf) = -nextUp(+inf) = -(+inf) = -inf.
-    let test = unpack!(status=, (-Quad::INFINITY).next_down());
-    let expected = -Quad::INFINITY;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_infinite() && test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(largest) = +inf
-    let test = unpack!(status=, Quad::largest().next_up());
-    let expected = Quad::INFINITY;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_infinite() && !test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(largest) = -nextUp(-largest)
-    //                        = -(-largest + inc)
-    //                        = largest - inc.
-    let test = unpack!(status=, Quad::largest().next_down());
-    let expected = "0x1.fffffffffffffffffffffffffffep+16383".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_infinite() && !test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-largest) = -largest + inc.
-    let test = unpack!(status=, (-Quad::largest()).next_up());
-    let expected = "-0x1.fffffffffffffffffffffffffffep+16383".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-largest) = -nextUp(largest) = -(inf) = -inf.
-    let test = unpack!(status=, (-Quad::largest()).next_down());
-    let expected = -Quad::INFINITY;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_infinite() && test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(smallest) = smallest + inc.
-    let test = unpack!(status=, "0x0.0000000000000000000000000001p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x0.0000000000000000000000000002p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(smallest) = -nextUp(-smallest) = -(-0) = +0.
-    let test = unpack!(status=, "0x0.0000000000000000000000000001p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = Quad::ZERO;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_pos_zero());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-smallest) = -0.
-    let test = unpack!(status=, "-0x0.0000000000000000000000000001p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = -Quad::ZERO;
-    assert_eq!(status, Status::OK);
-    assert!(test.is_neg_zero());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-smallest) = -nextUp(smallest) = -smallest - inc.
-    let test = unpack!(status=, "-0x0.0000000000000000000000000001p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x0.0000000000000000000000000002p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(qNaN) = qNaN
-    let test = unpack!(status=, Quad::qnan(None).next_up());
-    let expected = Quad::qnan(None);
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(qNaN) = qNaN
-    let test = unpack!(status=, Quad::qnan(None).next_down());
-    let expected = Quad::qnan(None);
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(sNaN) = qNaN
-    let test = unpack!(status=, Quad::snan(None).next_up());
-    let expected = Quad::qnan(None);
-    assert_eq!(status, Status::INVALID_OP);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(sNaN) = qNaN
-    let test = unpack!(status=, Quad::snan(None).next_down());
-    let expected = Quad::qnan(None);
-    assert_eq!(status, Status::INVALID_OP);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(+0) = +smallest
-    let test = unpack!(status=, Quad::ZERO.next_up());
-    let expected = Quad::SMALLEST;
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+0) = -nextUp(-0) = -smallest
-    let test = unpack!(status=, Quad::ZERO.next_down());
-    let expected = -Quad::SMALLEST;
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-0) = +smallest
-    let test = unpack!(status=, (-Quad::ZERO).next_up());
-    let expected = Quad::SMALLEST;
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-0) = -nextUp(0) = -smallest
-    let test = unpack!(status=, (-Quad::ZERO).next_down());
-    let expected = -Quad::SMALLEST;
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // 2. Binade Boundary Tests.
-
-    // 2a. Test denormal <-> normal binade boundaries.
-    //     * nextUp(+Largest Denormal) -> +Smallest Normal.
-    //     * nextDown(-Largest Denormal) -> -Smallest Normal.
-    //     * nextUp(-Smallest Normal) -> -Largest Denormal.
-    //     * nextDown(+Smallest Normal) -> +Largest Denormal.
-
-    // nextUp(+Largest Denormal) -> +Smallest Normal.
-    let test = unpack!(status=, "0x0.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x1.0000000000000000000000000000p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-Largest Denormal) -> -Smallest Normal.
-    let test = unpack!(status=, "-0x0.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x1.0000000000000000000000000000p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-Smallest Normal) -> -Largest Denormal.
-    let test = unpack!(status=, "-0x1.0000000000000000000000000000p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "-0x0.ffffffffffffffffffffffffffffp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+Smallest Normal) -> +Largest Denormal.
-    let test = unpack!(status=, "+0x1.0000000000000000000000000000p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "+0x0.ffffffffffffffffffffffffffffp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    // 2b. Test normal <-> normal binade boundaries.
-    //     * nextUp(-Normal Binade Boundary) -> -Normal Binade Boundary + 1.
-    //     * nextDown(+Normal Binade Boundary) -> +Normal Binade Boundary - 1.
-    //     * nextUp(+Normal Binade Boundary - 1) -> +Normal Binade Boundary.
-    //     * nextDown(-Normal Binade Boundary + 1) -> -Normal Binade Boundary.
-
-    // nextUp(-Normal Binade Boundary) -> -Normal Binade Boundary + 1.
-    let test = unpack!(status=, "-0x1p+1".parse::<Quad>().unwrap().next_up());
-    let expected = "-0x1.ffffffffffffffffffffffffffffp+0".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+Normal Binade Boundary) -> +Normal Binade Boundary - 1.
-    let test = unpack!(status=, "0x1p+1".parse::<Quad>().unwrap().next_down());
-    let expected = "0x1.ffffffffffffffffffffffffffffp+0".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(+Normal Binade Boundary - 1) -> +Normal Binade Boundary.
-    let test = unpack!(status=, "0x1.ffffffffffffffffffffffffffffp+0"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x1p+1".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-Normal Binade Boundary + 1) -> -Normal Binade Boundary.
-    let test = unpack!(status=, "-0x1.ffffffffffffffffffffffffffffp+0"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x1p+1".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // 2c. Test using next at binade boundaries with a direction away from the
-    // binade boundary. Away from denormal <-> normal boundaries.
-    //
-    // This is to make sure that even though we are at a binade boundary, since
-    // we are rounding away, we do not trigger the binade boundary code. Thus we
-    // test:
-    //   * nextUp(-Largest Denormal) -> -Largest Denormal + inc.
-    //   * nextDown(+Largest Denormal) -> +Largest Denormal - inc.
-    //   * nextUp(+Smallest Normal) -> +Smallest Normal + inc.
-    //   * nextDown(-Smallest Normal) -> -Smallest Normal - inc.
-
-    // nextUp(-Largest Denormal) -> -Largest Denormal + inc.
-    let test = unpack!(status=, "-0x0.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "-0x0.fffffffffffffffffffffffffffep-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+Largest Denormal) -> +Largest Denormal - inc.
-    let test = unpack!(status=, "0x0.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "0x0.fffffffffffffffffffffffffffep-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(+Smallest Normal) -> +Smallest Normal + inc.
-    let test = unpack!(status=, "0x1.0000000000000000000000000000p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x1.0000000000000000000000000001p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-Smallest Normal) -> -Smallest Normal - inc.
-    let test = unpack!(status=, "-0x1.0000000000000000000000000000p-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x1.0000000000000000000000000001p-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // 2d. Test values which cause our exponent to go to min exponent. This
-    // is to ensure that guards in the code to check for min exponent
-    // trigger properly.
-    //     * nextUp(-0x1p-16381) -> -0x1.ffffffffffffffffffffffffffffp-16382
-    //     * nextDown(-0x1.ffffffffffffffffffffffffffffp-16382) ->
-    //         -0x1p-16381
-    //     * nextUp(0x1.ffffffffffffffffffffffffffffp-16382) -> 0x1p-16382
-    //     * nextDown(0x1p-16382) -> 0x1.ffffffffffffffffffffffffffffp-16382
-
-    // nextUp(-0x1p-16381) -> -0x1.ffffffffffffffffffffffffffffp-16382
-    let test = unpack!(status=, "-0x1p-16381".parse::<Quad>().unwrap().next_up());
-    let expected = "-0x1.ffffffffffffffffffffffffffffp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-0x1.ffffffffffffffffffffffffffffp-16382) ->
-    //         -0x1p-16381
-    let test = unpack!(status=, "-0x1.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x1p-16381".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(0x1.ffffffffffffffffffffffffffffp-16382) -> 0x1p-16381
-    let test = unpack!(status=, "0x1.ffffffffffffffffffffffffffffp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x1p-16381".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(0x1p-16381) -> 0x1.ffffffffffffffffffffffffffffp-16382
-    let test = unpack!(status=, "0x1p-16381".parse::<Quad>().unwrap().next_down());
-    let expected = "0x1.ffffffffffffffffffffffffffffp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.bitwise_eq(expected));
-
-    // 3. Now we test both denormal/normal computation which will not cause us
-    // to go across binade boundaries. Specifically we test:
-    //   * nextUp(+Denormal) -> +Denormal.
-    //   * nextDown(+Denormal) -> +Denormal.
-    //   * nextUp(-Denormal) -> -Denormal.
-    //   * nextDown(-Denormal) -> -Denormal.
-    //   * nextUp(+Normal) -> +Normal.
-    //   * nextDown(+Normal) -> +Normal.
-    //   * nextUp(-Normal) -> -Normal.
-    //   * nextDown(-Normal) -> -Normal.
-
-    // nextUp(+Denormal) -> +Denormal.
-    let test = unpack!(status=, "0x0.ffffffffffffffffffffffff000cp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x0.ffffffffffffffffffffffff000dp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+Denormal) -> +Denormal.
-    let test = unpack!(status=, "0x0.ffffffffffffffffffffffff000cp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "0x0.ffffffffffffffffffffffff000bp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-Denormal) -> -Denormal.
-    let test = unpack!(status=, "-0x0.ffffffffffffffffffffffff000cp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "-0x0.ffffffffffffffffffffffff000bp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-Denormal) -> -Denormal
-    let test = unpack!(status=, "-0x0.ffffffffffffffffffffffff000cp-16382"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x0.ffffffffffffffffffffffff000dp-16382".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(+Normal) -> +Normal.
-    let test = unpack!(status=, "0x1.ffffffffffffffffffffffff000cp-16000"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "0x1.ffffffffffffffffffffffff000dp-16000".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(+Normal) -> +Normal.
-    let test = unpack!(status=, "0x1.ffffffffffffffffffffffff000cp-16000"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "0x1.ffffffffffffffffffffffff000bp-16000".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextUp(-Normal) -> -Normal.
-    let test = unpack!(status=, "-0x1.ffffffffffffffffffffffff000cp-16000"
-        .parse::<Quad>()
-        .unwrap()
-        .next_up());
-    let expected = "-0x1.ffffffffffffffffffffffff000bp-16000".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-
-    // nextDown(-Normal) -> -Normal.
-    let test = unpack!(status=, "-0x1.ffffffffffffffffffffffff000cp-16000"
-        .parse::<Quad>()
-        .unwrap()
-        .next_down());
-    let expected = "-0x1.ffffffffffffffffffffffff000dp-16000".parse::<Quad>().unwrap();
-    assert_eq!(status, Status::OK);
-    assert!(!test.is_denormal());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-}
-
-#[test]
-fn fma() {
-    {
-        let mut f1 = Single::from_f32(14.5);
-        let f2 = Single::from_f32(-14.5);
-        let f3 = Single::from_f32(225.0);
-        f1 = f1.mul_add(f2, f3).value;
-        assert_eq!(14.75, f1.to_f32());
-    }
-
-    {
-        let val2 = Single::from_f32(2.0);
-        let mut f1 = Single::from_f32(1.17549435e-38);
-        let mut f2 = Single::from_f32(1.17549435e-38);
-        f1 /= val2;
-        f2 /= val2;
-        let f3 = Single::from_f32(12.0);
-        f1 = f1.mul_add(f2, f3).value;
-        assert_eq!(12.0, f1.to_f32());
-    }
-
-    // Test for correct zero sign when answer is exactly zero.
-    // fma(1.0, -1.0, 1.0) -> +ve 0.
-    {
-        let mut f1 = Double::from_f64(1.0);
-        let f2 = Double::from_f64(-1.0);
-        let f3 = Double::from_f64(1.0);
-        f1 = f1.mul_add(f2, f3).value;
-        assert!(!f1.is_negative() && f1.is_zero());
-    }
-
-    // Test for correct zero sign when answer is exactly zero and rounding towards
-    // negative.
-    // fma(1.0, -1.0, 1.0) -> +ve 0.
-    {
-        let mut f1 = Double::from_f64(1.0);
-        let f2 = Double::from_f64(-1.0);
-        let f3 = Double::from_f64(1.0);
-        f1 = f1.mul_add_r(f2, f3, Round::TowardNegative).value;
-        assert!(f1.is_negative() && f1.is_zero());
-    }
-
-    // Test for correct (in this case -ve) sign when adding like signed zeros.
-    // Test fma(0.0, -0.0, -0.0) -> -ve 0.
-    {
-        let mut f1 = Double::from_f64(0.0);
-        let f2 = Double::from_f64(-0.0);
-        let f3 = Double::from_f64(-0.0);
-        f1 = f1.mul_add(f2, f3).value;
-        assert!(f1.is_negative() && f1.is_zero());
-    }
-
-    // Test -ve sign preservation when small negative results underflow.
-    {
-        let mut f1 = "-0x1p-1074".parse::<Double>().unwrap();
-        let f2 = "+0x1p-1074".parse::<Double>().unwrap();
-        let f3 = Double::from_f64(0.0);
-        f1 = f1.mul_add(f2, f3).value;
-        assert!(f1.is_negative() && f1.is_zero());
-    }
-
-    // Test x87 extended precision case from https://llvm.org/PR20728.
-    {
-        let mut m1 = X87DoubleExtended::from_u128(1).value;
-        let m2 = X87DoubleExtended::from_u128(1).value;
-        let a = X87DoubleExtended::from_u128(3).value;
-
-        let mut loses_info = false;
-        m1 = m1.mul_add(m2, a).value;
-        let r: Single = m1.convert(&mut loses_info).value;
-        assert!(!loses_info);
-        assert_eq!(4.0, r.to_f32());
-    }
-}
-
-#[test]
-fn issue_69532() {
-    let f = Double::from_bits(0x7FF0_0000_0000_0001u64 as u128);
-    let mut loses_info = false;
-    let sta = f.convert(&mut loses_info);
-    let r: Single = sta.value;
-    assert!(loses_info);
-    assert!(r.is_nan());
-    assert_eq!(sta.status, Status::INVALID_OP);
-}
-
-#[test]
-fn min_num() {
-    let f1 = Double::from_f64(1.0);
-    let f2 = Double::from_f64(2.0);
-    let nan = Double::NAN;
-
-    assert_eq!(1.0, f1.min(f2).to_f64());
-    assert_eq!(1.0, f2.min(f1).to_f64());
-    assert_eq!(1.0, f1.min(nan).to_f64());
-    assert_eq!(1.0, nan.min(f1).to_f64());
-}
-
-#[test]
-fn max_num() {
-    let f1 = Double::from_f64(1.0);
-    let f2 = Double::from_f64(2.0);
-    let nan = Double::NAN;
-
-    assert_eq!(2.0, f1.max(f2).to_f64());
-    assert_eq!(2.0, f2.max(f1).to_f64());
-    assert_eq!(1.0, f1.max(nan).to_f64());
-    assert_eq!(1.0, nan.max(f1).to_f64());
-}
-
-#[test]
-fn denormal() {
-    // Test single precision
-    {
-        assert!(!Single::from_f32(0.0).is_denormal());
-
-        let mut t = "1.17549435082228750797e-38".parse::<Single>().unwrap();
-        assert!(!t.is_denormal());
-
-        let val2 = Single::from_f32(2.0e0);
-        t /= val2;
-        assert!(t.is_denormal());
-    }
-
-    // Test double precision
-    {
-        assert!(!Double::from_f64(0.0).is_denormal());
-
-        let mut t = "2.22507385850720138309e-308".parse::<Double>().unwrap();
-        assert!(!t.is_denormal());
-
-        let val2 = Double::from_f64(2.0e0);
-        t /= val2;
-        assert!(t.is_denormal());
-    }
-
-    // Test Intel double-ext
-    {
-        assert!(!X87DoubleExtended::from_u128(0).value.is_denormal());
-
-        let mut t = "3.36210314311209350626e-4932".parse::<X87DoubleExtended>().unwrap();
-        assert!(!t.is_denormal());
-
-        t /= X87DoubleExtended::from_u128(2).value;
-        assert!(t.is_denormal());
-    }
-
-    // Test quadruple precision
-    {
-        assert!(!Quad::from_u128(0).value.is_denormal());
-
-        let mut t = "3.36210314311209350626267781732175260e-4932".parse::<Quad>().unwrap();
-        assert!(!t.is_denormal());
-
-        t /= Quad::from_u128(2).value;
-        assert!(t.is_denormal());
-    }
-}
-
-#[test]
-fn decimal_strings_without_null_terminators() {
-    // Make sure that we can parse strings without null terminators.
-    // rdar://14323230.
-    let val = "0.00"[..3].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.0);
-    let val = "0.01"[..3].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.0);
-    let val = "0.09"[..3].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.0);
-    let val = "0.095"[..4].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.09);
-    let val = "0.00e+3"[..7].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.00);
-    let val = "0e+3"[..4].parse::<Double>().unwrap();
-    assert_eq!(val.to_f64(), 0.00);
-}
-
-#[test]
-fn from_zero_decimal_string() {
-    assert_eq!(0.0, "0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, ".0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+.0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-.0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "00000.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+00000.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-00000.".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, ".00000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+.00000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-.00000".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0000.00000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0000.00000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0000.00000".parse::<Double>().unwrap().to_f64());
-}
-
-#[test]
-fn from_zero_decimal_single_exponent_string() {
-    assert_eq!(0.0, "0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.e1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.e+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.e-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, ".0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+.0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-.0e1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, ".0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+.0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-.0e+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, ".0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+.0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-.0e-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.0e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.0e1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.0e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.0e+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0.0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0.0e-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0.0e-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "000.0000e1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+000.0000e+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-000.0000e+1".parse::<Double>().unwrap().to_f64());
-}
-
-#[test]
-fn from_zero_decimal_large_exponent_string() {
-    assert_eq!(0.0, "0e1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e1234".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0e+1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e+1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e+1234".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0e-1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0e-1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0e-1234".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "000.0000e1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "000.0000e-1234".parse::<Double>().unwrap().to_f64());
-}
-
-#[test]
-fn from_zero_hexadecimal_string() {
-    assert_eq!(0.0, "0x0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x.0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x.0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x.0p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x.0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x.0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x.0p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x.0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x.0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x.0p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.0p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.0p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.0p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.0p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x0.0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "+0x0.0p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0.0p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.0, "0x00000.p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x0000.00000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x.00000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x0.p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x0p1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.0, "-0x0p1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x00000.p1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x0000.00000p1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x.00000p1234".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.0, "0x0.p1234".parse::<Double>().unwrap().to_f64());
-}
-
-#[test]
-fn from_decimal_string() {
-    assert_eq!(1.0, "1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0, "2.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.5, ".5".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.0, "1.0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-2.0, "-2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-4.0, "-4.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.5, "-.5".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-1.5, "-1.5".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.25e12, "1.25e12".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.25e+12, "1.25e+12".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.25e-12, "1.25e-12".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1024.0, "1024.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1024.05, "1024.05000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.05, ".05000".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0, "2.".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0e2, "2.e2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0e+2, "2.e+2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0e-2, "2.e-2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e2, "002.05000e2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e+2, "002.05000e+2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e-2, "002.05000e-2".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e12, "002.05000e12".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e+12, "002.05000e+12".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.05e-12, "002.05000e-12".parse::<Double>().unwrap().to_f64());
-
-    // These are "carefully selected" to overflow the fast log-base
-    // calculations in the implementation.
-    assert!("99e99999".parse::<Double>().unwrap().is_infinite());
-    assert!("-99e99999".parse::<Double>().unwrap().is_infinite());
-    assert!("1e-99999".parse::<Double>().unwrap().is_pos_zero());
-    assert!("-1e-99999".parse::<Double>().unwrap().is_neg_zero());
-
-    assert_eq!(2.71828, "2.71828".parse::<Double>().unwrap().to_f64());
-}
-
-#[test]
-fn from_hexadecimal_string() {
-    assert_eq!(1.0, "0x1p0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.0, "+0x1p0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-1.0, "-0x1p0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(1.0, "0x1p+0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.0, "+0x1p+0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-1.0, "-0x1p+0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(1.0, "0x1p-0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.0, "+0x1p-0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-1.0, "-0x1p-0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(2.0, "0x1p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0, "+0x1p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-2.0, "-0x1p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(2.0, "0x1p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2.0, "+0x1p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-2.0, "-0x1p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.5, "0x1p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.5, "+0x1p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.5, "-0x1p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(3.0, "0x1.8p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(3.0, "+0x1.8p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-3.0, "-0x1.8p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(3.0, "0x1.8p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(3.0, "+0x1.8p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-3.0, "-0x1.8p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.75, "0x1.8p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.75, "+0x1.8p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.75, "-0x1.8p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(8192.0, "0x1000.000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(8192.0, "+0x1000.000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-8192.0, "-0x1000.000p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(8192.0, "0x1000.000p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(8192.0, "+0x1000.000p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-8192.0, "-0x1000.000p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(2048.0, "0x1000.000p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2048.0, "+0x1000.000p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-2048.0, "-0x1000.000p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(8192.0, "0x1000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(8192.0, "+0x1000p1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-8192.0, "-0x1000p1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(8192.0, "0x1000p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(8192.0, "+0x1000p+1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-8192.0, "-0x1000p+1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(2048.0, "0x1000p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(2048.0, "+0x1000p-1".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-2048.0, "-0x1000p-1".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(16384.0, "0x10p10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(16384.0, "+0x10p10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-16384.0, "-0x10p10".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(16384.0, "0x10p+10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(16384.0, "+0x10p+10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-16384.0, "-0x10p+10".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(0.015625, "0x10p-10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(0.015625, "+0x10p-10".parse::<Double>().unwrap().to_f64());
-    assert_eq!(-0.015625, "-0x10p-10".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(1.0625, "0x1.1p0".parse::<Double>().unwrap().to_f64());
-    assert_eq!(1.0, "0x1p0".parse::<Double>().unwrap().to_f64());
-
-    assert_eq!(
-        "0x1p-150".parse::<Double>().unwrap().to_f64(),
-        "+0x800000000000000001.p-221".parse::<Double>().unwrap().to_f64()
-    );
-    assert_eq!(
-        2251799813685248.5,
-        "0x80000000000004000000.010p-28".parse::<Double>().unwrap().to_f64()
-    );
-}
-
-#[test]
-fn to_string() {
-    let to_string = |d: f64, precision: usize, width: usize| {
-        let x = Double::from_f64(d);
-        if precision == 0 {
-            format!("{:1$}", x, width)
-        } else {
-            format!("{:2$.1$}", x, precision, width)
-        }
-    };
-    assert_eq!("10", to_string(10.0, 6, 3));
-    assert_eq!("1.0E+1", to_string(10.0, 6, 0));
-    assert_eq!("10100", to_string(1.01E+4, 5, 2));
-    assert_eq!("1.01E+4", to_string(1.01E+4, 4, 2));
-    assert_eq!("1.01E+4", to_string(1.01E+4, 5, 1));
-    assert_eq!("0.0101", to_string(1.01E-2, 5, 2));
-    assert_eq!("0.0101", to_string(1.01E-2, 4, 2));
-    assert_eq!("1.01E-2", to_string(1.01E-2, 5, 1));
-    assert_eq!("0.78539816339744828", to_string(0.78539816339744830961, 0, 3));
-    assert_eq!("4.9406564584124654E-324", to_string(4.9406564584124654e-324, 0, 3));
-    assert_eq!("873.18340000000001", to_string(873.1834, 0, 1));
-    assert_eq!("8.7318340000000001E+2", to_string(873.1834, 0, 0));
-    assert_eq!("1.7976931348623157E+308", to_string(1.7976931348623157E+308, 0, 0));
-
-    let to_string = |d: f64, precision: usize, width: usize| {
-        let x = Double::from_f64(d);
-        if precision == 0 {
-            format!("{:#1$}", x, width)
-        } else {
-            format!("{:#2$.1$}", x, precision, width)
-        }
-    };
-    assert_eq!("10", to_string(10.0, 6, 3));
-    assert_eq!("1.000000e+01", to_string(10.0, 6, 0));
-    assert_eq!("10100", to_string(1.01E+4, 5, 2));
-    assert_eq!("1.0100e+04", to_string(1.01E+4, 4, 2));
-    assert_eq!("1.01000e+04", to_string(1.01E+4, 5, 1));
-    assert_eq!("0.0101", to_string(1.01E-2, 5, 2));
-    assert_eq!("0.0101", to_string(1.01E-2, 4, 2));
-    assert_eq!("1.01000e-02", to_string(1.01E-2, 5, 1));
-    assert_eq!("0.78539816339744828", to_string(0.78539816339744830961, 0, 3));
-    assert_eq!("4.94065645841246540e-324", to_string(4.9406564584124654e-324, 0, 3));
-    assert_eq!("873.18340000000001", to_string(873.1834, 0, 1));
-    assert_eq!("8.73183400000000010e+02", to_string(873.1834, 0, 0));
-    assert_eq!("1.79769313486231570e+308", to_string(1.7976931348623157E+308, 0, 0));
-}
-
-#[test]
-fn to_integer() {
-    let mut is_exact = false;
-
-    assert_eq!(
-        Status::OK.and(10),
-        "10".parse::<Double>().unwrap().to_u128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(is_exact);
-
-    assert_eq!(
-        Status::INVALID_OP.and(0),
-        "-10".parse::<Double>().unwrap().to_u128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(!is_exact);
-
-    assert_eq!(
-        Status::INVALID_OP.and(31),
-        "32".parse::<Double>().unwrap().to_u128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(!is_exact);
-
-    assert_eq!(
-        Status::INEXACT.and(7),
-        "7.9".parse::<Double>().unwrap().to_u128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(!is_exact);
-
-    assert_eq!(
-        Status::OK.and(-10),
-        "-10".parse::<Double>().unwrap().to_i128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(is_exact);
-
-    assert_eq!(
-        Status::INVALID_OP.and(-16),
-        "-17".parse::<Double>().unwrap().to_i128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(!is_exact);
-
-    assert_eq!(
-        Status::INVALID_OP.and(15),
-        "16".parse::<Double>().unwrap().to_i128_r(5, Round::TowardZero, &mut is_exact,)
-    );
-    assert!(!is_exact);
-}
-
-#[test]
-fn nan() {
-    fn nanbits<T: Float>(signaling: bool, negative: bool, fill: u128) -> u128 {
-        let x = if signaling { T::snan(Some(fill)) } else { T::qnan(Some(fill)) };
-        if negative { (-x).to_bits() } else { x.to_bits() }
-    }
-
-    assert_eq!(0x7fc00000, nanbits::<Single>(false, false, 0));
-    assert_eq!(0xffc00000, nanbits::<Single>(false, true, 0));
-    assert_eq!(0x7fc0ae72, nanbits::<Single>(false, false, 0xae72));
-    assert_eq!(0x7fffae72, nanbits::<Single>(false, false, 0xffffae72));
-    assert_eq!(0x7fa00000, nanbits::<Single>(true, false, 0));
-    assert_eq!(0xffa00000, nanbits::<Single>(true, true, 0));
-    assert_eq!(0x7f80ae72, nanbits::<Single>(true, false, 0xae72));
-    assert_eq!(0x7fbfae72, nanbits::<Single>(true, false, 0xffffae72));
-
-    assert_eq!(0x7ff8000000000000, nanbits::<Double>(false, false, 0));
-    assert_eq!(0xfff8000000000000, nanbits::<Double>(false, true, 0));
-    assert_eq!(0x7ff800000000ae72, nanbits::<Double>(false, false, 0xae72));
-    assert_eq!(0x7fffffffffffae72, nanbits::<Double>(false, false, 0xffffffffffffae72));
-    assert_eq!(0x7ff4000000000000, nanbits::<Double>(true, false, 0));
-    assert_eq!(0xfff4000000000000, nanbits::<Double>(true, true, 0));
-    assert_eq!(0x7ff000000000ae72, nanbits::<Double>(true, false, 0xae72));
-    assert_eq!(0x7ff7ffffffffae72, nanbits::<Double>(true, false, 0xffffffffffffae72));
-}
-
-#[test]
-fn string_decimal_death() {
-    assert_eq!("".parse::<Double>(), Err(ParseError("Invalid string length")));
-    assert_eq!("+".parse::<Double>(), Err(ParseError("String has no digits")));
-    assert_eq!("-".parse::<Double>(), Err(ParseError("String has no digits")));
-
-    assert_eq!("\0".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("1\0".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("1\02".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("1\02e1".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("1e\0".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-    assert_eq!("1e1\0".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-    assert_eq!("1e1\02".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-
-    assert_eq!("1.0f".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-
-    assert_eq!("..".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-    assert_eq!("..0".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-    assert_eq!("1.0.0".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-}
-
-#[test]
-fn string_decimal_significand_death() {
-    assert_eq!(".".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+.".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-.".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!(".e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+.e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-.e1".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!(".e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+.e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-.e".parse::<Double>(), Err(ParseError("Significand has no digits")));
-}
-
-#[test]
-fn string_decimal_exponent_death() {
-    assert_eq!("1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("1.e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+1.e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-1.e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!(".1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+.1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-.1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("1.1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+1.1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-1.1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("1e+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("1e-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!(".1e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!(".1e+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!(".1e-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("1.0e".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("1.0e+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("1.0e-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-}
-
-#[test]
-fn string_hexadecimal_death() {
-    assert_eq!("0x".parse::<Double>(), Err(ParseError("Invalid string")));
-    assert_eq!("+0x".parse::<Double>(), Err(ParseError("Invalid string")));
-    assert_eq!("-0x".parse::<Double>(), Err(ParseError("Invalid string")));
-
-    assert_eq!("0x0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("+0x0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("-0x0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-
-    assert_eq!("0x0.".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("+0x0.".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("-0x0.".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-
-    assert_eq!("0x.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("+0x.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("-0x.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-
-    assert_eq!("0x0.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("+0x0.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-    assert_eq!("-0x0.0".parse::<Double>(), Err(ParseError("Hex strings require an exponent")));
-
-    assert_eq!("0x\0".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("0x1\0".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("0x1\02".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("0x1\02p1".parse::<Double>(), Err(ParseError("Invalid character in significand")));
-    assert_eq!("0x1p\0".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-    assert_eq!("0x1p1\0".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-    assert_eq!("0x1p1\02".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-
-    assert_eq!("0x1p0f".parse::<Double>(), Err(ParseError("Invalid character in exponent")));
-
-    assert_eq!("0x..p1".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-    assert_eq!("0x..0p1".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-    assert_eq!("0x1.0.0p1".parse::<Double>(), Err(ParseError("String contains multiple dots")));
-}
-
-#[test]
-fn string_hexadecimal_significand_death() {
-    assert_eq!("0x.".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0x.".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0x.".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0xp".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0xp".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0xp".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0xp+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0xp+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0xp+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0xp-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0xp-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0xp-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0x.p".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0x.p".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0x.p".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0x.p+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0x.p+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0x.p+".parse::<Double>(), Err(ParseError("Significand has no digits")));
-
-    assert_eq!("0x.p-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("+0x.p-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-    assert_eq!("-0x.p-".parse::<Double>(), Err(ParseError("Significand has no digits")));
-}
-
-#[test]
-fn string_hexadecimal_exponent_death() {
-    assert_eq!("0x1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.1p".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.1p+".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-
-    assert_eq!("0x1.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("+0x1.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-    assert_eq!("-0x1.1p-".parse::<Double>(), Err(ParseError("Exponent has no digits")));
-}
-
-#[test]
-fn exact_inverse() {
-    // Trivial operation.
-    assert!(Double::from_f64(2.0).get_exact_inverse().unwrap().bitwise_eq(Double::from_f64(0.5)));
-    assert!(Single::from_f32(2.0).get_exact_inverse().unwrap().bitwise_eq(Single::from_f32(0.5)));
-    assert!(
-        "2.0"
-            .parse::<Quad>()
-            .unwrap()
-            .get_exact_inverse()
-            .unwrap()
-            .bitwise_eq("0.5".parse::<Quad>().unwrap())
-    );
-    assert!(
-        "2.0"
-            .parse::<X87DoubleExtended>()
-            .unwrap()
-            .get_exact_inverse()
-            .unwrap()
-            .bitwise_eq("0.5".parse::<X87DoubleExtended>().unwrap())
-    );
-
-    // FLT_MIN
-    assert!(
-        Single::from_f32(1.17549435e-38)
-            .get_exact_inverse()
-            .unwrap()
-            .bitwise_eq(Single::from_f32(8.5070592e+37))
-    );
-
-    // Large float, inverse is a denormal.
-    assert!(Single::from_f32(1.7014118e38).get_exact_inverse().is_none());
-    // Zero
-    assert!(Double::from_f64(0.0).get_exact_inverse().is_none());
-    // Denormalized float
-    assert!(Single::from_f32(1.40129846e-45).get_exact_inverse().is_none());
-}
-
-#[test]
-fn round_to_integral() {
-    let t = Double::from_f64(-0.5);
-    assert_eq!(-0.0, t.round_to_integral(Round::TowardZero).value.to_f64());
-    assert_eq!(-1.0, t.round_to_integral(Round::TowardNegative).value.to_f64());
-    assert_eq!(-0.0, t.round_to_integral(Round::TowardPositive).value.to_f64());
-    assert_eq!(-0.0, t.round_to_integral(Round::NearestTiesToEven).value.to_f64());
-
-    let s = Double::from_f64(3.14);
-    assert_eq!(3.0, s.round_to_integral(Round::TowardZero).value.to_f64());
-    assert_eq!(3.0, s.round_to_integral(Round::TowardNegative).value.to_f64());
-    assert_eq!(4.0, s.round_to_integral(Round::TowardPositive).value.to_f64());
-    assert_eq!(3.0, s.round_to_integral(Round::NearestTiesToEven).value.to_f64());
-
-    let r = Double::largest();
-    assert_eq!(r.to_f64(), r.round_to_integral(Round::TowardZero).value.to_f64());
-    assert_eq!(r.to_f64(), r.round_to_integral(Round::TowardNegative).value.to_f64());
-    assert_eq!(r.to_f64(), r.round_to_integral(Round::TowardPositive).value.to_f64());
-    assert_eq!(r.to_f64(), r.round_to_integral(Round::NearestTiesToEven).value.to_f64());
-
-    let p = Double::ZERO.round_to_integral(Round::TowardZero).value;
-    assert_eq!(0.0, p.to_f64());
-    let p = (-Double::ZERO).round_to_integral(Round::TowardZero).value;
-    assert_eq!(-0.0, p.to_f64());
-    let p = Double::NAN.round_to_integral(Round::TowardZero).value;
-    assert!(p.to_f64().is_nan());
-    let p = Double::INFINITY.round_to_integral(Round::TowardZero).value;
-    assert!(p.to_f64().is_infinite() && p.to_f64() > 0.0);
-    let p = (-Double::INFINITY).round_to_integral(Round::TowardZero).value;
-    assert!(p.to_f64().is_infinite() && p.to_f64() < 0.0);
-}
-
-#[test]
-fn is_integer() {
-    let t = Double::from_f64(-0.0);
-    assert!(t.is_integer());
-    let t = Double::from_f64(3.14159);
-    assert!(!t.is_integer());
-    let t = Double::NAN;
-    assert!(!t.is_integer());
-    let t = Double::INFINITY;
-    assert!(!t.is_integer());
-    let t = -Double::INFINITY;
-    assert!(!t.is_integer());
-    let t = Double::largest();
-    assert!(t.is_integer());
-}
-
-#[test]
-fn largest() {
-    assert_eq!(3.402823466e+38, Single::largest().to_f32());
-    assert_eq!(1.7976931348623158e+308, Double::largest().to_f64());
-}
-
-#[test]
-fn smallest() {
-    let test = Single::SMALLEST;
-    let expected = "0x0.000002p-126".parse::<Single>().unwrap();
-    assert!(!test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = -Single::SMALLEST;
-    let expected = "-0x0.000002p-126".parse::<Single>().unwrap();
-    assert!(test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = Quad::SMALLEST;
-    let expected = "0x0.0000000000000000000000000001p-16382".parse::<Quad>().unwrap();
-    assert!(!test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = -Quad::SMALLEST;
-    let expected = "-0x0.0000000000000000000000000001p-16382".parse::<Quad>().unwrap();
-    assert!(test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-}
-
-#[test]
-fn smallest_normalized() {
-    let test = Single::smallest_normalized();
-    let expected = "0x1p-126".parse::<Single>().unwrap();
-    assert!(!test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = -Single::smallest_normalized();
-    let expected = "-0x1p-126".parse::<Single>().unwrap();
-    assert!(test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = Quad::smallest_normalized();
-    let expected = "0x1p-16382".parse::<Quad>().unwrap();
-    assert!(!test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-
-    let test = -Quad::smallest_normalized();
-    let expected = "-0x1p-16382".parse::<Quad>().unwrap();
-    assert!(test.is_negative());
-    assert!(test.is_finite_non_zero());
-    assert!(!test.is_denormal());
-    assert!(test.bitwise_eq(expected));
-}
-
-#[test]
-fn zero() {
-    assert_eq!(0.0, Single::from_f32(0.0).to_f32());
-    assert_eq!(-0.0, Single::from_f32(-0.0).to_f32());
-    assert!(Single::from_f32(-0.0).is_negative());
-
-    assert_eq!(0.0, Double::from_f64(0.0).to_f64());
-    assert_eq!(-0.0, Double::from_f64(-0.0).to_f64());
-    assert!(Double::from_f64(-0.0).is_negative());
-
-    fn test<T: Float>(sign: bool, bits: u128) {
-        let test = if sign { -T::ZERO } else { T::ZERO };
-        let pattern = if sign { "-0x0p+0" } else { "0x0p+0" };
-        let expected = pattern.parse::<T>().unwrap();
-        assert!(test.is_zero());
-        assert_eq!(sign, test.is_negative());
-        assert!(test.bitwise_eq(expected));
-        assert_eq!(bits, test.to_bits());
-    }
-    test::<Half>(false, 0);
-    test::<Half>(true, 0x8000);
-    test::<Single>(false, 0);
-    test::<Single>(true, 0x80000000);
-    test::<Double>(false, 0);
-    test::<Double>(true, 0x8000000000000000);
-    test::<Quad>(false, 0);
-    test::<Quad>(true, 0x8000000000000000_0000000000000000);
-    test::<X87DoubleExtended>(false, 0);
-    test::<X87DoubleExtended>(true, 0x8000_0000000000000000);
-}
-
-#[test]
-fn copy_sign() {
-    assert!(
-        Double::from_f64(-42.0)
-            .bitwise_eq(Double::from_f64(42.0).copy_sign(Double::from_f64(-1.0),),)
-    );
-    assert!(
-        Double::from_f64(42.0)
-            .bitwise_eq(Double::from_f64(-42.0).copy_sign(Double::from_f64(1.0),),)
-    );
-    assert!(
-        Double::from_f64(-42.0)
-            .bitwise_eq(Double::from_f64(-42.0).copy_sign(Double::from_f64(-1.0),),)
-    );
-    assert!(
-        Double::from_f64(42.0)
-            .bitwise_eq(Double::from_f64(42.0).copy_sign(Double::from_f64(1.0),),)
-    );
-}
-
-#[test]
-fn convert() {
-    let mut loses_info = false;
-    let test = "1.0".parse::<Double>().unwrap();
-    let test: Single = test.convert(&mut loses_info).value;
-    assert_eq!(1.0, test.to_f32());
-    assert!(!loses_info);
-
-    let mut test = "0x1p-53".parse::<X87DoubleExtended>().unwrap();
-    let one = "1.0".parse::<X87DoubleExtended>().unwrap();
-    test += one;
-    let test: Double = test.convert(&mut loses_info).value;
-    assert_eq!(1.0, test.to_f64());
-    assert!(loses_info);
-
-    let mut test = "0x1p-53".parse::<Quad>().unwrap();
-    let one = "1.0".parse::<Quad>().unwrap();
-    test += one;
-    let test: Double = test.convert(&mut loses_info).value;
-    assert_eq!(1.0, test.to_f64());
-    assert!(loses_info);
-
-    let test = "0xf.fffffffp+28".parse::<X87DoubleExtended>().unwrap();
-    let test: Double = test.convert(&mut loses_info).value;
-    assert_eq!(4294967295.0, test.to_f64());
-    assert!(!loses_info);
-
-    let test = Single::qnan(None);
-    let x87_qnan = X87DoubleExtended::qnan(None);
-    let test: X87DoubleExtended = test.convert(&mut loses_info).value;
-    assert!(test.bitwise_eq(x87_qnan));
-    assert!(!loses_info);
-
-    let test = Single::snan(None);
-    let sta = test.convert(&mut loses_info);
-    let test: X87DoubleExtended = sta.value;
-    assert!(test.is_nan());
-    assert!(!test.is_signaling());
-    assert!(!loses_info);
-    assert_eq!(sta.status, Status::INVALID_OP);
-
-    let test = X87DoubleExtended::qnan(None);
-    let test: X87DoubleExtended = test.convert(&mut loses_info).value;
-    assert!(test.bitwise_eq(x87_qnan));
-    assert!(!loses_info);
-
-    let test = X87DoubleExtended::snan(None);
-    let sta = test.convert(&mut loses_info);
-    let test: X87DoubleExtended = sta.value;
-    assert!(test.is_nan());
-    assert!(!test.is_signaling());
-    assert!(!loses_info);
-    assert_eq!(sta.status, Status::INVALID_OP);
-}
-
-#[test]
-fn is_negative() {
-    let t = "0x1p+0".parse::<Single>().unwrap();
-    assert!(!t.is_negative());
-    let t = "-0x1p+0".parse::<Single>().unwrap();
-    assert!(t.is_negative());
-
-    assert!(!Single::INFINITY.is_negative());
-    assert!((-Single::INFINITY).is_negative());
-
-    assert!(!Single::ZERO.is_negative());
-    assert!((-Single::ZERO).is_negative());
-
-    assert!(!Single::NAN.is_negative());
-    assert!((-Single::NAN).is_negative());
-
-    assert!(!Single::snan(None).is_negative());
-    assert!((-Single::snan(None)).is_negative());
-}
-
-#[test]
-fn is_normal() {
-    let t = "0x1p+0".parse::<Single>().unwrap();
-    assert!(t.is_normal());
-
-    assert!(!Single::INFINITY.is_normal());
-    assert!(!Single::ZERO.is_normal());
-    assert!(!Single::NAN.is_normal());
-    assert!(!Single::snan(None).is_normal());
-    assert!(!"0x1p-149".parse::<Single>().unwrap().is_normal());
-}
-
-#[test]
-fn is_finite() {
-    let t = "0x1p+0".parse::<Single>().unwrap();
-    assert!(t.is_finite());
-    assert!(!Single::INFINITY.is_finite());
-    assert!(Single::ZERO.is_finite());
-    assert!(!Single::NAN.is_finite());
-    assert!(!Single::snan(None).is_finite());
-    assert!("0x1p-149".parse::<Single>().unwrap().is_finite());
-}
-
-#[test]
-fn is_infinite() {
-    let t = "0x1p+0".parse::<Single>().unwrap();
-    assert!(!t.is_infinite());
-    assert!(Single::INFINITY.is_infinite());
-    assert!(!Single::ZERO.is_infinite());
-    assert!(!Single::NAN.is_infinite());
-    assert!(!Single::snan(None).is_infinite());
-    assert!(!"0x1p-149".parse::<Single>().unwrap().is_infinite());
-}
-
-#[test]
-fn is_nan() {
-    let t = "0x1p+0".parse::<Single>().unwrap();
-    assert!(!t.is_nan());
-    assert!(!Single::INFINITY.is_nan());
-    assert!(!Single::ZERO.is_nan());
-    assert!(Single::NAN.is_nan());
-    assert!(Single::snan(None).is_nan());
-    assert!(!"0x1p-149".parse::<Single>().unwrap().is_nan());
-}
-
-#[test]
-fn is_finite_non_zero() {
-    // Test positive/negative normal value.
-    assert!("0x1p+0".parse::<Single>().unwrap().is_finite_non_zero());
-    assert!("-0x1p+0".parse::<Single>().unwrap().is_finite_non_zero());
-
-    // Test positive/negative denormal value.
-    assert!("0x1p-149".parse::<Single>().unwrap().is_finite_non_zero());
-    assert!("-0x1p-149".parse::<Single>().unwrap().is_finite_non_zero());
-
-    // Test +/- Infinity.
-    assert!(!Single::INFINITY.is_finite_non_zero());
-    assert!(!(-Single::INFINITY).is_finite_non_zero());
-
-    // Test +/- Zero.
-    assert!(!Single::ZERO.is_finite_non_zero());
-    assert!(!(-Single::ZERO).is_finite_non_zero());
-
-    // Test +/- qNaN. +/- don't mean anything with qNaN but paranoia can't hurt in
-    // this instance.
-    assert!(!Single::NAN.is_finite_non_zero());
-    assert!(!(-Single::NAN).is_finite_non_zero());
-
-    // Test +/- sNaN. +/- don't mean anything with sNaN but paranoia can't hurt in
-    // this instance.
-    assert!(!Single::snan(None).is_finite_non_zero());
-    assert!(!(-Single::snan(None)).is_finite_non_zero());
-}
-
-#[test]
-fn add() {
-    // Test Special Cases against each other and normal values.
-
-    // FIXMES/NOTES:
-    // 1. Since we perform only default exception handling all operations with
-    // signaling NaNs should have a result that is a quiet NaN. Currently they
-    // return sNaN.
-
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let qnan = Single::NAN;
-    let p_normal_value = "0x1p+0".parse::<Single>().unwrap();
-    let m_normal_value = "-0x1p+0".parse::<Single>().unwrap();
-    let p_largest_value = Single::largest();
-    let m_largest_value = -Single::largest();
-    let p_smallest_value = Single::SMALLEST;
-    let m_smallest_value = -Single::SMALLEST;
-    let p_smallest_normalized = Single::smallest_normalized();
-    let m_smallest_normalized = -Single::smallest_normalized();
-
-    let overflow_status = Status::OVERFLOW | Status::INEXACT;
-
-    let special_cases = [
-        (p_inf, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, p_zero, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_zero, "inf", Status::OK, Category::Infinity),
-        (p_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_inf, p_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_zero, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_zero, "-inf", Status::OK, Category::Infinity),
-        (m_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_inf, p_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (p_zero, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_zero, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_zero, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_zero, p_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_zero, m_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_zero, p_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_zero, m_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_zero, p_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (p_zero, m_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (p_zero, p_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (p_zero, m_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (m_zero, p_inf, "inf", Status::OK, Category::Infinity),
-        (m_zero, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_zero, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_zero, p_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_zero, m_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_zero, p_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_zero, m_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_zero, p_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (m_zero, m_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (m_zero, p_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (m_zero, m_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (qnan, p_inf, "nan", Status::OK, Category::NaN),
-        (qnan, m_inf, "nan", Status::OK, Category::NaN),
-        (qnan, p_zero, "nan", Status::OK, Category::NaN),
-        (qnan, m_zero, "nan", Status::OK, Category::NaN),
-        (qnan, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (qnan, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (qnan, p_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_normalized, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_normalized, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (snan, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, qnan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, snan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_normal_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_normal_value, p_zero, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, m_zero, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_normal_value, "0x1p+1", Status::OK, Category::Normal),
-        (p_normal_value, m_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, p_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_normal_value, p_smallest_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_smallest_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, p_smallest_normalized, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_smallest_normalized, "0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (m_normal_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_normal_value, p_zero, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, m_zero, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_normal_value, p_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, m_normal_value, "-0x1p+1", Status::OK, Category::Normal),
-        (m_normal_value, p_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_smallest_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_smallest_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_smallest_normalized, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_smallest_normalized, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (p_largest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_largest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_largest_value, p_zero, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, m_zero, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_largest_value, p_normal_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, m_normal_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, p_largest_value, "inf", overflow_status, Category::Infinity),
-        (p_largest_value, m_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, p_smallest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, m_smallest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (
-            p_largest_value,
-            p_smallest_normalized,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            p_largest_value,
-            m_smallest_normalized,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (m_largest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (m_largest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_largest_value, p_zero, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, m_zero, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_largest_value, p_normal_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, m_normal_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, p_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, m_largest_value, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, p_smallest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, m_smallest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (
-            m_largest_value,
-            p_smallest_normalized,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            m_largest_value,
-            m_smallest_normalized,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (p_smallest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_value, p_zero, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, m_zero, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_value, p_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_value, m_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_value, p_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_smallest_value, m_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_smallest_value, p_smallest_value, "0x1p-148", Status::OK, Category::Normal),
-        (p_smallest_value, m_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, p_smallest_normalized, "0x1.000002p-126", Status::OK, Category::Normal),
-        (p_smallest_value, m_smallest_normalized, "-0x1.fffffcp-127", Status::OK, Category::Normal),
-        (m_smallest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_value, p_zero, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, m_zero, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_value, p_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_value, m_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_value, p_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_smallest_value, m_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_smallest_value, p_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, m_smallest_value, "-0x1p-148", Status::OK, Category::Normal),
-        (m_smallest_value, p_smallest_normalized, "0x1.fffffcp-127", Status::OK, Category::Normal),
-        (m_smallest_value, m_smallest_normalized, "-0x1.000002p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, p_zero, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_zero, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_normalized, p_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_normalized, m_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (
-            p_smallest_normalized,
-            p_largest_value,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            p_smallest_normalized,
-            m_largest_value,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (p_smallest_normalized, p_smallest_value, "0x1.000002p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_smallest_value, "0x1.fffffcp-127", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_smallest_normalized, "0x1p-125", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, p_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, m_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, p_zero, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_zero, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_normalized, p_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_normalized, m_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (
-            m_smallest_normalized,
-            p_largest_value,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            m_smallest_normalized,
-            m_largest_value,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (m_smallest_normalized, p_smallest_value, "-0x1.fffffcp-127", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_smallest_value, "-0x1.000002p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, m_smallest_normalized, "-0x1p-125", Status::OK, Category::Normal),
-    ];
-
-    for (x, y, e_result, e_status, e_category) in special_cases {
-        let status;
-        let result = unpack!(status=, x + y);
-        assert_eq!(status, e_status);
-        assert_eq!(result.category(), e_category);
-        assert!(result.bitwise_eq(e_result.parse::<Single>().unwrap()));
-    }
-}
-
-#[test]
-fn subtract() {
-    // Test Special Cases against each other and normal values.
-
-    // FIXMES/NOTES:
-    // 1. Since we perform only default exception handling all operations with
-    // signaling NaNs should have a result that is a quiet NaN. Currently they
-    // return sNaN.
-
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let qnan = Single::NAN;
-    let p_normal_value = "0x1p+0".parse::<Single>().unwrap();
-    let m_normal_value = "-0x1p+0".parse::<Single>().unwrap();
-    let p_largest_value = Single::largest();
-    let m_largest_value = -Single::largest();
-    let p_smallest_value = Single::SMALLEST;
-    let m_smallest_value = -Single::SMALLEST;
-    let p_smallest_normalized = Single::smallest_normalized();
-    let m_smallest_normalized = -Single::smallest_normalized();
-
-    let overflow_status = Status::OVERFLOW | Status::INEXACT;
-
-    let special_cases = [
-        (p_inf, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_zero, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_zero, "inf", Status::OK, Category::Infinity),
-        (p_inf, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_inf, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_inf, p_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, p_zero, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_zero, "-inf", Status::OK, Category::Infinity),
-        (m_inf, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_inf, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_inf, p_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (p_zero, p_inf, "-inf", Status::OK, Category::Infinity),
-        (p_zero, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_zero, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_zero, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_zero, p_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_zero, m_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_zero, p_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_zero, m_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_zero, p_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (p_zero, m_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (p_zero, p_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (p_zero, m_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (m_zero, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_zero, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_zero, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_zero, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_zero, p_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_zero, m_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_zero, p_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_zero, m_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_zero, p_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (m_zero, m_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (m_zero, p_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (m_zero, m_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (qnan, p_inf, "nan", Status::OK, Category::NaN),
-        (qnan, m_inf, "nan", Status::OK, Category::NaN),
-        (qnan, p_zero, "nan", Status::OK, Category::NaN),
-        (qnan, m_zero, "nan", Status::OK, Category::NaN),
-        (qnan, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (qnan, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (qnan, p_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_normalized, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_normalized, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (snan, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, qnan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, snan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (p_normal_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_normal_value, p_zero, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, m_zero, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_normal_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, m_normal_value, "0x1p+1", Status::OK, Category::Normal),
-        (p_normal_value, p_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_normal_value, p_smallest_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_smallest_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, p_smallest_normalized, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_normal_value, m_smallest_normalized, "0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_normal_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_normal_value, p_zero, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, m_zero, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_normal_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_normal_value, p_normal_value, "-0x1p+1", Status::OK, Category::Normal),
-        (m_normal_value, m_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, p_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_smallest_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_smallest_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, p_smallest_normalized, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_normal_value, m_smallest_normalized, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (p_largest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (p_largest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_largest_value, p_zero, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, m_zero, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_largest_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_largest_value, p_normal_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, m_normal_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, p_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, m_largest_value, "inf", overflow_status, Category::Infinity),
-        (p_largest_value, p_smallest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_largest_value, m_smallest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (
-            p_largest_value,
-            p_smallest_normalized,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            p_largest_value,
-            m_smallest_normalized,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (m_largest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_largest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_largest_value, p_zero, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, m_zero, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_largest_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_largest_value, p_normal_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, m_normal_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, p_largest_value, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, m_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, p_smallest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_largest_value, m_smallest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (
-            m_largest_value,
-            p_smallest_normalized,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            m_largest_value,
-            m_smallest_normalized,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (p_smallest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_value, p_zero, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, m_zero, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_value, p_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_value, m_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_value, p_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_smallest_value, m_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (p_smallest_value, p_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, m_smallest_value, "0x1p-148", Status::OK, Category::Normal),
-        (p_smallest_value, p_smallest_normalized, "-0x1.fffffcp-127", Status::OK, Category::Normal),
-        (p_smallest_value, m_smallest_normalized, "0x1.000002p-126", Status::OK, Category::Normal),
-        (m_smallest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_value, p_zero, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, m_zero, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_value, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_value, p_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_value, m_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_value, p_largest_value, "-0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_smallest_value, m_largest_value, "0x1.fffffep+127", Status::INEXACT, Category::Normal),
-        (m_smallest_value, p_smallest_value, "-0x1p-148", Status::OK, Category::Normal),
-        (m_smallest_value, m_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, p_smallest_normalized, "-0x1.000002p-126", Status::OK, Category::Normal),
-        (m_smallest_value, m_smallest_normalized, "0x1.fffffcp-127", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, m_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, p_zero, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_zero, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_normalized, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_normalized, p_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (p_smallest_normalized, m_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (
-            p_smallest_normalized,
-            p_largest_value,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            p_smallest_normalized,
-            m_largest_value,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (p_smallest_normalized, p_smallest_value, "0x1.fffffcp-127", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_smallest_value, "0x1.000002p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_normalized, m_smallest_normalized, "0x1p-125", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, p_zero, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_zero, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, qnan, "-nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_normalized, snan, "-nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_normalized, p_normal_value, "-0x1p+0", Status::INEXACT, Category::Normal),
-        (m_smallest_normalized, m_normal_value, "0x1p+0", Status::INEXACT, Category::Normal),
-        (
-            m_smallest_normalized,
-            p_largest_value,
-            "-0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (
-            m_smallest_normalized,
-            m_largest_value,
-            "0x1.fffffep+127",
-            Status::INEXACT,
-            Category::Normal,
-        ),
-        (m_smallest_normalized, p_smallest_value, "-0x1.000002p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_smallest_value, "-0x1.fffffcp-127", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_smallest_normalized, "-0x1p-125", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-    ];
-
-    for (x, y, e_result, e_status, e_category) in special_cases {
-        let status;
-        let result = unpack!(status=, x - y);
-        assert_eq!(status, e_status);
-        assert_eq!(result.category(), e_category);
-        assert!(result.bitwise_eq(e_result.parse::<Single>().unwrap()));
-    }
-}
-
-#[test]
-fn multiply() {
-    // Test Special Cases against each other and normal values.
-
-    // FIXMES/NOTES:
-    // 1. Since we perform only default exception handling all operations with
-    // signaling NaNs should have a result that is a quiet NaN. Currently they
-    // return sNaN.
-
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let qnan = Single::NAN;
-    let p_normal_value = "0x1p+0".parse::<Single>().unwrap();
-    let m_normal_value = "-0x1p+0".parse::<Single>().unwrap();
-    let p_largest_value = Single::largest();
-    let m_largest_value = -Single::largest();
-    let p_smallest_value = Single::SMALLEST;
-    let m_smallest_value = -Single::SMALLEST;
-    let p_smallest_normalized = Single::smallest_normalized();
-    let m_smallest_normalized = -Single::smallest_normalized();
-
-    let overflow_status = Status::OVERFLOW | Status::INEXACT;
-    let underflow_status = Status::UNDERFLOW | Status::INEXACT;
-
-    let special_cases = [
-        (p_inf, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_inf, p_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_normal_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_largest_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_inf, p_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_normal_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_largest_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_zero, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_zero, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_zero, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_zero, p_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_normal_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_largest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_smallest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_smallest_normalized, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_zero, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_zero, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_zero, p_normal_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_largest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_smallest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_smallest_normalized, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (qnan, p_inf, "nan", Status::OK, Category::NaN),
-        (qnan, m_inf, "nan", Status::OK, Category::NaN),
-        (qnan, p_zero, "nan", Status::OK, Category::NaN),
-        (qnan, m_zero, "nan", Status::OK, Category::NaN),
-        (qnan, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (qnan, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (qnan, p_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_normalized, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_normalized, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (snan, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, qnan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, snan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_normal_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_normal_value, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, m_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, p_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_normal_value, m_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_normal_value, p_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (p_normal_value, m_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (p_normal_value, p_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (p_normal_value, m_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (m_normal_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_normal_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_normal_value, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_normal_value, p_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, m_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, p_largest_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_normal_value, m_largest_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_normal_value, p_smallest_value, "-0x1p-149", Status::OK, Category::Normal),
-        (m_normal_value, m_smallest_value, "0x1p-149", Status::OK, Category::Normal),
-        (m_normal_value, p_smallest_normalized, "-0x1p-126", Status::OK, Category::Normal),
-        (m_normal_value, m_smallest_normalized, "0x1p-126", Status::OK, Category::Normal),
-        (p_largest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_largest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_largest_value, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_largest_value, p_normal_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, m_normal_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, p_largest_value, "inf", overflow_status, Category::Infinity),
-        (p_largest_value, m_largest_value, "-inf", overflow_status, Category::Infinity),
-        (p_largest_value, p_smallest_value, "0x1.fffffep-22", Status::OK, Category::Normal),
-        (p_largest_value, m_smallest_value, "-0x1.fffffep-22", Status::OK, Category::Normal),
-        (p_largest_value, p_smallest_normalized, "0x1.fffffep+1", Status::OK, Category::Normal),
-        (p_largest_value, m_smallest_normalized, "-0x1.fffffep+1", Status::OK, Category::Normal),
-        (m_largest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_largest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_largest_value, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_largest_value, p_normal_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, m_normal_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, p_largest_value, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, m_largest_value, "inf", overflow_status, Category::Infinity),
-        (m_largest_value, p_smallest_value, "-0x1.fffffep-22", Status::OK, Category::Normal),
-        (m_largest_value, m_smallest_value, "0x1.fffffep-22", Status::OK, Category::Normal),
-        (m_largest_value, p_smallest_normalized, "-0x1.fffffep+1", Status::OK, Category::Normal),
-        (m_largest_value, m_smallest_normalized, "0x1.fffffep+1", Status::OK, Category::Normal),
-        (p_smallest_value, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_value, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_value, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_value, p_normal_value, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, m_normal_value, "-0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, p_largest_value, "0x1.fffffep-22", Status::OK, Category::Normal),
-        (p_smallest_value, m_largest_value, "-0x1.fffffep-22", Status::OK, Category::Normal),
-        (p_smallest_value, p_smallest_value, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_value, m_smallest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_value, p_smallest_normalized, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_value, m_smallest_normalized, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_value, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_value, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_value, p_normal_value, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, m_normal_value, "0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, p_largest_value, "-0x1.fffffep-22", Status::OK, Category::Normal),
-        (m_smallest_value, m_largest_value, "0x1.fffffep-22", Status::OK, Category::Normal),
-        (m_smallest_value, p_smallest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, m_smallest_value, "0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, p_smallest_normalized, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, m_smallest_normalized, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, p_inf, "inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, m_inf, "-inf", Status::OK, Category::Infinity),
-        (p_smallest_normalized, p_zero, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_normalized, m_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_normalized, p_normal_value, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_normal_value, "-0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_largest_value, "0x1.fffffep+1", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_largest_value, "-0x1.fffffep+1", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_smallest_value, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, m_smallest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, p_smallest_normalized, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, m_smallest_normalized, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, p_inf, "-inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, m_inf, "inf", Status::OK, Category::Infinity),
-        (m_smallest_normalized, p_zero, "-0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, m_zero, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_normalized, p_normal_value, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_normal_value, "0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_largest_value, "-0x1.fffffep+1", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_largest_value, "0x1.fffffep+1", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_smallest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, m_smallest_value, "0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, p_smallest_normalized, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, m_smallest_normalized, "0x0p+0", underflow_status, Category::Zero),
-    ];
-
-    for (x, y, e_result, e_status, e_category) in special_cases {
-        let status;
-        let result = unpack!(status=, x * y);
-        assert_eq!(status, e_status);
-        assert_eq!(result.category(), e_category);
-        assert!(result.bitwise_eq(e_result.parse::<Single>().unwrap()));
-    }
-}
-
-#[test]
-fn divide() {
-    // Test Special Cases against each other and normal values.
-
-    // FIXMES/NOTES:
-    // 1. Since we perform only default exception handling all operations with
-    // signaling NaNs should have a result that is a quiet NaN. Currently they
-    // return sNaN.
-
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let qnan = Single::NAN;
-    let p_normal_value = "0x1p+0".parse::<Single>().unwrap();
-    let m_normal_value = "-0x1p+0".parse::<Single>().unwrap();
-    let p_largest_value = Single::largest();
-    let m_largest_value = -Single::largest();
-    let p_smallest_value = Single::SMALLEST;
-    let m_smallest_value = -Single::SMALLEST;
-    let p_smallest_normalized = Single::smallest_normalized();
-    let m_smallest_normalized = -Single::smallest_normalized();
-
-    let overflow_status = Status::OVERFLOW | Status::INEXACT;
-    let underflow_status = Status::UNDERFLOW | Status::INEXACT;
-
-    let special_cases = [
-        (p_inf, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (p_inf, p_zero, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_zero, "-inf", Status::OK, Category::Infinity),
-        (p_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_inf, p_normal_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_normal_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_largest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_largest_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_value, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (p_inf, p_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_inf, m_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (m_inf, p_zero, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_zero, "inf", Status::OK, Category::Infinity),
-        (m_inf, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_inf, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_inf, p_normal_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_normal_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_largest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_largest_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_value, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_value, "inf", Status::OK, Category::Infinity),
-        (m_inf, p_smallest_normalized, "-inf", Status::OK, Category::Infinity),
-        (m_inf, m_smallest_normalized, "inf", Status::OK, Category::Infinity),
-        (p_zero, p_inf, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (p_zero, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (p_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_zero, p_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_normal_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_largest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_smallest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (p_zero, p_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (p_zero, m_smallest_normalized, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_inf, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (m_zero, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (m_zero, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_zero, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_zero, p_normal_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_normal_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_largest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_largest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_smallest_value, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_smallest_value, "0x0p+0", Status::OK, Category::Zero),
-        (m_zero, p_smallest_normalized, "-0x0p+0", Status::OK, Category::Zero),
-        (m_zero, m_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
-        (qnan, p_inf, "nan", Status::OK, Category::NaN),
-        (qnan, m_inf, "nan", Status::OK, Category::NaN),
-        (qnan, p_zero, "nan", Status::OK, Category::NaN),
-        (qnan, m_zero, "nan", Status::OK, Category::NaN),
-        (qnan, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (qnan, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (qnan, p_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_normal_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_largest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_value, "nan", Status::OK, Category::NaN),
-        (qnan, p_smallest_normalized, "nan", Status::OK, Category::NaN),
-        (qnan, m_smallest_normalized, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (snan, p_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_inf, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_zero, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, qnan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, snan, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_normal_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_largest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_value, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, p_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-        (snan, m_smallest_normalized, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_inf, "0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, m_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (p_normal_value, p_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_normal_value, m_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_normal_value, p_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, m_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_normal_value, p_largest_value, "0x1p-128", underflow_status, Category::Normal),
-        (p_normal_value, m_largest_value, "-0x1p-128", underflow_status, Category::Normal),
-        (p_normal_value, p_smallest_value, "inf", overflow_status, Category::Infinity),
-        (p_normal_value, m_smallest_value, "-inf", overflow_status, Category::Infinity),
-        (p_normal_value, p_smallest_normalized, "0x1p+126", Status::OK, Category::Normal),
-        (p_normal_value, m_smallest_normalized, "-0x1p+126", Status::OK, Category::Normal),
-        (m_normal_value, p_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, m_inf, "0x0p+0", Status::OK, Category::Zero),
-        (m_normal_value, p_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_normal_value, m_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_normal_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_normal_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_normal_value, p_normal_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, m_normal_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_normal_value, p_largest_value, "-0x1p-128", underflow_status, Category::Normal),
-        (m_normal_value, m_largest_value, "0x1p-128", underflow_status, Category::Normal),
-        (m_normal_value, p_smallest_value, "-inf", overflow_status, Category::Infinity),
-        (m_normal_value, m_smallest_value, "inf", overflow_status, Category::Infinity),
-        (m_normal_value, p_smallest_normalized, "-0x1p+126", Status::OK, Category::Normal),
-        (m_normal_value, m_smallest_normalized, "0x1p+126", Status::OK, Category::Normal),
-        (p_largest_value, p_inf, "0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, m_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (p_largest_value, p_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_largest_value, m_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_largest_value, p_normal_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, m_normal_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (p_largest_value, p_largest_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_largest_value, m_largest_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_largest_value, p_smallest_value, "inf", overflow_status, Category::Infinity),
-        (p_largest_value, m_smallest_value, "-inf", overflow_status, Category::Infinity),
-        (p_largest_value, p_smallest_normalized, "inf", overflow_status, Category::Infinity),
-        (p_largest_value, m_smallest_normalized, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, p_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, m_inf, "0x0p+0", Status::OK, Category::Zero),
-        (m_largest_value, p_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_largest_value, m_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_largest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_largest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_largest_value, p_normal_value, "-0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, m_normal_value, "0x1.fffffep+127", Status::OK, Category::Normal),
-        (m_largest_value, p_largest_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_largest_value, m_largest_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_largest_value, p_smallest_value, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, m_smallest_value, "inf", overflow_status, Category::Infinity),
-        (m_largest_value, p_smallest_normalized, "-inf", overflow_status, Category::Infinity),
-        (m_largest_value, m_smallest_normalized, "inf", overflow_status, Category::Infinity),
-        (p_smallest_value, p_inf, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, m_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_value, p_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_smallest_value, m_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_value, p_normal_value, "0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, m_normal_value, "-0x1p-149", Status::OK, Category::Normal),
-        (p_smallest_value, p_largest_value, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_value, m_largest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_value, p_smallest_value, "0x1p+0", Status::OK, Category::Normal),
-        (p_smallest_value, m_smallest_value, "-0x1p+0", Status::OK, Category::Normal),
-        (p_smallest_value, p_smallest_normalized, "0x1p-23", Status::OK, Category::Normal),
-        (p_smallest_value, m_smallest_normalized, "-0x1p-23", Status::OK, Category::Normal),
-        (m_smallest_value, p_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, m_inf, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_value, p_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_smallest_value, m_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_smallest_value, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_value, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_value, p_normal_value, "-0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, m_normal_value, "0x1p-149", Status::OK, Category::Normal),
-        (m_smallest_value, p_largest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, m_largest_value, "0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_value, p_smallest_value, "-0x1p+0", Status::OK, Category::Normal),
-        (m_smallest_value, m_smallest_value, "0x1p+0", Status::OK, Category::Normal),
-        (m_smallest_value, p_smallest_normalized, "-0x1p-23", Status::OK, Category::Normal),
-        (m_smallest_value, m_smallest_normalized, "0x1p-23", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_inf, "0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_normalized, m_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (p_smallest_normalized, p_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_smallest_normalized, m_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (p_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (p_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (p_smallest_normalized, p_normal_value, "0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_normal_value, "-0x1p-126", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_largest_value, "0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, m_largest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (p_smallest_normalized, p_smallest_value, "0x1p+23", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_smallest_value, "-0x1p+23", Status::OK, Category::Normal),
-        (p_smallest_normalized, p_smallest_normalized, "0x1p+0", Status::OK, Category::Normal),
-        (p_smallest_normalized, m_smallest_normalized, "-0x1p+0", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_inf, "-0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, m_inf, "0x0p+0", Status::OK, Category::Zero),
-        (m_smallest_normalized, p_zero, "-inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_smallest_normalized, m_zero, "inf", Status::DIV_BY_ZERO, Category::Infinity),
-        (m_smallest_normalized, qnan, "nan", Status::OK, Category::NaN),
-        /*
-        // See Note 1.
-        (m_smallest_normalized, snan, "nan", Status::INVALID_OP, Category::NaN),
-                */
-        (m_smallest_normalized, p_normal_value, "-0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_normal_value, "0x1p-126", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_largest_value, "-0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, m_largest_value, "0x0p+0", underflow_status, Category::Zero),
-        (m_smallest_normalized, p_smallest_value, "-0x1p+23", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_smallest_value, "0x1p+23", Status::OK, Category::Normal),
-        (m_smallest_normalized, p_smallest_normalized, "-0x1p+0", Status::OK, Category::Normal),
-        (m_smallest_normalized, m_smallest_normalized, "0x1p+0", Status::OK, Category::Normal),
-    ];
-
-    for (x, y, e_result, e_status, e_category) in special_cases {
-        let status;
-        let result = unpack!(status=, x / y);
-        assert_eq!(status, e_status);
-        assert_eq!(result.category(), e_category);
-        assert!(result.bitwise_eq(e_result.parse::<Single>().unwrap()));
-    }
-}
-
-#[test]
-fn operator_overloads() {
-    // This is mostly testing that these operator overloads compile.
-    let one = "0x1p+0".parse::<Single>().unwrap();
-    let two = "0x2p+0".parse::<Single>().unwrap();
-    assert!(two.bitwise_eq((one + one).value));
-    assert!(one.bitwise_eq((two - one).value));
-    assert!(two.bitwise_eq((one * two).value));
-    assert!(one.bitwise_eq((two / two).value));
-}
-
-#[test]
-fn abs() {
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let p_qnan = Single::NAN;
-    let m_qnan = -Single::NAN;
-    let p_snan = Single::snan(None);
-    let m_snan = -Single::snan(None);
-    let p_normal_value = "0x1p+0".parse::<Single>().unwrap();
-    let m_normal_value = "-0x1p+0".parse::<Single>().unwrap();
-    let p_largest_value = Single::largest();
-    let m_largest_value = -Single::largest();
-    let p_smallest_value = Single::SMALLEST;
-    let m_smallest_value = -Single::SMALLEST;
-    let p_smallest_normalized = Single::smallest_normalized();
-    let m_smallest_normalized = -Single::smallest_normalized();
-
-    assert!(p_inf.bitwise_eq(p_inf.abs()));
-    assert!(p_inf.bitwise_eq(m_inf.abs()));
-    assert!(p_zero.bitwise_eq(p_zero.abs()));
-    assert!(p_zero.bitwise_eq(m_zero.abs()));
-    assert!(p_qnan.bitwise_eq(p_qnan.abs()));
-    assert!(p_qnan.bitwise_eq(m_qnan.abs()));
-    assert!(p_snan.bitwise_eq(p_snan.abs()));
-    assert!(p_snan.bitwise_eq(m_snan.abs()));
-    assert!(p_normal_value.bitwise_eq(p_normal_value.abs()));
-    assert!(p_normal_value.bitwise_eq(m_normal_value.abs()));
-    assert!(p_largest_value.bitwise_eq(p_largest_value.abs()));
-    assert!(p_largest_value.bitwise_eq(m_largest_value.abs()));
-    assert!(p_smallest_value.bitwise_eq(p_smallest_value.abs()));
-    assert!(p_smallest_value.bitwise_eq(m_smallest_value.abs()));
-    assert!(p_smallest_normalized.bitwise_eq(p_smallest_normalized.abs(),));
-    assert!(p_smallest_normalized.bitwise_eq(m_smallest_normalized.abs(),));
-}
-
-#[test]
-fn neg() {
-    let one = "1.0".parse::<Single>().unwrap();
-    let neg_one = "-1.0".parse::<Single>().unwrap();
-    let zero = Single::ZERO;
-    let neg_zero = -Single::ZERO;
-    let inf = Single::INFINITY;
-    let neg_inf = -Single::INFINITY;
-    let qnan = Single::NAN;
-    let neg_qnan = -Single::NAN;
-
-    assert!(neg_one.bitwise_eq(-one));
-    assert!(one.bitwise_eq(-neg_one));
-    assert!(neg_zero.bitwise_eq(-zero));
-    assert!(zero.bitwise_eq(-neg_zero));
-    assert!(neg_inf.bitwise_eq(-inf));
-    assert!(inf.bitwise_eq(-neg_inf));
-    assert!(neg_inf.bitwise_eq(-inf));
-    assert!(inf.bitwise_eq(-neg_inf));
-    assert!(neg_qnan.bitwise_eq(-qnan));
-    assert!(qnan.bitwise_eq(-neg_qnan));
-}
-
-#[test]
-fn ilogb() {
-    assert_eq!(-1074, Double::SMALLEST.ilogb());
-    assert_eq!(-1074, (-Double::SMALLEST).ilogb());
-    assert_eq!(-1023, "0x1.ffffffffffffep-1024".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-1023, "0x1.ffffffffffffep-1023".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-1023, "-0x1.ffffffffffffep-1023".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-51, "0x1p-51".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-1023, "0x1.c60f120d9f87cp-1023".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-2, "0x0.ffffp-1".parse::<Double>().unwrap().ilogb());
-    assert_eq!(-1023, "0x1.fffep-1023".parse::<Double>().unwrap().ilogb());
-    assert_eq!(1023, Double::largest().ilogb());
-    assert_eq!(1023, (-Double::largest()).ilogb());
-
-    assert_eq!(0, "0x1p+0".parse::<Single>().unwrap().ilogb());
-    assert_eq!(0, "-0x1p+0".parse::<Single>().unwrap().ilogb());
-    assert_eq!(42, "0x1p+42".parse::<Single>().unwrap().ilogb());
-    assert_eq!(-42, "0x1p-42".parse::<Single>().unwrap().ilogb());
-
-    assert_eq!(IEK_INF, Single::INFINITY.ilogb());
-    assert_eq!(IEK_INF, (-Single::INFINITY).ilogb());
-    assert_eq!(IEK_ZERO, Single::ZERO.ilogb());
-    assert_eq!(IEK_ZERO, (-Single::ZERO).ilogb());
-    assert_eq!(IEK_NAN, Single::NAN.ilogb());
-    assert_eq!(IEK_NAN, Single::snan(None).ilogb());
-
-    assert_eq!(127, Single::largest().ilogb());
-    assert_eq!(127, (-Single::largest()).ilogb());
-
-    assert_eq!(-149, Single::SMALLEST.ilogb());
-    assert_eq!(-149, (-Single::SMALLEST).ilogb());
-    assert_eq!(-126, Single::smallest_normalized().ilogb());
-    assert_eq!(-126, (-Single::smallest_normalized()).ilogb());
-}
-
-#[test]
-fn scalbn() {
-    assert!(
-        "0x1p+0"
-            .parse::<Single>()
-            .unwrap()
-            .bitwise_eq("0x1p+0".parse::<Single>().unwrap().scalbn(0),)
-    );
-    assert!(
-        "0x1p+42"
-            .parse::<Single>()
-            .unwrap()
-            .bitwise_eq("0x1p+0".parse::<Single>().unwrap().scalbn(42),)
-    );
-    assert!(
-        "0x1p-42"
-            .parse::<Single>()
-            .unwrap()
-            .bitwise_eq("0x1p+0".parse::<Single>().unwrap().scalbn(-42),)
-    );
-
-    let p_inf = Single::INFINITY;
-    let m_inf = -Single::INFINITY;
-    let p_zero = Single::ZERO;
-    let m_zero = -Single::ZERO;
-    let p_qnan = Single::NAN;
-    let m_qnan = -Single::NAN;
-    let snan = Single::snan(None);
-
-    assert!(p_inf.bitwise_eq(p_inf.scalbn(0)));
-    assert!(m_inf.bitwise_eq(m_inf.scalbn(0)));
-    assert!(p_zero.bitwise_eq(p_zero.scalbn(0)));
-    assert!(m_zero.bitwise_eq(m_zero.scalbn(0)));
-    assert!(p_qnan.bitwise_eq(p_qnan.scalbn(0)));
-    assert!(m_qnan.bitwise_eq(m_qnan.scalbn(0)));
-    assert!(!snan.scalbn(0).is_signaling());
-
-    let scalbn_snan = snan.scalbn(1);
-    assert!(scalbn_snan.is_nan() && !scalbn_snan.is_signaling());
-
-    // Make sure highest bit of payload is preserved.
-    let payload = (1 << 50) | (1 << 49) | (1234 << 32) | 1;
-
-    let snan_with_payload = Double::snan(Some(payload));
-    let quiet_payload = snan_with_payload.scalbn(1);
-    assert!(quiet_payload.is_nan() && !quiet_payload.is_signaling());
-    assert_eq!(payload, quiet_payload.to_bits() & ((1 << 51) - 1));
-
-    assert!(p_inf.bitwise_eq("0x1p+0".parse::<Single>().unwrap().scalbn(128),));
-    assert!(m_inf.bitwise_eq("-0x1p+0".parse::<Single>().unwrap().scalbn(128),));
-    assert!(p_inf.bitwise_eq("0x1p+127".parse::<Single>().unwrap().scalbn(1),));
-    assert!(p_zero.bitwise_eq("0x1p-127".parse::<Single>().unwrap().scalbn(-127),));
-    assert!(m_zero.bitwise_eq("-0x1p-127".parse::<Single>().unwrap().scalbn(-127),));
-    assert!(
-        "-0x1p-149"
-            .parse::<Single>()
-            .unwrap()
-            .bitwise_eq("-0x1p-127".parse::<Single>().unwrap().scalbn(-22),)
-    );
-    assert!(p_zero.bitwise_eq("0x1p-126".parse::<Single>().unwrap().scalbn(-24),));
-
-    let smallest_f64 = Double::SMALLEST;
-    let neg_smallest_f64 = -Double::SMALLEST;
-
-    let largest_f64 = Double::largest();
-    let neg_largest_f64 = -Double::largest();
-
-    let largest_denormal_f64 = "0x1.ffffffffffffep-1023".parse::<Double>().unwrap();
-    let neg_largest_denormal_f64 = "-0x1.ffffffffffffep-1023".parse::<Double>().unwrap();
-
-    assert!(smallest_f64.bitwise_eq("0x1p-1074".parse::<Double>().unwrap().scalbn(0),));
-    assert!(neg_smallest_f64.bitwise_eq("-0x1p-1074".parse::<Double>().unwrap().scalbn(0),));
-
-    assert!("0x1p+1023".parse::<Double>().unwrap().bitwise_eq(smallest_f64.scalbn(2097,),));
-
-    assert!(smallest_f64.scalbn(-2097).is_pos_zero());
-    assert!(smallest_f64.scalbn(-2098).is_pos_zero());
-    assert!(smallest_f64.scalbn(-2099).is_pos_zero());
-    assert!("0x1p+1022".parse::<Double>().unwrap().bitwise_eq(smallest_f64.scalbn(2096,),));
-    assert!("0x1p+1023".parse::<Double>().unwrap().bitwise_eq(smallest_f64.scalbn(2097,),));
-    assert!(smallest_f64.scalbn(2098).is_infinite());
-    assert!(smallest_f64.scalbn(2099).is_infinite());
-
-    // Test for integer overflows when adding to exponent.
-    assert!(smallest_f64.scalbn(-ExpInt::MAX).is_pos_zero());
-    assert!(largest_f64.scalbn(ExpInt::MAX).is_infinite());
-
-    assert!(largest_denormal_f64.bitwise_eq(largest_denormal_f64.scalbn(0),));
-    assert!(neg_largest_denormal_f64.bitwise_eq(neg_largest_denormal_f64.scalbn(0),));
-
-    assert!(
-        "0x1.ffffffffffffep-1022"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(1))
-    );
-    assert!(
-        "-0x1.ffffffffffffep-1021"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(neg_largest_denormal_f64.scalbn(2))
-    );
-
-    assert!(
-        "0x1.ffffffffffffep+1"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(1024))
-    );
-    assert!(largest_denormal_f64.scalbn(-1023).is_pos_zero());
-    assert!(largest_denormal_f64.scalbn(-1024).is_pos_zero());
-    assert!(largest_denormal_f64.scalbn(-2048).is_pos_zero());
-    assert!(largest_denormal_f64.scalbn(2047).is_infinite());
-    assert!(largest_denormal_f64.scalbn(2098).is_infinite());
-    assert!(largest_denormal_f64.scalbn(2099).is_infinite());
-
-    assert!(
-        "0x1.ffffffffffffep-2"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(1021))
-    );
-    assert!(
-        "0x1.ffffffffffffep-1"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(1022))
-    );
-    assert!(
-        "0x1.ffffffffffffep+0"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(1023))
-    );
-    assert!(
-        "0x1.ffffffffffffep+1023"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(largest_denormal_f64.scalbn(2046))
-    );
-    assert!("0x1p+974".parse::<Double>().unwrap().bitwise_eq(smallest_f64.scalbn(2048,),));
-
-    let random_denormal_f64 = "0x1.c60f120d9f87cp+51".parse::<Double>().unwrap();
-    assert!(
-        "0x1.c60f120d9f87cp-972"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(random_denormal_f64.scalbn(-1023))
-    );
-    assert!(
-        "0x1.c60f120d9f87cp-1"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(random_denormal_f64.scalbn(-52))
-    );
-    assert!(
-        "0x1.c60f120d9f87cp-2"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(random_denormal_f64.scalbn(-53))
-    );
-    assert!(
-        "0x1.c60f120d9f87cp+0"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq(random_denormal_f64.scalbn(-51))
-    );
-
-    assert!(random_denormal_f64.scalbn(-2097).is_pos_zero());
-    assert!(random_denormal_f64.scalbn(-2090).is_pos_zero());
-
-    assert!("-0x1p-1073".parse::<Double>().unwrap().bitwise_eq(neg_largest_f64.scalbn(-2097),));
-
-    assert!("-0x1p-1024".parse::<Double>().unwrap().bitwise_eq(neg_largest_f64.scalbn(-2048),));
-
-    assert!("0x1p-1073".parse::<Double>().unwrap().bitwise_eq(largest_f64.scalbn(-2097,),));
-
-    assert!("0x1p-1074".parse::<Double>().unwrap().bitwise_eq(largest_f64.scalbn(-2098,),));
-    assert!("-0x1p-1074".parse::<Double>().unwrap().bitwise_eq(neg_largest_f64.scalbn(-2098),));
-    assert!(neg_largest_f64.scalbn(-2099).is_neg_zero());
-    assert!(largest_f64.scalbn(1).is_infinite());
-
-    assert!(
-        "0x1p+0"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq("0x1p+52".parse::<Double>().unwrap().scalbn(-52),)
-    );
-
-    assert!(
-        "0x1p-103"
-            .parse::<Double>()
-            .unwrap()
-            .bitwise_eq("0x1p-51".parse::<Double>().unwrap().scalbn(-52),)
-    );
-}
-
-#[test]
-fn frexp() {
-    let p_zero = Double::ZERO;
-    let m_zero = -Double::ZERO;
-    let one = Double::from_f64(1.0);
-    let m_one = Double::from_f64(-1.0);
-
-    let largest_denormal = "0x1.ffffffffffffep-1023".parse::<Double>().unwrap();
-    let neg_largest_denormal = "-0x1.ffffffffffffep-1023".parse::<Double>().unwrap();
-
-    let smallest = Double::SMALLEST;
-    let neg_smallest = -Double::SMALLEST;
-
-    let largest = Double::largest();
-    let neg_largest = -Double::largest();
-
-    let p_inf = Double::INFINITY;
-    let m_inf = -Double::INFINITY;
-
-    let p_qnan = Double::NAN;
-    let m_qnan = -Double::NAN;
-    let snan = Double::snan(None);
-
-    // Make sure highest bit of payload is preserved.
-    let payload = (1 << 50) | (1 << 49) | (1234 << 32) | 1;
-
-    let snan_with_payload = Double::snan(Some(payload));
-
-    let mut exp = 0;
-
-    let frac = p_zero.frexp(&mut exp);
-    assert_eq!(0, exp);
-    assert!(frac.is_pos_zero());
-
-    let frac = m_zero.frexp(&mut exp);
-    assert_eq!(0, exp);
-    assert!(frac.is_neg_zero());
-
-    let frac = one.frexp(&mut exp);
-    assert_eq!(1, exp);
-    assert!("0x1p-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = m_one.frexp(&mut exp);
-    assert_eq!(1, exp);
-    assert!("-0x1p-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = largest_denormal.frexp(&mut exp);
-    assert_eq!(-1022, exp);
-    assert!("0x1.ffffffffffffep-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = neg_largest_denormal.frexp(&mut exp);
-    assert_eq!(-1022, exp);
-    assert!("-0x1.ffffffffffffep-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = smallest.frexp(&mut exp);
-    assert_eq!(-1073, exp);
-    assert!("0x1p-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = neg_smallest.frexp(&mut exp);
-    assert_eq!(-1073, exp);
-    assert!("-0x1p-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = largest.frexp(&mut exp);
-    assert_eq!(1024, exp);
-    assert!("0x1.fffffffffffffp-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = neg_largest.frexp(&mut exp);
-    assert_eq!(1024, exp);
-    assert!("-0x1.fffffffffffffp-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = p_inf.frexp(&mut exp);
-    assert_eq!(IEK_INF, exp);
-    assert!(frac.is_infinite() && !frac.is_negative());
-
-    let frac = m_inf.frexp(&mut exp);
-    assert_eq!(IEK_INF, exp);
-    assert!(frac.is_infinite() && frac.is_negative());
-
-    let frac = p_qnan.frexp(&mut exp);
-    assert_eq!(IEK_NAN, exp);
-    assert!(frac.is_nan());
-
-    let frac = m_qnan.frexp(&mut exp);
-    assert_eq!(IEK_NAN, exp);
-    assert!(frac.is_nan());
-
-    let frac = snan.frexp(&mut exp);
-    assert_eq!(IEK_NAN, exp);
-    assert!(frac.is_nan() && !frac.is_signaling());
-
-    let frac = snan_with_payload.frexp(&mut exp);
-    assert_eq!(IEK_NAN, exp);
-    assert!(frac.is_nan() && !frac.is_signaling());
-    assert_eq!(payload, frac.to_bits() & ((1 << 51) - 1));
-
-    let frac = "0x0.ffffp-1".parse::<Double>().unwrap().frexp(&mut exp);
-    assert_eq!(-1, exp);
-    assert!("0x1.fffep-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = "0x1p-51".parse::<Double>().unwrap().frexp(&mut exp);
-    assert_eq!(-50, exp);
-    assert!("0x1p-1".parse::<Double>().unwrap().bitwise_eq(frac));
-
-    let frac = "0x1.c60f120d9f87cp+51".parse::<Double>().unwrap().frexp(&mut exp);
-    assert_eq!(52, exp);
-    assert!("0x1.c60f120d9f87cp-1".parse::<Double>().unwrap().bitwise_eq(frac));
-}
-
-#[test]
-fn modulo() {
-    let mut status;
-    {
-        let f1 = "1.5".parse::<Double>().unwrap();
-        let f2 = "1.0".parse::<Double>().unwrap();
-        let expected = "0.5".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "0.5".parse::<Double>().unwrap();
-        let f2 = "1.0".parse::<Double>().unwrap();
-        let expected = "0.5".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "0x1.3333333333333p-2".parse::<Double>().unwrap(); // 0.3
-        let f2 = "0x1.47ae147ae147bp-7".parse::<Double>().unwrap(); // 0.01
-        // 0.009999999999999983
-        let expected = "0x1.47ae147ae1471p-7".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "0x1p64".parse::<Double>().unwrap(); // 1.8446744073709552e19
-        let f2 = "1.5".parse::<Double>().unwrap();
-        let expected = "1.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "0x1p1000".parse::<Double>().unwrap();
-        let f2 = "0x1p-1000".parse::<Double>().unwrap();
-        let expected = "0.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "0.0".parse::<Double>().unwrap();
-        let f2 = "1.0".parse::<Double>().unwrap();
-        let expected = "0.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).bitwise_eq(expected));
-        assert_eq!(status, Status::OK);
-    }
-    {
-        let f1 = "1.0".parse::<Double>().unwrap();
-        let f2 = "0.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).is_nan());
-        assert_eq!(status, Status::INVALID_OP);
-    }
-    {
-        let f1 = "0.0".parse::<Double>().unwrap();
-        let f2 = "0.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).is_nan());
-        assert_eq!(status, Status::INVALID_OP);
-    }
-    {
-        let f1 = Double::INFINITY;
-        let f2 = "1.0".parse::<Double>().unwrap();
-        assert!(unpack!(status=, f1 % f2).is_nan());
-        assert_eq!(status, Status::INVALID_OP);
-    }
-}
diff --git a/compiler/rustc_apfloat/tests/ppc.rs b/compiler/rustc_apfloat/tests/ppc.rs
deleted file mode 100644
index c769d265437..00000000000
--- a/compiler/rustc_apfloat/tests/ppc.rs
+++ /dev/null
@@ -1,530 +0,0 @@
-use rustc_apfloat::ppc::DoubleDouble;
-use rustc_apfloat::{Category, Float, Round};
-
-use std::cmp::Ordering;
-
-#[test]
-fn ppc_double_double() {
-    let test = DoubleDouble::ZERO;
-    let expected = "0x0p+0".parse::<DoubleDouble>().unwrap();
-    assert!(test.is_zero());
-    assert!(!test.is_negative());
-    assert!(test.bitwise_eq(expected));
-    assert_eq!(0, test.to_bits());
-
-    let test = -DoubleDouble::ZERO;
-    let expected = "-0x0p+0".parse::<DoubleDouble>().unwrap();
-    assert!(test.is_zero());
-    assert!(test.is_negative());
-    assert!(test.bitwise_eq(expected));
-    assert_eq!(0x8000000000000000, test.to_bits());
-
-    let test = "1.0".parse::<DoubleDouble>().unwrap();
-    assert_eq!(0x3ff0000000000000, test.to_bits());
-
-    // LDBL_MAX
-    let test = "1.79769313486231580793728971405301e+308".parse::<DoubleDouble>().unwrap();
-    assert_eq!(0x7c8ffffffffffffe_7fefffffffffffff, test.to_bits());
-
-    // LDBL_MIN
-    let test = "2.00416836000897277799610805135016e-292".parse::<DoubleDouble>().unwrap();
-    assert_eq!(0x0000000000000000_0360000000000000, test.to_bits());
-}
-
-#[test]
-fn ppc_double_double_add_special() {
-    let data = [
-        // (1 + 0) + (-1 + 0) = Category::Zero
-        (0x3ff0000000000000, 0xbff0000000000000, Category::Zero, Round::NearestTiesToEven),
-        // LDBL_MAX + (1.1 >> (1023 - 106) + 0)) = Category::Infinity
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x7948000000000000,
-            Category::Infinity,
-            Round::NearestTiesToEven,
-        ),
-        // FIXME: change the 4th 0x75effffffffffffe to 0x75efffffffffffff when
-        // DoubleDouble's fallback is gone.
-        // LDBL_MAX + (1.011111... >> (1023 - 106) + (1.1111111...0 >> (1023 -
-        // 160))) = Category::Normal
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x75effffffffffffe_7947ffffffffffff,
-            Category::Normal,
-            Round::NearestTiesToEven,
-        ),
-        // LDBL_MAX + (1.1 >> (1023 - 106) + 0)) = Category::Infinity
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            Category::Infinity,
-            Round::NearestTiesToEven,
-        ),
-        // NaN + (1 + 0) = Category::NaN
-        (0x7ff8000000000000, 0x3ff0000000000000, Category::NaN, Round::NearestTiesToEven),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        {
-            let mut a1 = DoubleDouble::from_bits(op1);
-            let a2 = DoubleDouble::from_bits(op2);
-            a1 = a1.add_r(a2, round).value;
-
-            assert_eq!(expected, a1.category(), "{:#x} + {:#x}", op1, op2);
-        }
-        {
-            let a1 = DoubleDouble::from_bits(op1);
-            let mut a2 = DoubleDouble::from_bits(op2);
-            a2 = a2.add_r(a1, round).value;
-
-            assert_eq!(expected, a2.category(), "{:#x} + {:#x}", op2, op1);
-        }
-    }
-}
-
-#[test]
-fn ppc_double_double_add() {
-    let data = [
-        // (1 + 0) + (1e-105 + 0) = (1 + 1e-105)
-        (
-            0x3ff0000000000000,
-            0x3960000000000000,
-            0x3960000000000000_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + 0) + (1e-106 + 0) = (1 + 1e-106)
-        (
-            0x3ff0000000000000,
-            0x3950000000000000,
-            0x3950000000000000_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + 1e-106) + (1e-106 + 0) = (1 + 1e-105)
-        (
-            0x3950000000000000_3ff0000000000000,
-            0x3950000000000000,
-            0x3960000000000000_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + 0) + (epsilon + 0) = (1 + epsilon)
-        (
-            0x3ff0000000000000,
-            0x0000000000000001,
-            0x0000000000000001_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // FIXME: change 0xf950000000000000 to 0xf940000000000000, when
-        // DoubleDouble's fallback is gone.
-        // (DBL_MAX - 1 << (1023 - 105)) + (1 << (1023 - 53) + 0) = DBL_MAX +
-        // 1.11111... << (1023 - 52)
-        (
-            0xf950000000000000_7fefffffffffffff,
-            0x7c90000000000000,
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            Round::NearestTiesToEven,
-        ),
-        // FIXME: change 0xf950000000000000 to 0xf940000000000000, when
-        // DoubleDouble's fallback is gone.
-        // (1 << (1023 - 53) + 0) + (DBL_MAX - 1 << (1023 - 105)) = DBL_MAX +
-        // 1.11111... << (1023 - 52)
-        (
-            0x7c90000000000000,
-            0xf950000000000000_7fefffffffffffff,
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            Round::NearestTiesToEven,
-        ),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        {
-            let mut a1 = DoubleDouble::from_bits(op1);
-            let a2 = DoubleDouble::from_bits(op2);
-            a1 = a1.add_r(a2, round).value;
-
-            assert_eq!(expected, a1.to_bits(), "{:#x} + {:#x}", op1, op2);
-        }
-        {
-            let a1 = DoubleDouble::from_bits(op1);
-            let mut a2 = DoubleDouble::from_bits(op2);
-            a2 = a2.add_r(a1, round).value;
-
-            assert_eq!(expected, a2.to_bits(), "{:#x} + {:#x}", op2, op1);
-        }
-    }
-}
-
-#[test]
-fn ppc_double_double_subtract() {
-    let data = [
-        // (1 + 0) - (-1e-105 + 0) = (1 + 1e-105)
-        (
-            0x3ff0000000000000,
-            0xb960000000000000,
-            0x3960000000000000_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + 0) - (-1e-106 + 0) = (1 + 1e-106)
-        (
-            0x3ff0000000000000,
-            0xb950000000000000,
-            0x3950000000000000_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        let mut a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        a1 = a1.sub_r(a2, round).value;
-
-        assert_eq!(expected, a1.to_bits(), "{:#x} - {:#x}", op1, op2);
-    }
-}
-
-#[test]
-fn ppc_double_double_multiply_special() {
-    let data = [
-        // Category::NaN * Category::NaN = Category::NaN
-        (0x7ff8000000000000, 0x7ff8000000000000, Category::NaN, Round::NearestTiesToEven),
-        // Category::NaN * Category::Zero = Category::NaN
-        (0x7ff8000000000000, 0, Category::NaN, Round::NearestTiesToEven),
-        // Category::NaN * Category::Infinity = Category::NaN
-        (0x7ff8000000000000, 0x7ff0000000000000, Category::NaN, Round::NearestTiesToEven),
-        // Category::NaN * Category::Normal = Category::NaN
-        (0x7ff8000000000000, 0x3ff0000000000000, Category::NaN, Round::NearestTiesToEven),
-        // Category::Infinity * Category::Infinity = Category::Infinity
-        (0x7ff0000000000000, 0x7ff0000000000000, Category::Infinity, Round::NearestTiesToEven),
-        // Category::Infinity * Category::Zero = Category::NaN
-        (0x7ff0000000000000, 0, Category::NaN, Round::NearestTiesToEven),
-        // Category::Infinity * Category::Normal = Category::Infinity
-        (0x7ff0000000000000, 0x3ff0000000000000, Category::Infinity, Round::NearestTiesToEven),
-        // Category::Zero * Category::Zero = Category::Zero
-        (0, 0, Category::Zero, Round::NearestTiesToEven),
-        // Category::Zero * Category::Normal = Category::Zero
-        (0, 0x3ff0000000000000, Category::Zero, Round::NearestTiesToEven),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        {
-            let mut a1 = DoubleDouble::from_bits(op1);
-            let a2 = DoubleDouble::from_bits(op2);
-            a1 = a1.mul_r(a2, round).value;
-
-            assert_eq!(expected, a1.category(), "{:#x} * {:#x}", op1, op2);
-        }
-        {
-            let a1 = DoubleDouble::from_bits(op1);
-            let mut a2 = DoubleDouble::from_bits(op2);
-            a2 = a2.mul_r(a1, round).value;
-
-            assert_eq!(expected, a2.category(), "{:#x} * {:#x}", op2, op1);
-        }
-    }
-}
-
-#[test]
-fn ppc_double_double_multiply() {
-    let data = [
-        // 1/3 * 3 = 1.0
-        (
-            0x3c75555555555556_3fd5555555555555,
-            0x4008000000000000,
-            0x3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + epsilon) * (1 + 0) = Category::Zero
-        (
-            0x0000000000000001_3ff0000000000000,
-            0x3ff0000000000000,
-            0x0000000000000001_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (1 + epsilon) * (1 + epsilon) = 1 + 2 * epsilon
-        (
-            0x0000000000000001_3ff0000000000000,
-            0x0000000000000001_3ff0000000000000,
-            0x0000000000000002_3ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // -(1 + epsilon) * (1 + epsilon) = -1
-        (
-            0x0000000000000001_bff0000000000000,
-            0x0000000000000001_3ff0000000000000,
-            0xbff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (0.5 + 0) * (1 + 2 * epsilon) = 0.5 + epsilon
-        (
-            0x3fe0000000000000,
-            0x0000000000000002_3ff0000000000000,
-            0x0000000000000001_3fe0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // (0.5 + 0) * (1 + epsilon) = 0.5
-        (
-            0x3fe0000000000000,
-            0x0000000000000001_3ff0000000000000,
-            0x3fe0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // __LDBL_MAX__ * (1 + 1 << 106) = inf
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x3950000000000000_3ff0000000000000,
-            0x7ff0000000000000,
-            Round::NearestTiesToEven,
-        ),
-        // __LDBL_MAX__ * (1 + 1 << 107) > __LDBL_MAX__, but not inf, yes =_=|||
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x3940000000000000_3ff0000000000000,
-            0x7c8fffffffffffff_7fefffffffffffff,
-            Round::NearestTiesToEven,
-        ),
-        // __LDBL_MAX__ * (1 + 1 << 108) = __LDBL_MAX__
-        (
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            0x3930000000000000_3ff0000000000000,
-            0x7c8ffffffffffffe_7fefffffffffffff,
-            Round::NearestTiesToEven,
-        ),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        {
-            let mut a1 = DoubleDouble::from_bits(op1);
-            let a2 = DoubleDouble::from_bits(op2);
-            a1 = a1.mul_r(a2, round).value;
-
-            assert_eq!(expected, a1.to_bits(), "{:#x} * {:#x}", op1, op2);
-        }
-        {
-            let a1 = DoubleDouble::from_bits(op1);
-            let mut a2 = DoubleDouble::from_bits(op2);
-            a2 = a2.mul_r(a1, round).value;
-
-            assert_eq!(expected, a2.to_bits(), "{:#x} * {:#x}", op2, op1);
-        }
-    }
-}
-
-#[test]
-fn ppc_double_double_divide() {
-    // FIXME: Only a sanity check for now. Add more edge cases when the
-    // double-double algorithm is implemented.
-    let data = [
-        // 1 / 3 = 1/3
-        (
-            0x3ff0000000000000,
-            0x4008000000000000,
-            0x3c75555555555556_3fd5555555555555,
-            Round::NearestTiesToEven,
-        ),
-    ];
-
-    for (op1, op2, expected, round) in data {
-        let mut a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        a1 = a1.div_r(a2, round).value;
-
-        assert_eq!(expected, a1.to_bits(), "{:#x} / {:#x}", op1, op2);
-    }
-}
-
-#[test]
-fn ppc_double_double_remainder() {
-    let data = [
-        // ieee_rem(3.0 + 3.0 << 53, 1.25 + 1.25 << 53) = (0.5 + 0.5 << 53)
-        (
-            0x3cb8000000000000_4008000000000000,
-            0x3ca4000000000000_3ff4000000000000,
-            0x3c90000000000000_3fe0000000000000,
-        ),
-        // ieee_rem(3.0 + 3.0 << 53, 1.75 + 1.75 << 53) = (-0.5 - 0.5 << 53)
-        (
-            0x3cb8000000000000_4008000000000000,
-            0x3cac000000000000_3ffc000000000000,
-            0xbc90000000000000_bfe0000000000000,
-        ),
-    ];
-
-    for (op1, op2, expected) in data {
-        let a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        let result = a1.ieee_rem(a2).value;
-
-        assert_eq!(expected, result.to_bits(), "ieee_rem({:#x}, {:#x})", op1, op2);
-    }
-}
-
-#[test]
-fn ppc_double_double_mod() {
-    let data = [
-        // mod(3.0 + 3.0 << 53, 1.25 + 1.25 << 53) = (0.5 + 0.5 << 53)
-        (
-            0x3cb8000000000000_4008000000000000,
-            0x3ca4000000000000_3ff4000000000000,
-            0x3c90000000000000_3fe0000000000000,
-        ),
-        // mod(3.0 + 3.0 << 53, 1.75 + 1.75 << 53) = (1.25 + 1.25 << 53)
-        // 0xbc98000000000000 doesn't seem right, but it's what we currently have.
-        // FIXME: investigate
-        (
-            0x3cb8000000000000_4008000000000000,
-            0x3cac000000000000_3ffc000000000000,
-            0xbc98000000000000_3ff4000000000001,
-        ),
-    ];
-
-    for (op1, op2, expected) in data {
-        let a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        let r = (a1 % a2).value;
-
-        assert_eq!(expected, r.to_bits(), "fmod({:#x}, {:#x})", op1, op2);
-    }
-}
-
-#[test]
-fn ppc_double_double_fma() {
-    // Sanity check for now.
-    let mut a = "2".parse::<DoubleDouble>().unwrap();
-    a = a.mul_add("3".parse::<DoubleDouble>().unwrap(), "4".parse::<DoubleDouble>().unwrap()).value;
-    assert_eq!(Some(Ordering::Equal), "10".parse::<DoubleDouble>().unwrap().partial_cmp(&a));
-}
-
-#[test]
-fn ppc_double_double_round_to_integral() {
-    {
-        let a = "1.5".parse::<DoubleDouble>().unwrap();
-        let a = a.round_to_integral(Round::NearestTiesToEven).value;
-        assert_eq!(Some(Ordering::Equal), "2".parse::<DoubleDouble>().unwrap().partial_cmp(&a));
-    }
-    {
-        let a = "2.5".parse::<DoubleDouble>().unwrap();
-        let a = a.round_to_integral(Round::NearestTiesToEven).value;
-        assert_eq!(Some(Ordering::Equal), "2".parse::<DoubleDouble>().unwrap().partial_cmp(&a));
-    }
-}
-
-#[test]
-fn ppc_double_double_compare() {
-    let data = [
-        // (1 + 0) = (1 + 0)
-        (0x3ff0000000000000, 0x3ff0000000000000, Some(Ordering::Equal)),
-        // (1 + 0) < (1.00...1 + 0)
-        (0x3ff0000000000000, 0x3ff0000000000001, Some(Ordering::Less)),
-        // (1.00...1 + 0) > (1 + 0)
-        (0x3ff0000000000001, 0x3ff0000000000000, Some(Ordering::Greater)),
-        // (1 + 0) < (1 + epsilon)
-        (0x3ff0000000000000, 0x0000000000000001_3ff0000000000001, Some(Ordering::Less)),
-        // NaN != NaN
-        (0x7ff8000000000000, 0x7ff8000000000000, None),
-        // (1 + 0) != NaN
-        (0x3ff0000000000000, 0x7ff8000000000000, None),
-        // Inf = Inf
-        (0x7ff0000000000000, 0x7ff0000000000000, Some(Ordering::Equal)),
-    ];
-
-    for (op1, op2, expected) in data {
-        let a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        assert_eq!(expected, a1.partial_cmp(&a2), "compare({:#x}, {:#x})", op1, op2,);
-    }
-}
-
-#[test]
-fn ppc_double_double_bitwise_eq() {
-    let data = [
-        // (1 + 0) = (1 + 0)
-        (0x3ff0000000000000, 0x3ff0000000000000, true),
-        // (1 + 0) != (1.00...1 + 0)
-        (0x3ff0000000000000, 0x3ff0000000000001, false),
-        // NaN = NaN
-        (0x7ff8000000000000, 0x7ff8000000000000, true),
-        // NaN != NaN with a different bit pattern
-        (0x7ff8000000000000, 0x3ff0000000000000_7ff8000000000000, false),
-        // Inf = Inf
-        (0x7ff0000000000000, 0x7ff0000000000000, true),
-    ];
-
-    for (op1, op2, expected) in data {
-        let a1 = DoubleDouble::from_bits(op1);
-        let a2 = DoubleDouble::from_bits(op2);
-        assert_eq!(expected, a1.bitwise_eq(a2), "{:#x} = {:#x}", op1, op2);
-    }
-}
-
-#[test]
-fn ppc_double_double_change_sign() {
-    let float = DoubleDouble::from_bits(0xbcb0000000000000_400f000000000000);
-    {
-        let actual = float.copy_sign("1".parse::<DoubleDouble>().unwrap());
-        assert_eq!(0xbcb0000000000000_400f000000000000, actual.to_bits());
-    }
-    {
-        let actual = float.copy_sign("-1".parse::<DoubleDouble>().unwrap());
-        assert_eq!(0x3cb0000000000000_c00f000000000000, actual.to_bits());
-    }
-}
-
-#[test]
-fn ppc_double_double_factories() {
-    assert_eq!(0, DoubleDouble::ZERO.to_bits());
-    assert_eq!(0x7c8ffffffffffffe_7fefffffffffffff, DoubleDouble::largest().to_bits());
-    assert_eq!(0x0000000000000001, DoubleDouble::SMALLEST.to_bits());
-    assert_eq!(0x0360000000000000, DoubleDouble::smallest_normalized().to_bits());
-    assert_eq!(0x0000000000000000_8000000000000000, (-DoubleDouble::ZERO).to_bits());
-    assert_eq!(0xfc8ffffffffffffe_ffefffffffffffff, (-DoubleDouble::largest()).to_bits());
-    assert_eq!(0x0000000000000000_8000000000000001, (-DoubleDouble::SMALLEST).to_bits());
-    assert_eq!(
-        0x0000000000000000_8360000000000000,
-        (-DoubleDouble::smallest_normalized()).to_bits()
-    );
-    assert!(DoubleDouble::SMALLEST.is_smallest());
-    assert!(DoubleDouble::largest().is_largest());
-}
-
-#[test]
-fn ppc_double_double_is_denormal() {
-    assert!(DoubleDouble::SMALLEST.is_denormal());
-    assert!(!DoubleDouble::largest().is_denormal());
-    assert!(!DoubleDouble::smallest_normalized().is_denormal());
-    {
-        // (4 + 3) is not normalized
-        let data = 0x4008000000000000_4010000000000000;
-        assert!(DoubleDouble::from_bits(data).is_denormal());
-    }
-}
-
-#[test]
-fn ppc_double_double_exact_inverse() {
-    assert!(
-        "2.0"
-            .parse::<DoubleDouble>()
-            .unwrap()
-            .get_exact_inverse()
-            .unwrap()
-            .bitwise_eq("0.5".parse::<DoubleDouble>().unwrap())
-    );
-}
-
-#[test]
-fn ppc_double_double_scalbn() {
-    // 3.0 + 3.0 << 53
-    let input = 0x3cb8000000000000_4008000000000000;
-    let result = DoubleDouble::from_bits(input).scalbn(1);
-    // 6.0 + 6.0 << 53
-    assert_eq!(0x3cc8000000000000_4018000000000000, result.to_bits());
-}
-
-#[test]
-fn ppc_double_double_frexp() {
-    // 3.0 + 3.0 << 53
-    let input = 0x3cb8000000000000_4008000000000000;
-    let mut exp = 0;
-    // 0.75 + 0.75 << 53
-    let result = DoubleDouble::from_bits(input).frexp(&mut exp);
-    assert_eq!(2, exp);
-    assert_eq!(0x3c98000000000000_3fe8000000000000, result.to_bits());
-}
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 17b73468a31..dd4321bea1b 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2947,6 +2947,7 @@ pub struct StaticItem {
 #[derive(Clone, Encodable, Decodable, Debug)]
 pub struct ConstItem {
     pub defaultness: Defaultness,
+    pub generics: Generics,
     pub ty: P<Ty>,
     pub expr: Option<P<Expr>>,
 }
@@ -3058,6 +3059,7 @@ impl ItemKind {
         match self {
             Self::Fn(box Fn { generics, .. })
             | Self::TyAlias(box TyAlias { generics, .. })
+            | Self::Const(box ConstItem { generics, .. })
             | Self::Enum(_, generics)
             | Self::Struct(_, generics)
             | Self::Union(_, generics)
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs
index 15fe29580c2..8b9bb1df5dc 100644
--- a/compiler/rustc_ast/src/attr/mod.rs
+++ b/compiler/rustc_ast/src/attr/mod.rs
@@ -285,17 +285,17 @@ impl MetaItem {
         self.kind.value_str()
     }
 
-    fn from_tokens<I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
+    fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<MetaItem>
     where
-        I: Iterator<Item = TokenTree>,
+        I: Iterator<Item = &'a TokenTree>,
     {
         // FIXME: Share code with `parse_path`.
-        let path = match tokens.next().map(TokenTree::uninterpolate) {
-            Some(TokenTree::Token(
-                Token { kind: kind @ (token::Ident(..) | token::ModSep), span },
+        let path = match tokens.next().map(|tt| TokenTree::uninterpolate(tt)).as_deref() {
+            Some(&TokenTree::Token(
+                Token { kind: ref kind @ (token::Ident(..) | token::ModSep), span },
                 _,
             )) => 'arm: {
-                let mut segments = if let token::Ident(name, _) = kind {
+                let mut segments = if let &token::Ident(name, _) = kind {
                     if let Some(TokenTree::Token(Token { kind: token::ModSep, .. }, _)) =
                         tokens.peek()
                     {
@@ -308,8 +308,8 @@ impl MetaItem {
                     thin_vec![PathSegment::path_root(span)]
                 };
                 loop {
-                    if let Some(TokenTree::Token(Token { kind: token::Ident(name, _), span }, _)) =
-                        tokens.next().map(TokenTree::uninterpolate)
+                    if let Some(&TokenTree::Token(Token { kind: token::Ident(name, _), span }, _)) =
+                        tokens.next().map(|tt| TokenTree::uninterpolate(tt)).as_deref()
                     {
                         segments.push(PathSegment::from_ident(Ident::new(name, span)));
                     } else {
@@ -326,7 +326,7 @@ impl MetaItem {
                 let span = span.with_hi(segments.last().unwrap().ident.span.hi());
                 Path { span, segments, tokens: None }
             }
-            Some(TokenTree::Token(Token { kind: token::Interpolated(nt), .. }, _)) => match &*nt {
+            Some(TokenTree::Token(Token { kind: token::Interpolated(nt), .. }, _)) => match &**nt {
                 token::Nonterminal::NtMeta(item) => return item.meta(item.path.span),
                 token::Nonterminal::NtPath(path) => (**path).clone(),
                 _ => return None,
@@ -354,7 +354,7 @@ impl MetaItemKind {
     }
 
     fn list_from_tokens(tokens: TokenStream) -> Option<ThinVec<NestedMetaItem>> {
-        let mut tokens = tokens.into_trees().peekable();
+        let mut tokens = tokens.trees().peekable();
         let mut result = ThinVec::new();
         while tokens.peek().is_some() {
             let item = NestedMetaItem::from_tokens(&mut tokens)?;
@@ -367,12 +367,12 @@ impl MetaItemKind {
         Some(result)
     }
 
-    fn name_value_from_tokens(
-        tokens: &mut impl Iterator<Item = TokenTree>,
+    fn name_value_from_tokens<'a>(
+        tokens: &mut impl Iterator<Item = &'a TokenTree>,
     ) -> Option<MetaItemKind> {
         match tokens.next() {
             Some(TokenTree::Delimited(_, Delimiter::Invisible, inner_tokens)) => {
-                MetaItemKind::name_value_from_tokens(&mut inner_tokens.into_trees())
+                MetaItemKind::name_value_from_tokens(&mut inner_tokens.trees())
             }
             Some(TokenTree::Token(token, _)) => {
                 MetaItemLit::from_token(&token).map(MetaItemKind::NameValue)
@@ -381,8 +381,8 @@ impl MetaItemKind {
         }
     }
 
-    fn from_tokens(
-        tokens: &mut iter::Peekable<impl Iterator<Item = TokenTree>>,
+    fn from_tokens<'a>(
+        tokens: &mut iter::Peekable<impl Iterator<Item = &'a TokenTree>>,
     ) -> Option<MetaItemKind> {
         match tokens.peek() {
             Some(TokenTree::Delimited(_, Delimiter::Parenthesis, inner_tokens)) => {
@@ -501,9 +501,9 @@ impl NestedMetaItem {
         self.meta_item().is_some()
     }
 
-    fn from_tokens<I>(tokens: &mut iter::Peekable<I>) -> Option<NestedMetaItem>
+    fn from_tokens<'a, I>(tokens: &mut iter::Peekable<I>) -> Option<NestedMetaItem>
     where
-        I: Iterator<Item = TokenTree>,
+        I: Iterator<Item = &'a TokenTree>,
     {
         match tokens.peek() {
             Some(TokenTree::Token(token, _))
@@ -513,9 +513,8 @@ impl NestedMetaItem {
                 return Some(NestedMetaItem::Lit(lit));
             }
             Some(TokenTree::Delimited(_, Delimiter::Invisible, inner_tokens)) => {
-                let inner_tokens = inner_tokens.clone();
                 tokens.next();
-                return NestedMetaItem::from_tokens(&mut inner_tokens.into_trees().peekable());
+                return NestedMetaItem::from_tokens(&mut inner_tokens.trees().peekable());
             }
             _ => {}
         }
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs
index 53a9c9a046e..84b56efd325 100644
--- a/compiler/rustc_ast/src/mut_visit.rs
+++ b/compiler/rustc_ast/src/mut_visit.rs
@@ -1149,10 +1149,11 @@ pub fn noop_flat_map_assoc_item<T: MutVisitor>(
 }
 
 fn visit_const_item<T: MutVisitor>(
-    ConstItem { defaultness, ty, expr }: &mut ConstItem,
+    ConstItem { defaultness, generics, ty, expr }: &mut ConstItem,
     visitor: &mut T,
 ) {
     visit_defaultness(defaultness, visitor);
+    visitor.visit_generics(generics);
     visitor.visit_ty(ty);
     visit_opt(expr, |expr| visitor.visit_expr(expr));
 }
diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs
index 303bdd3a307..4c920e84f86 100644
--- a/compiler/rustc_ast/src/token.rs
+++ b/compiler/rustc_ast/src/token.rs
@@ -226,7 +226,9 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool {
             .contains(&name)
 }
 
-#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
+// SAFETY: due to the `Clone` impl below, all fields of all variants other than
+// `Interpolated` must impl `Copy`.
+#[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
 pub enum TokenKind {
     /* Expression-operator symbols. */
     Eq,
@@ -299,6 +301,19 @@ pub enum TokenKind {
     Eof,
 }
 
+impl Clone for TokenKind {
+    fn clone(&self) -> Self {
+        // `TokenKind` would impl `Copy` if it weren't for `Interpolated`. So
+        // for all other variants, this implementation of `clone` is just like
+        // a copy. This is faster than the `derive(Clone)` version which has a
+        // separate path for every variant.
+        match self {
+            Interpolated(nt) => Interpolated(nt.clone()),
+            _ => unsafe { std::ptr::read(self) },
+        }
+    }
+}
+
 #[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
 pub struct Token {
     pub kind: TokenKind,
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index ca4a739abd7..348c37c480f 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -25,6 +25,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
 use rustc_span::{Span, DUMMY_SP};
 use smallvec::{smallvec, SmallVec};
 
+use std::borrow::Cow;
 use std::{fmt, iter, mem};
 
 /// When the main Rust parser encounters a syntax-extension invocation, it
@@ -98,12 +99,13 @@ impl TokenTree {
         TokenTree::Token(Token::new(kind, span), Spacing::Joint)
     }
 
-    pub fn uninterpolate(self) -> TokenTree {
+    pub fn uninterpolate(&self) -> Cow<'_, TokenTree> {
         match self {
-            TokenTree::Token(token, spacing) => {
-                TokenTree::Token(token.uninterpolate().into_owned(), spacing)
-            }
-            tt => tt,
+            TokenTree::Token(token, spacing) => match token.uninterpolate() {
+                Cow::Owned(token) => Cow::Owned(TokenTree::Token(token, *spacing)),
+                Cow::Borrowed(_) => Cow::Borrowed(self),
+            },
+            _ => Cow::Borrowed(self),
         }
     }
 }
@@ -595,26 +597,21 @@ impl<'t> Iterator for RefTokenTreeCursor<'t> {
     }
 }
 
-/// Owning by-value iterator over a [`TokenStream`], that produces `TokenTree`
+/// Owning by-value iterator over a [`TokenStream`], that produces `&TokenTree`
 /// items.
-// FIXME: Many uses of this can be replaced with by-reference iterator to avoid clones.
+///
+/// Doesn't impl `Iterator` because Rust doesn't permit an owning iterator to
+/// return `&T` from `next`; the need for an explicit lifetime in the `Item`
+/// associated type gets in the way. Instead, use `next_ref` (which doesn't
+/// involve associated types) for getting individual elements, or
+/// `RefTokenTreeCursor` if you really want an `Iterator`, e.g. in a `for`
+/// loop.
 #[derive(Clone)]
 pub struct TokenTreeCursor {
     pub stream: TokenStream,
     index: usize,
 }
 
-impl Iterator for TokenTreeCursor {
-    type Item = TokenTree;
-
-    fn next(&mut self) -> Option<TokenTree> {
-        self.stream.0.get(self.index).map(|tree| {
-            self.index += 1;
-            tree.clone()
-        })
-    }
-}
-
 impl TokenTreeCursor {
     fn new(stream: TokenStream) -> Self {
         TokenTreeCursor { stream, index: 0 }
diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs
index d9de5b8e197..aed24e11c4e 100644
--- a/compiler/rustc_ast/src/visit.rs
+++ b/compiler/rustc_ast/src/visit.rs
@@ -308,8 +308,12 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
     match &item.kind {
         ItemKind::ExternCrate(_) => {}
         ItemKind::Use(use_tree) => visitor.visit_use_tree(use_tree, item.id, false),
-        ItemKind::Static(box StaticItem { ty, mutability: _, expr })
-        | ItemKind::Const(box ConstItem { ty, expr, .. }) => {
+        ItemKind::Static(box StaticItem { ty, mutability: _, expr }) => {
+            visitor.visit_ty(ty);
+            walk_list!(visitor, visit_expr, expr);
+        }
+        ItemKind::Const(box ConstItem { defaultness: _, generics, ty, expr }) => {
+            visitor.visit_generics(generics);
             visitor.visit_ty(ty);
             walk_list!(visitor, visit_expr, expr);
         }
@@ -677,7 +681,8 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem,
     visitor.visit_ident(ident);
     walk_list!(visitor, visit_attribute, attrs);
     match kind {
-        AssocItemKind::Const(box ConstItem { ty, expr, .. }) => {
+        AssocItemKind::Const(box ConstItem { defaultness: _, generics, ty, expr }) => {
+            visitor.visit_generics(generics);
             visitor.visit_ty(ty);
             walk_list!(visitor, visit_expr, expr);
         }
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs
index 2f58f566c81..5a0474dbc01 100644
--- a/compiler/rustc_ast_lowering/src/item.rs
+++ b/compiler/rustc_ast_lowering/src/item.rs
@@ -231,9 +231,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
                 let (ty, body_id) = self.lower_const_item(t, span, e.as_deref());
                 hir::ItemKind::Static(ty, *m, body_id)
             }
-            ItemKind::Const(box ast::ConstItem { ty, expr, .. }) => {
-                let (ty, body_id) = self.lower_const_item(ty, span, expr.as_deref());
-                hir::ItemKind::Const(ty, body_id)
+            ItemKind::Const(box ast::ConstItem { generics, ty, expr, .. }) => {
+                let (generics, (ty, body_id)) = self.lower_generics(
+                    generics,
+                    Const::No,
+                    id,
+                    &ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
+                    |this| this.lower_const_item(ty, span, expr.as_deref()),
+                );
+                hir::ItemKind::Const(ty, generics, body_id)
             }
             ItemKind::Fn(box Fn {
                 sig: FnSig { decl, header, span: fn_sig_span },
@@ -715,11 +721,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
         let trait_item_def_id = hir_id.expect_owner();
 
         let (generics, kind, has_default) = match &i.kind {
-            AssocItemKind::Const(box ConstItem { ty, expr, .. }) => {
-                let ty =
-                    self.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
-                let body = expr.as_ref().map(|x| self.lower_const_body(i.span, Some(x)));
-                (hir::Generics::empty(), hir::TraitItemKind::Const(ty, body), body.is_some())
+            AssocItemKind::Const(box ConstItem { generics, ty, expr, .. }) => {
+                let (generics, kind) = self.lower_generics(
+                    &generics,
+                    Const::No,
+                    i.id,
+                    &ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
+                    |this| {
+                        let ty = this.lower_ty(
+                            ty,
+                            &ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy),
+                        );
+                        let body = expr.as_ref().map(|x| this.lower_const_body(i.span, Some(x)));
+
+                        hir::TraitItemKind::Const(ty, body)
+                    },
+                );
+                (generics, kind, expr.is_some())
             }
             AssocItemKind::Fn(box Fn { sig, generics, body: None, .. }) => {
                 let asyncness = sig.header.asyncness;
@@ -817,14 +835,19 @@ impl<'hir> LoweringContext<'_, 'hir> {
         self.lower_attrs(hir_id, &i.attrs);
 
         let (generics, kind) = match &i.kind {
-            AssocItemKind::Const(box ConstItem { ty, expr, .. }) => {
-                let ty =
-                    self.lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
-                (
-                    hir::Generics::empty(),
-                    hir::ImplItemKind::Const(ty, self.lower_const_body(i.span, expr.as_deref())),
-                )
-            }
+            AssocItemKind::Const(box ConstItem { generics, ty, expr, .. }) => self.lower_generics(
+                &generics,
+                Const::No,
+                i.id,
+                &ImplTraitContext::Disallowed(ImplTraitPosition::Generic),
+                |this| {
+                    let ty = this
+                        .lower_ty(ty, &ImplTraitContext::Disallowed(ImplTraitPosition::ConstTy));
+                    let body = this.lower_const_body(i.span, expr.as_deref());
+
+                    hir::ImplItemKind::Const(ty, body)
+                },
+            ),
             AssocItemKind::Fn(box Fn { sig, generics, body, .. }) => {
                 self.current_item = Some(i.span);
                 let asyncness = sig.header.asyncness;
diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs
index 418e1df5857..af594a00705 100644
--- a/compiler/rustc_ast_passes/src/ast_validation.rs
+++ b/compiler/rustc_ast_passes/src/ast_validation.rs
@@ -659,7 +659,7 @@ fn validate_generic_param_order(
             GenericParamKind::Type { .. } => (ParamKindOrd::TypeOrConst, ident.to_string()),
             GenericParamKind::Const { ty, .. } => {
                 let ty = pprust::ty_to_string(ty);
-                (ParamKindOrd::TypeOrConst, format!("const {}: {}", ident, ty))
+                (ParamKindOrd::TypeOrConst, format!("const {ident}: {ty}"))
             }
         };
         param_idents.push((kind, ord_kind, bounds, idx, ident));
@@ -1463,15 +1463,12 @@ fn deny_equality_constraints(
                                             let Some(arg) = args.args.last() else {
                                                 continue;
                                             };
-                                            (
-                                                format!(", {} = {}", assoc, ty),
-                                                arg.span().shrink_to_hi(),
-                                            )
+                                            (format!(", {assoc} = {ty}"), arg.span().shrink_to_hi())
                                         }
                                         _ => continue,
                                     },
                                     None => (
-                                        format!("<{} = {}>", assoc, ty),
+                                        format!("<{assoc} = {ty}>"),
                                         trait_segment.span().shrink_to_hi(),
                                     ),
                                 };
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs
index b0dbc2c2340..c4efad7caf2 100644
--- a/compiler/rustc_ast_passes/src/feature_gate.rs
+++ b/compiler/rustc_ast_passes/src/feature_gate.rs
@@ -218,6 +218,19 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                 }
             }
         }
+        if !attr.is_doc_comment()
+            && attr.get_normal_item().path.segments.len() == 2
+            && attr.get_normal_item().path.segments[0].ident.name == sym::diagnostic
+            && !self.features.diagnostic_namespace
+        {
+            let msg = "`#[diagnostic]` attribute name space is experimental";
+            gate_feature_post!(
+                self,
+                diagnostic_namespace,
+                attr.get_normal_item().path.segments[0].ident.span,
+                msg
+            );
+        }
 
         // Emit errors for non-staged-api crates.
         if !self.features.staged_api {
@@ -556,6 +569,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
     gate_all!(const_closures, "const closures are experimental");
     gate_all!(builtin_syntax, "`builtin #` syntax is unstable");
     gate_all!(explicit_tail_calls, "`become` expression is experimental");
+    gate_all!(generic_const_items, "generic const items are experimental");
 
     if !visitor.features.negative_bounds {
         for &span in spans.get(&sym::negative_bounds).iter().copied().flatten() {
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
index 5c01b7ea70a..d27a44f1206 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
@@ -30,10 +30,15 @@ impl<'a> State<'a> {
             ast::ForeignItemKind::Fn(box ast::Fn { defaultness, sig, generics, body }) => {
                 self.print_fn_full(sig, ident, generics, vis, *defaultness, body.as_deref(), attrs);
             }
-            ast::ForeignItemKind::Static(ty, mutbl, body) => {
-                let def = ast::Defaultness::Final;
-                self.print_item_const(ident, Some(*mutbl), ty, body.as_deref(), vis, def);
-            }
+            ast::ForeignItemKind::Static(ty, mutbl, body) => self.print_item_const(
+                ident,
+                Some(*mutbl),
+                &ast::Generics::default(),
+                ty,
+                body.as_deref(),
+                vis,
+                ast::Defaultness::Final,
+            ),
             ast::ForeignItemKind::TyAlias(box ast::TyAlias {
                 defaultness,
                 generics,
@@ -67,6 +72,7 @@ impl<'a> State<'a> {
         &mut self,
         ident: Ident,
         mutbl: Option<ast::Mutability>,
+        generics: &ast::Generics,
         ty: &ast::Ty,
         body: Option<&ast::Expr>,
         vis: &ast::Visibility,
@@ -82,6 +88,7 @@ impl<'a> State<'a> {
         };
         self.word_space(leading);
         self.print_ident(ident);
+        self.print_generic_params(&generics.params);
         self.word_space(":");
         self.print_type(ty);
         if body.is_some() {
@@ -92,6 +99,7 @@ impl<'a> State<'a> {
             self.word_space("=");
             self.print_expr(body);
         }
+        self.print_where_clause(&generics.where_clause);
         self.word(";");
         self.end(); // end the outer cbox
     }
@@ -158,20 +166,21 @@ impl<'a> State<'a> {
                 self.word(";");
             }
             ast::ItemKind::Static(box StaticItem { ty, mutability: mutbl, expr: body }) => {
-                let def = ast::Defaultness::Final;
                 self.print_item_const(
                     item.ident,
                     Some(*mutbl),
+                    &ast::Generics::default(),
                     ty,
                     body.as_deref(),
                     &item.vis,
-                    def,
+                    ast::Defaultness::Final,
                 );
             }
-            ast::ItemKind::Const(box ast::ConstItem { defaultness, ty, expr }) => {
+            ast::ItemKind::Const(box ast::ConstItem { defaultness, generics, ty, expr }) => {
                 self.print_item_const(
                     item.ident,
                     None,
+                    generics,
                     ty,
                     expr.as_deref(),
                     &item.vis,
@@ -515,8 +524,16 @@ impl<'a> State<'a> {
             ast::AssocItemKind::Fn(box ast::Fn { defaultness, sig, generics, body }) => {
                 self.print_fn_full(sig, ident, generics, vis, *defaultness, body.as_deref(), attrs);
             }
-            ast::AssocItemKind::Const(box ast::ConstItem { defaultness, ty, expr }) => {
-                self.print_item_const(ident, None, ty, expr.as_deref(), vis, *defaultness);
+            ast::AssocItemKind::Const(box ast::ConstItem { defaultness, generics, ty, expr }) => {
+                self.print_item_const(
+                    ident,
+                    None,
+                    generics,
+                    ty,
+                    expr.as_deref(),
+                    vis,
+                    *defaultness,
+                );
             }
             ast::AssocItemKind::Type(box ast::TyAlias {
                 defaultness,
diff --git a/compiler/rustc_borrowck/src/borrowck_errors.rs b/compiler/rustc_borrowck/src/borrowck_errors.rs
index a4e0e773a81..a2c7e767b4c 100644
--- a/compiler/rustc_borrowck/src/borrowck_errors.rs
+++ b/compiler/rustc_borrowck/src/borrowck_errors.rs
@@ -37,8 +37,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
             desc,
         );
 
-        err.span_label(borrow_span, format!("{} is borrowed here", borrow_desc));
-        err.span_label(span, format!("use of borrowed {}", borrow_desc));
+        err.span_label(borrow_span, format!("{borrow_desc} is borrowed here"));
+        err.span_label(span, format!("use of borrowed {borrow_desc}"));
         err
     }
 
@@ -51,8 +51,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
         old_opt_via: &str,
         old_load_end_span: Option<Span>,
     ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
-        let via =
-            |msg: &str| if msg.is_empty() { "".to_string() } else { format!(" (via {})", msg) };
+        let via = |msg: &str| if msg.is_empty() { "".to_string() } else { format!(" (via {msg})") };
         let mut err = struct_span_err!(
             self,
             new_loan_span,
@@ -143,9 +142,9 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
         );
         err.span_label(
             new_loan_span,
-            format!("{} construction occurs here{}", container_name, opt_via),
+            format!("{container_name} construction occurs here{opt_via}"),
         );
-        err.span_label(old_loan_span, format!("borrow occurs here{}", old_opt_via));
+        err.span_label(old_loan_span, format!("borrow occurs here{old_opt_via}"));
         if let Some(previous_end_span) = previous_end_span {
             err.span_label(previous_end_span, "borrow ends here");
         }
@@ -173,13 +172,10 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
             opt_via,
             kind_new,
         );
-        err.span_label(
-            new_loan_span,
-            format!("{}borrow occurs here{}", second_borrow_desc, opt_via),
-        );
+        err.span_label(new_loan_span, format!("{second_borrow_desc}borrow occurs here{opt_via}"));
         err.span_label(
             old_loan_span,
-            format!("{} construction occurs here{}", container_name, old_opt_via),
+            format!("{container_name} construction occurs here{old_opt_via}"),
         );
         if let Some(previous_end_span) = previous_end_span {
             err.span_label(previous_end_span, "borrow from closure ends here");
@@ -199,8 +195,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
         msg_old: &str,
         old_load_end_span: Option<Span>,
     ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
-        let via =
-            |msg: &str| if msg.is_empty() { "".to_string() } else { format!(" (via {})", msg) };
+        let via = |msg: &str| if msg.is_empty() { "".to_string() } else { format!(" (via {msg})") };
         let mut err = struct_span_err!(
             self,
             span,
@@ -216,22 +211,21 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
 
         if msg_new == "" {
             // If `msg_new` is empty, then this isn't a borrow of a union field.
-            err.span_label(span, format!("{} borrow occurs here", kind_new));
-            err.span_label(old_span, format!("{} borrow occurs here", kind_old));
+            err.span_label(span, format!("{kind_new} borrow occurs here"));
+            err.span_label(old_span, format!("{kind_old} borrow occurs here"));
         } else {
             // If `msg_new` isn't empty, then this a borrow of a union field.
             err.span_label(
                 span,
                 format!(
-                    "{} borrow of {} -- which overlaps with {} -- occurs here",
-                    kind_new, msg_new, msg_old,
+                    "{kind_new} borrow of {msg_new} -- which overlaps with {msg_old} -- occurs here",
                 ),
             );
             err.span_label(old_span, format!("{} borrow occurs here{}", kind_old, via(msg_old)));
         }
 
         if let Some(old_load_end_span) = old_load_end_span {
-            err.span_label(old_load_end_span, format!("{} borrow ends here", kind_old));
+            err.span_label(old_load_end_span, format!("{kind_old} borrow ends here"));
         }
         err
     }
@@ -250,8 +244,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
             desc,
         );
 
-        err.span_label(borrow_span, format!("{} is borrowed here", desc));
-        err.span_label(span, format!("{} is assigned to here but it was already borrowed", desc));
+        err.span_label(borrow_span, format!("{desc} is borrowed here"));
+        err.span_label(span, format!("{desc} is assigned to here but it was already borrowed"));
         err
     }
 
@@ -330,7 +324,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
         optional_adverb_for_moved: &str,
         moved_path: Option<String>,
     ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
-        let moved_path = moved_path.map(|mp| format!(": `{}`", mp)).unwrap_or_default();
+        let moved_path = moved_path.map(|mp| format!(": `{mp}`")).unwrap_or_default();
 
         struct_span_err!(
             self,
@@ -369,8 +363,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
             immutable_place,
             immutable_section,
         );
-        err.span_label(mutate_span, format!("cannot {}", action));
-        err.span_label(immutable_span, format!("value is immutable in {}", immutable_section));
+        err.span_label(mutate_span, format!("cannot {action}"));
+        err.span_label(immutable_span, format!("value is immutable in {immutable_section}"));
         err
     }
 
@@ -428,7 +422,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
 
         err.span_label(
             span,
-            format!("{}s a {} data owned by the current function", return_kind, reference_desc),
+            format!("{return_kind}s a {reference_desc} data owned by the current function"),
         );
 
         err
@@ -449,8 +443,8 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
             "{closure_kind} may outlive the current {scope}, but it borrows {borrowed_path}, \
              which is owned by the current {scope}",
         );
-        err.span_label(capture_span, format!("{} is borrowed here", borrowed_path))
-            .span_label(closure_span, format!("may outlive borrowed value {}", borrowed_path));
+        err.span_label(capture_span, format!("{borrowed_path} is borrowed here"))
+            .span_label(closure_span, format!("may outlive borrowed value {borrowed_path}"));
         err
     }
 
diff --git a/compiler/rustc_borrowck/src/dataflow.rs b/compiler/rustc_borrowck/src/dataflow.rs
index 1064b44d2cd..1e89a9f5144 100644
--- a/compiler/rustc_borrowck/src/dataflow.rs
+++ b/compiler/rustc_borrowck/src/dataflow.rs
@@ -360,7 +360,7 @@ impl<'tcx> rustc_mir_dataflow::GenKillAnalysis<'tcx> for Borrows<'_, 'tcx> {
                         return;
                     }
                     let index = self.borrow_set.get_index_of(&location).unwrap_or_else(|| {
-                        panic!("could not find BorrowIndex for location {:?}", location);
+                        panic!("could not find BorrowIndex for location {location:?}");
                     });
 
                     trans.gen(index);
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
index 97c3e0b879a..03b90f4ab18 100644
--- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
@@ -653,7 +653,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             err.span_suggestion_verbose(
                 sugg_span.shrink_to_hi(),
                 "consider assigning a value",
-                format!(" = {}", assign_value),
+                format!(" = {assign_value}"),
                 Applicability::MaybeIncorrect,
             );
         }
@@ -738,7 +738,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
         // Try to find predicates on *generic params* that would allow copying `ty`
         let suggestion =
             if let Some(symbol) = tcx.hir().maybe_get_struct_pattern_shorthand_field(expr) {
-                format!(": {}.clone()", symbol)
+                format!(": {symbol}.clone()")
             } else {
                 ".clone()".to_owned()
             };
@@ -1162,8 +1162,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
 
         if union_type_name != "" {
             err.note(format!(
-                "{} is a field of the union `{}`, so it overlaps the field {}",
-                msg_place, union_type_name, msg_borrow,
+                "{msg_place} is a field of the union `{union_type_name}`, so it overlaps the field {msg_borrow}",
             ));
         }
 
@@ -1353,8 +1352,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                 let Some(trait_did) = tcx.trait_of_item(def_id) &&
                 tcx.is_diagnostic_item(sym::Iterator, trait_did) {
                     err.note(format!(
-                        "a for loop advances the iterator for you, the result is stored in `{}`.",
-                        loop_bind
+                        "a for loop advances the iterator for you, the result is stored in `{loop_bind}`."
                     ));
                     err.help("if you want to call `next` on a iterator within the loop, consider using `while let`.");
         }
@@ -1825,7 +1823,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                     },
                     ConstraintCategory::CallArgument(None),
                     var_or_use_span,
-                    &format!("`{}`", name),
+                    &format!("`{name}`"),
                     "block",
                 ),
             (
@@ -1847,7 +1845,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                     region_name,
                     category,
                     span,
-                    &format!("`{}`", name),
+                    &format!("`{name}`"),
                     "function",
                 ),
             (
@@ -1921,14 +1919,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             }
         }
 
-        let mut err = self.path_does_not_live_long_enough(borrow_span, &format!("`{}`", name));
+        let mut err = self.path_does_not_live_long_enough(borrow_span, &format!("`{name}`"));
 
         if let Some(annotation) = self.annotate_argument_and_return_for_borrow(borrow) {
             let region_name = annotation.emit(self, &mut err);
 
             err.span_label(
                 borrow_span,
-                format!("`{}` would have to be valid for `{}`...", name, region_name),
+                format!("`{name}` would have to be valid for `{region_name}`..."),
             );
 
             err.span_label(
@@ -1939,7 +1937,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                     self.infcx
                         .tcx
                         .opt_item_name(self.mir_def_id().to_def_id())
-                        .map(|name| format!("function `{}`", name))
+                        .map(|name| format!("function `{name}`"))
                         .unwrap_or_else(|| {
                             match &self.infcx.tcx.def_kind(self.mir_def_id()) {
                                 DefKind::Closure => "enclosing closure",
@@ -1974,7 +1972,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             }
         } else {
             err.span_label(borrow_span, "borrowed value does not live long enough");
-            err.span_label(drop_span, format!("`{}` dropped here while still borrowed", name));
+            err.span_label(drop_span, format!("`{name}` dropped here while still borrowed"));
 
             borrow_spans.args_subdiag(&mut err, |args_span| {
                 crate::session_diagnostics::CaptureArgLabel::Capture {
@@ -2018,22 +2016,17 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
         let mut err = self.cannot_borrow_across_destructor(borrow_span);
 
         let what_was_dropped = match self.describe_place(place.as_ref()) {
-            Some(name) => format!("`{}`", name),
+            Some(name) => format!("`{name}`"),
             None => String::from("temporary value"),
         };
 
         let label = match self.describe_place(borrow.borrowed_place.as_ref()) {
             Some(borrowed) => format!(
-                "here, drop of {D} needs exclusive access to `{B}`, \
-                 because the type `{T}` implements the `Drop` trait",
-                D = what_was_dropped,
-                T = dropped_ty,
-                B = borrowed
+                "here, drop of {what_was_dropped} needs exclusive access to `{borrowed}`, \
+                 because the type `{dropped_ty}` implements the `Drop` trait"
             ),
             None => format!(
-                "here is drop of {D}; whose type `{T}` implements the `Drop` trait",
-                D = what_was_dropped,
-                T = dropped_ty
+                "here is drop of {what_was_dropped}; whose type `{dropped_ty}` implements the `Drop` trait"
             ),
         };
         err.span_label(drop_span, label);
@@ -2245,10 +2238,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             } else {
                 "local data "
             };
-            (
-                format!("{}`{}`", local_kind, place_desc),
-                format!("`{}` is borrowed here", place_desc),
-            )
+            (format!("{local_kind}`{place_desc}`"), format!("`{place_desc}` is borrowed here"))
         } else {
             let root_place =
                 self.prefixes(borrow.borrowed_place.as_ref(), PrefixSet::All).last().unwrap();
@@ -2350,9 +2340,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
         err.span_suggestion_verbose(
             sugg_span,
             format!(
-                "to force the {} to take ownership of {} (and any \
-                 other referenced variables), use the `move` keyword",
-                kind, captured_var
+                "to force the {kind} to take ownership of {captured_var} (and any \
+                 other referenced variables), use the `move` keyword"
             ),
             suggestion,
             Applicability::MachineApplicable,
@@ -2360,7 +2349,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
 
         match category {
             ConstraintCategory::Return(_) | ConstraintCategory::OpaqueType => {
-                let msg = format!("{} is returned here", kind);
+                let msg = format!("{kind} is returned here");
                 err.span_note(constraint_span, msg);
             }
             ConstraintCategory::CallArgument(_) => {
@@ -2402,21 +2391,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
 
         err.span_label(
             upvar_span,
-            format!("`{}` declared here, outside of the {} body", upvar_name, escapes_from),
+            format!("`{upvar_name}` declared here, outside of the {escapes_from} body"),
         );
 
-        err.span_label(borrow_span, format!("borrow is only valid in the {} body", escapes_from));
+        err.span_label(borrow_span, format!("borrow is only valid in the {escapes_from} body"));
 
         if let Some(name) = name {
             err.span_label(
                 escape_span,
-                format!("reference to `{}` escapes the {} body here", name, escapes_from),
+                format!("reference to `{name}` escapes the {escapes_from} body here"),
             );
         } else {
-            err.span_label(
-                escape_span,
-                format!("reference escapes the {} body here", escapes_from),
-            );
+            err.span_label(escape_span, format!("reference escapes the {escapes_from} body here"));
         }
 
         err
@@ -2697,10 +2683,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                     });
                 if let Some(Ok(instance)) = deref_target {
                     let deref_target_ty = instance.ty(tcx, self.param_env);
-                    err.note(format!(
-                        "borrow occurs due to deref coercion to `{}`",
-                        deref_target_ty
-                    ));
+                    err.note(format!("borrow occurs due to deref coercion to `{deref_target_ty}`"));
                     err.span_note(tcx.def_span(instance.def_id()), "deref defined here");
                 }
             }
@@ -2756,7 +2739,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             "cannot assign twice to immutable variable"
         };
         if span != assigned_span && !from_arg {
-            err.span_label(assigned_span, format!("first assignment to {}", place_description));
+            err.span_label(assigned_span, format!("first assignment to {place_description}"));
         }
         if let Some(decl) = local_decl
             && let Some(name) = local_name
@@ -2765,7 +2748,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
             err.span_suggestion(
                 decl.source_info.span,
                 "consider making this binding mutable",
-                format!("mut {}", name),
+                format!("mut {name}"),
                 Applicability::MachineApplicable,
             );
         }
@@ -3226,7 +3209,7 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
                 return_span,
             } => {
                 let argument_ty_name = cx.get_name_for_ty(argument_ty, 0);
-                diag.span_label(argument_span, format!("has type `{}`", argument_ty_name));
+                diag.span_label(argument_span, format!("has type `{argument_ty_name}`"));
 
                 let return_ty_name = cx.get_name_for_ty(return_ty, 0);
                 let types_equal = return_ty_name == argument_ty_name;
@@ -3253,15 +3236,14 @@ impl<'tcx> AnnotatedBorrowFnSignature<'tcx> {
                 // Region of return type and arguments checked to be the same earlier.
                 let region_name = cx.get_region_name_for_ty(*return_ty, 0);
                 for (_, argument_span) in arguments {
-                    diag.span_label(*argument_span, format!("has lifetime `{}`", region_name));
+                    diag.span_label(*argument_span, format!("has lifetime `{region_name}`"));
                 }
 
-                diag.span_label(*return_span, format!("also has lifetime `{}`", region_name,));
+                diag.span_label(*return_span, format!("also has lifetime `{region_name}`",));
 
                 diag.help(format!(
-                    "use data from the highlighted arguments which match the `{}` lifetime of \
+                    "use data from the highlighted arguments which match the `{region_name}` lifetime of \
                      the return type",
-                    region_name,
                 ));
 
                 region_name
diff --git a/compiler/rustc_borrowck/src/facts.rs b/compiler/rustc_borrowck/src/facts.rs
index 87fad9a355d..9916ebca32f 100644
--- a/compiler/rustc_borrowck/src/facts.rs
+++ b/compiler/rustc_borrowck/src/facts.rs
@@ -202,7 +202,7 @@ trait FactCell {
 
 impl<A: Debug> FactCell for A {
     default fn to_string(&self, _location_table: &LocationTable) -> String {
-        format!("{:?}", self)
+        format!("{self:?}")
     }
 }
 
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs
index 2fd42e2f56a..ba1d31ee002 100644
--- a/compiler/rustc_borrowck/src/lib.rs
+++ b/compiler/rustc_borrowck/src/lib.rs
@@ -1817,8 +1817,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                 }
 
                 ProjectionElem::Subslice { .. } => {
-                    panic!("we don't allow assignments to subslices, location: {:?}",
-                           location);
+                    panic!("we don't allow assignments to subslices, location: {location:?}");
                 }
 
                 ProjectionElem::Field(..) => {
@@ -2017,8 +2016,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
                     self.infcx.tcx.sess.delay_span_bug(
                         span,
                         format!(
-                            "Accessing `{:?}` with the kind `{:?}` shouldn't be possible",
-                            place, kind,
+                            "Accessing `{place:?}` with the kind `{kind:?}` shouldn't be possible",
                         ),
                     );
                 }
diff --git a/compiler/rustc_borrowck/src/nll.rs b/compiler/rustc_borrowck/src/nll.rs
index b5014a3f479..679a19710a7 100644
--- a/compiler/rustc_borrowck/src/nll.rs
+++ b/compiler/rustc_borrowck/src/nll.rs
@@ -347,7 +347,7 @@ pub(super) fn dump_mir_results<'tcx>(
                     for_each_region_constraint(
                         infcx.tcx,
                         closure_region_requirements,
-                        &mut |msg| writeln!(out, "| {}", msg),
+                        &mut |msg| writeln!(out, "| {msg}"),
                     )?;
                     writeln!(out, "|")?;
                 }
@@ -426,7 +426,7 @@ pub(super) fn dump_annotation<'tcx>(
     };
 
     if !opaque_type_values.is_empty() {
-        err.note(format!("Inferred opaque type values:\n{:#?}", opaque_type_values));
+        err.note(format!("Inferred opaque type values:\n{opaque_type_values:#?}"));
     }
 
     errors.buffer_non_error_diag(err);
@@ -439,7 +439,7 @@ fn for_each_region_constraint<'tcx>(
 ) -> io::Result<()> {
     for req in &closure_region_requirements.outlives_requirements {
         let subject = match req.subject {
-            ClosureOutlivesSubject::Region(subject) => format!("{:?}", subject),
+            ClosureOutlivesSubject::Region(subject) => format!("{subject:?}"),
             ClosureOutlivesSubject::Ty(ty) => {
                 format!("{:?}", ty.instantiate(tcx, |vid| ty::Region::new_var(tcx, vid)))
             }
diff --git a/compiler/rustc_borrowck/src/region_infer/dump_mir.rs b/compiler/rustc_borrowck/src/region_infer/dump_mir.rs
index 6524b594e44..4d620ac9de6 100644
--- a/compiler/rustc_borrowck/src/region_infer/dump_mir.rs
+++ b/compiler/rustc_borrowck/src/region_infer/dump_mir.rs
@@ -52,7 +52,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
 
         writeln!(out, "|")?;
         writeln!(out, "| Inference Constraints")?;
-        self.for_each_constraint(tcx, &mut |msg| writeln!(out, "| {}", msg))?;
+        self.for_each_constraint(tcx, &mut |msg| writeln!(out, "| {msg}"))?;
 
         Ok(())
     }
@@ -69,7 +69,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
         for region in self.definitions.indices() {
             let value = self.liveness_constraints.region_value_str(region);
             if value != "{}" {
-                with_msg(&format!("{:?} live at {}", region, value))?;
+                with_msg(&format!("{region:?} live at {value}"))?;
             }
         }
 
@@ -81,12 +81,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                 Locations::All(span) => {
                     ("All", tcx.sess.source_map().span_to_embeddable_string(*span))
                 }
-                Locations::Single(loc) => ("Single", format!("{:?}", loc)),
+                Locations::Single(loc) => ("Single", format!("{loc:?}")),
             };
-            with_msg(&format!(
-                "{:?}: {:?} due to {:?} at {}({}) ({:?}",
-                sup, sub, category, name, arg, span
-            ))?;
+            with_msg(&format!("{sup:?}: {sub:?} due to {category:?} at {name}({arg}) ({span:?}"))?;
         }
 
         Ok(())
diff --git a/compiler/rustc_borrowck/src/region_infer/graphviz.rs b/compiler/rustc_borrowck/src/region_infer/graphviz.rs
index 2e15586e03b..a0cf22e935a 100644
--- a/compiler/rustc_borrowck/src/region_infer/graphviz.rs
+++ b/compiler/rustc_borrowck/src/region_infer/graphviz.rs
@@ -49,7 +49,7 @@ impl<'a, 'this, 'tcx> dot::Labeller<'this> for RawConstraints<'a, 'tcx> {
         Some(dot::LabelText::LabelStr(Cow::Borrowed("box")))
     }
     fn node_label(&'this self, n: &RegionVid) -> dot::LabelText<'this> {
-        dot::LabelText::LabelStr(format!("{:?}", n).into())
+        dot::LabelText::LabelStr(format!("{n:?}").into())
     }
     fn edge_label(&'this self, e: &OutlivesConstraint<'tcx>) -> dot::LabelText<'this> {
         dot::LabelText::LabelStr(format!("{:?}", e.locations).into())
@@ -100,7 +100,7 @@ impl<'a, 'this, 'tcx> dot::Labeller<'this> for SccConstraints<'a, 'tcx> {
     }
     fn node_label(&'this self, n: &ConstraintSccIndex) -> dot::LabelText<'this> {
         let nodes = &self.nodes_per_scc[*n];
-        dot::LabelText::LabelStr(format!("{:?} = {:?}", n, nodes).into())
+        dot::LabelText::LabelStr(format!("{n:?} = {nodes:?}").into())
     }
 }
 
diff --git a/compiler/rustc_borrowck/src/region_infer/mod.rs b/compiler/rustc_borrowck/src/region_infer/mod.rs
index fbbccc58ad6..30dfb2d919a 100644
--- a/compiler/rustc_borrowck/src/region_infer/mod.rs
+++ b/compiler/rustc_borrowck/src/region_infer/mod.rs
@@ -259,7 +259,7 @@ fn sccs_info<'cx, 'tcx>(
 
     let mut reg_vars_to_origins_str = "region variables to origins:\n".to_string();
     for (reg_var, origin) in var_to_origin_sorted.into_iter() {
-        reg_vars_to_origins_str.push_str(&format!("{:?}: {:?}\n", reg_var, origin));
+        reg_vars_to_origins_str.push_str(&format!("{reg_var:?}: {origin:?}\n"));
     }
     debug!("{}", reg_vars_to_origins_str);
 
diff --git a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
index 17a4f2d76b6..90bde88f792 100644
--- a/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
+++ b/compiler/rustc_borrowck/src/region_infer/opaque_types.rs
@@ -419,7 +419,7 @@ fn check_opaque_type_parameter_valid(
             return Err(tcx
                 .sess
                 .struct_span_err(span, "non-defining opaque type use in defining scope")
-                .span_note(spans, format!("{} used multiple times", descr))
+                .span_note(spans, format!("{descr} used multiple times"))
                 .emit());
         }
     }
diff --git a/compiler/rustc_borrowck/src/region_infer/values.rs b/compiler/rustc_borrowck/src/region_infer/values.rs
index 9290e747914..d205862cd3f 100644
--- a/compiler/rustc_borrowck/src/region_infer/values.rs
+++ b/compiler/rustc_borrowck/src/region_infer/values.rs
@@ -470,7 +470,7 @@ fn region_value_str(elements: impl IntoIterator<Item = RegionElement>) -> String
                 }
 
                 push_sep(&mut result);
-                result.push_str(&format!("{:?}", fr));
+                result.push_str(&format!("{fr:?}"));
             }
 
             RegionElement::PlaceholderRegion(placeholder) => {
@@ -481,7 +481,7 @@ fn region_value_str(elements: impl IntoIterator<Item = RegionElement>) -> String
                 }
 
                 push_sep(&mut result);
-                result.push_str(&format!("{:?}", placeholder));
+                result.push_str(&format!("{placeholder:?}"));
             }
         }
     }
@@ -497,7 +497,7 @@ fn region_value_str(elements: impl IntoIterator<Item = RegionElement>) -> String
 
     fn push_location_range(str: &mut String, location1: Location, location2: Location) {
         if location1 == location2 {
-            str.push_str(&format!("{:?}", location1));
+            str.push_str(&format!("{location1:?}"));
         } else {
             assert_eq!(location1.block, location2.block);
             str.push_str(&format!(
diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs
index 78aa513033c..fd4a3ec1a5e 100644
--- a/compiler/rustc_borrowck/src/type_check/mod.rs
+++ b/compiler/rustc_borrowck/src/type_check/mod.rs
@@ -409,18 +409,12 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
             }
 
             if let ty::FnDef(def_id, args) = *constant.literal.ty().kind() {
-                // const_trait_impl: use a non-const param env when checking that a FnDef type is well formed.
-                // this is because the well-formedness of the function does not need to be proved to have `const`
-                // impls for trait bounds.
                 let instantiated_predicates = tcx.predicates_of(def_id).instantiate(tcx, args);
-                let prev = self.cx.param_env;
-                self.cx.param_env = prev.without_const();
                 self.cx.normalize_and_prove_instantiated_predicates(
                     def_id,
                     instantiated_predicates,
                     locations,
                 );
-                self.cx.param_env = prev;
             }
         }
     }
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs
index 21f45935218..9e66eaf73b3 100644
--- a/compiler/rustc_builtin_macros/src/asm.rs
+++ b/compiler/rustc_builtin_macros/src/asm.rs
@@ -575,7 +575,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
                                 || named_pos.contains_key(&idx)
                                 || args.reg_args.contains(idx)
                             {
-                                let msg = format!("invalid reference to argument at index {}", idx);
+                                let msg = format!("invalid reference to argument at index {idx}");
                                 let mut err = ecx.struct_span_err(span, msg);
                                 err.span_label(span, "from here");
 
@@ -588,9 +588,9 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
                                     ""
                                 };
                                 let msg = match positional_args {
-                                    0 => format!("no {}arguments were given", positional),
-                                    1 => format!("there is 1 {}argument", positional),
-                                    x => format!("there are {} {}arguments", x, positional),
+                                    0 => format!("no {positional}arguments were given"),
+                                    1 => format!("there is 1 {positional}argument"),
+                                    x => format!("there are {x} {positional}arguments"),
                                 };
                                 err.note(msg);
 
@@ -624,7 +624,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
                             match args.named_args.get(&Symbol::intern(name)) {
                                 Some(&idx) => Some(idx),
                                 None => {
-                                    let msg = format!("there is no argument named `{}`", name);
+                                    let msg = format!("there is no argument named `{name}`");
                                     let span = arg.position_span;
                                     ecx.struct_span_err(
                                         template_span
@@ -697,8 +697,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
             err.span_label(sp, msg);
             err.help(format!(
                 "if this argument is intentionally unused, \
-                 consider using it in an asm comment: `\"/*{} */\"`",
-                help_str
+                 consider using it in an asm comment: `\"/*{help_str} */\"`"
             ));
             err.emit();
         }
@@ -712,8 +711,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, args: AsmArgs) -> Option<ast::Inl
             }
             err.help(format!(
                 "if these arguments are intentionally unused, \
-                 consider using them in an asm comment: `\"/*{} */\"`",
-                help_str
+                 consider using them in an asm comment: `\"/*{help_str} */\"`"
             ));
             err.emit();
         }
diff --git a/compiler/rustc_builtin_macros/src/deriving/clone.rs b/compiler/rustc_builtin_macros/src/deriving/clone.rs
index 9ba98d0a5d1..b468abe3249 100644
--- a/compiler/rustc_builtin_macros/src/deriving/clone.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/clone.rs
@@ -144,7 +144,7 @@ fn cs_clone_simple(
             }
             _ => cx.span_bug(
                 trait_span,
-                format!("unexpected substructure in simple `derive({})`", name),
+                format!("unexpected substructure in simple `derive({name})`"),
             ),
         }
     }
@@ -178,10 +178,10 @@ fn cs_clone(
             vdata = &variant.data;
         }
         EnumTag(..) | AllFieldlessEnum(..) => {
-            cx.span_bug(trait_span, format!("enum tags in `derive({})`", name,))
+            cx.span_bug(trait_span, format!("enum tags in `derive({name})`",))
         }
         StaticEnum(..) | StaticStruct(..) => {
-            cx.span_bug(trait_span, format!("associated function in `derive({})`", name))
+            cx.span_bug(trait_span, format!("associated function in `derive({name})`"))
         }
     }
 
@@ -193,7 +193,7 @@ fn cs_clone(
                     let Some(ident) = field.name else {
                         cx.span_bug(
                             trait_span,
-                            format!("unnamed field in normal struct in `derive({})`", name,),
+                            format!("unnamed field in normal struct in `derive({name})`",),
                         );
                     };
                     let call = subcall(cx, field);
diff --git a/compiler/rustc_builtin_macros/src/deriving/decodable.rs b/compiler/rustc_builtin_macros/src/deriving/decodable.rs
index 3921533c84a..bcf11cb4ce9 100644
--- a/compiler/rustc_builtin_macros/src/deriving/decodable.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/decodable.rs
@@ -204,7 +204,7 @@ where
                 let fields = fields
                     .iter()
                     .enumerate()
-                    .map(|(i, &span)| getarg(cx, span, Symbol::intern(&format!("_field{}", i)), i))
+                    .map(|(i, &span)| getarg(cx, span, Symbol::intern(&format!("_field{i}")), i))
                     .collect();
 
                 cx.expr_call(trait_span, path_expr, fields)
diff --git a/compiler/rustc_builtin_macros/src/deriving/encodable.rs b/compiler/rustc_builtin_macros/src/deriving/encodable.rs
index a3b11309d0c..2dc20c32497 100644
--- a/compiler/rustc_builtin_macros/src/deriving/encodable.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/encodable.rs
@@ -173,7 +173,7 @@ fn encodable_substructure(
             for (i, &FieldInfo { name, ref self_expr, span, .. }) in fields.iter().enumerate() {
                 let name = match name {
                     Some(id) => id.name,
-                    None => Symbol::intern(&format!("_field{}", i)),
+                    None => Symbol::intern(&format!("_field{i}")),
                 };
                 let self_ref = cx.expr_addr_of(span, self_expr.clone());
                 let enc =
diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
index 9865b6a72ee..6597ee3cf1b 100644
--- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
@@ -1166,7 +1166,7 @@ impl<'a> MethodDef<'a> {
                     .iter()
                     .enumerate()
                     .skip(1)
-                    .map(|(arg_count, _selflike_arg)| format!("__arg{}", arg_count)),
+                    .map(|(arg_count, _selflike_arg)| format!("__arg{arg_count}")),
             )
             .collect::<Vec<String>>();
 
@@ -1181,7 +1181,7 @@ impl<'a> MethodDef<'a> {
         let get_tag_pieces = |cx: &ExtCtxt<'_>| {
             let tag_idents: Vec<_> = prefixes
                 .iter()
-                .map(|name| Ident::from_str_and_span(&format!("{}_tag", name), span))
+                .map(|name| Ident::from_str_and_span(&format!("{name}_tag"), span))
                 .collect();
 
             let mut tag_exprs: Vec<_> = tag_idents
@@ -1521,7 +1521,7 @@ impl<'a> TraitDef<'a> {
     }
 
     fn mk_pattern_ident(&self, prefix: &str, i: usize) -> Ident {
-        Ident::from_str_and_span(&format!("{}_{}", prefix, i), self.span)
+        Ident::from_str_and_span(&format!("{prefix}_{i}"), self.span)
     }
 
     fn create_struct_pattern_fields(
@@ -1602,8 +1602,7 @@ impl<'a> TraitDef<'a> {
                                 sp,
                                 ast::CRATE_NODE_ID,
                                 format!(
-                                    "{} slice in a packed struct that derives a built-in trait",
-                                    ty
+                                    "{ty} slice in a packed struct that derives a built-in trait"
                                 ),
                                 rustc_lint_defs::BuiltinLintDiagnostics::ByteSliceInPackedStructWithDerive
                             );
diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs
index 4c878785b7b..590db12a4cd 100644
--- a/compiler/rustc_builtin_macros/src/format.rs
+++ b/compiler/rustc_builtin_macros/src/format.rs
@@ -179,7 +179,7 @@ fn make_format_args(
                     err.span_suggestion(
                         unexpanded_fmt_span.shrink_to_lo(),
                         "you might be missing a string literal to format with",
-                        format!("\"{}\", ", sugg_fmt),
+                        format!("\"{sugg_fmt}\", "),
                         Applicability::MaybeIncorrect,
                     );
                 }
@@ -668,7 +668,7 @@ fn report_invalid_references(
     let num_args_desc = match args.explicit_args().len() {
         0 => "no arguments were given".to_string(),
         1 => "there is 1 argument".to_string(),
-        n => format!("there are {} arguments", n),
+        n => format!("there are {n} arguments"),
     };
 
     let mut e;
@@ -780,7 +780,7 @@ fn report_invalid_references(
                         if num_placeholders == 1 {
                             "is 1 argument".to_string()
                         } else {
-                            format!("are {} arguments", num_placeholders)
+                            format!("are {num_placeholders} arguments")
                         },
                     ),
                 );
@@ -811,7 +811,7 @@ fn report_invalid_references(
         };
         e = ecx.struct_span_err(
             span,
-            format!("invalid reference to positional {} ({})", arg_list, num_args_desc),
+            format!("invalid reference to positional {arg_list} ({num_args_desc})"),
         );
         e.note("positional arguments are zero-based");
     }
diff --git a/compiler/rustc_builtin_macros/src/format_foreign.rs b/compiler/rustc_builtin_macros/src/format_foreign.rs
index bd5356575ca..2fc8a076366 100644
--- a/compiler/rustc_builtin_macros/src/format_foreign.rs
+++ b/compiler/rustc_builtin_macros/src/format_foreign.rs
@@ -86,10 +86,7 @@ pub(crate) mod printf {
                         '-' => c_left = true,
                         '+' => c_plus = true,
                         _ => {
-                            return Err(Some(format!(
-                                "the flag `{}` is unknown or unsupported",
-                                c
-                            )));
+                            return Err(Some(format!("the flag `{c}` is unknown or unsupported")));
                         }
                     }
                 }
@@ -268,21 +265,21 @@ pub(crate) mod printf {
     impl Num {
         fn from_str(s: &str, arg: Option<&str>) -> Self {
             if let Some(arg) = arg {
-                Num::Arg(arg.parse().unwrap_or_else(|_| panic!("invalid format arg `{:?}`", arg)))
+                Num::Arg(arg.parse().unwrap_or_else(|_| panic!("invalid format arg `{arg:?}`")))
             } else if s == "*" {
                 Num::Next
             } else {
-                Num::Num(s.parse().unwrap_or_else(|_| panic!("invalid format num `{:?}`", s)))
+                Num::Num(s.parse().unwrap_or_else(|_| panic!("invalid format num `{s:?}`")))
             }
         }
 
         fn translate(&self, s: &mut String) -> std::fmt::Result {
             use std::fmt::Write;
             match *self {
-                Num::Num(n) => write!(s, "{}", n),
+                Num::Num(n) => write!(s, "{n}"),
                 Num::Arg(n) => {
                     let n = n.checked_sub(1).ok_or(std::fmt::Error)?;
-                    write!(s, "{}$", n)
+                    write!(s, "{n}$")
                 }
                 Num::Next => write!(s, "*"),
             }
@@ -626,8 +623,8 @@ pub mod shell {
     impl Substitution<'_> {
         pub fn as_str(&self) -> String {
             match self {
-                Substitution::Ordinal(n, _) => format!("${}", n),
-                Substitution::Name(n, _) => format!("${}", n),
+                Substitution::Ordinal(n, _) => format!("${n}"),
+                Substitution::Name(n, _) => format!("${n}"),
                 Substitution::Escape(_) => "$$".into(),
             }
         }
diff --git a/compiler/rustc_builtin_macros/src/global_allocator.rs b/compiler/rustc_builtin_macros/src/global_allocator.rs
index 5772471931f..053f5730f6e 100644
--- a/compiler/rustc_builtin_macros/src/global_allocator.rs
+++ b/compiler/rustc_builtin_macros/src/global_allocator.rs
@@ -72,7 +72,7 @@ impl AllocFnFactory<'_, '_> {
         let mut abi_args = ThinVec::new();
         let mut i = 0;
         let mut mk = || {
-            let name = Ident::from_str_and_span(&format!("arg{}", i), self.span);
+            let name = Ident::from_str_and_span(&format!("arg{i}"), self.span);
             i += 1;
             name
         };
diff --git a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs
index a7908373b6d..7c0b36ced96 100644
--- a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs
+++ b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs
@@ -179,8 +179,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> {
                         == prev_item.path.segments[0].ident.name
                     {
                         format!(
-                            "only one `#[{}]` attribute is allowed on any given function",
-                            path_str,
+                            "only one `#[{path_str}]` attribute is allowed on any given function",
                         )
                     } else {
                         format!(
diff --git a/compiler/rustc_builtin_macros/src/source_util.rs b/compiler/rustc_builtin_macros/src/source_util.rs
index e613b904d2e..433da74231f 100644
--- a/compiler/rustc_builtin_macros/src/source_util.rs
+++ b/compiler/rustc_builtin_macros/src/source_util.rs
@@ -149,7 +149,7 @@ pub fn expand_include<'cx>(
                     Ok(None) => {
                         if self.p.token != token::Eof {
                             let token = pprust::token_to_string(&self.p.token);
-                            let msg = format!("expected item, found `{}`", token);
+                            let msg = format!("expected item, found `{token}`");
                             self.p.struct_span_err(self.p.token.span, msg).emit();
                         }
 
diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs
index 6bc4f6fc1fc..1580a6f6dd3 100644
--- a/compiler/rustc_builtin_macros/src/test.rs
+++ b/compiler/rustc_builtin_macros/src/test.rs
@@ -255,6 +255,7 @@ pub fn expand_test_or_bench(
             ast::ItemKind::Const(
                 ast::ConstItem {
                     defaultness: ast::Defaultness::Final,
+                    generics: ast::Generics::default(),
                     ty: cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))),
                     // test::TestDescAndFn {
                     expr: Some(
diff --git a/compiler/rustc_codegen_gcc/src/lib.rs b/compiler/rustc_codegen_gcc/src/lib.rs
index 04ac0254a81..697ae015fed 100644
--- a/compiler/rustc_codegen_gcc/src/lib.rs
+++ b/compiler/rustc_codegen_gcc/src/lib.rs
@@ -71,7 +71,7 @@ use gccjit::{Context, OptimizationLevel, CType};
 use rustc_ast::expand::allocator::AllocatorKind;
 use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen};
 use rustc_codegen_ssa::base::codegen_crate;
-use rustc_codegen_ssa::back::write::{CodegenContext, FatLTOInput, ModuleConfig, TargetMachineFactoryFn};
+use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, ModuleConfig, TargetMachineFactoryFn};
 use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
 use rustc_codegen_ssa::target_features::supported_target_features;
 use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, ModuleBufferMethods, ThinBufferMethods, WriteBackendMethods};
@@ -217,14 +217,14 @@ impl WriteBackendMethods for GccCodegenBackend {
     type ThinData = ();
     type ThinBuffer = ThinBuffer;
 
-    fn run_fat_lto(_cgcx: &CodegenContext<Self>, mut modules: Vec<FatLTOInput<Self>>, _cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>) -> Result<LtoModuleCodegen<Self>, FatalError> {
+    fn run_fat_lto(_cgcx: &CodegenContext<Self>, mut modules: Vec<FatLtoInput<Self>>, _cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>) -> Result<LtoModuleCodegen<Self>, FatalError> {
         // TODO(antoyo): implement LTO by sending -flto to libgccjit and adding the appropriate gcc linker plugins.
         // NOTE: implemented elsewhere.
         // TODO(antoyo): what is implemented elsewhere ^ ?
         let module =
             match modules.remove(0) {
-                FatLTOInput::InMemory(module) => module,
-                FatLTOInput::Serialized { .. } => {
+                FatLtoInput::InMemory(module) => module,
+                FatLtoInput::Serialized { .. } => {
                     unimplemented!();
                 }
             };
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 4c69b9503a2..4c9094bf1f5 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -363,50 +363,44 @@ pub fn from_fn_attrs<'ll, 'tcx>(
     if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR)
         || codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR_ZEROED)
     {
-        if llvm_util::get_version() >= (15, 0, 0) {
-            to_add.push(create_alloc_family_attr(cx.llcx));
-            // apply to argument place instead of function
-            let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
-            attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
-            to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
-            let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
-            if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
-                flags |= AllocKindFlags::Uninitialized;
-            } else {
-                flags |= AllocKindFlags::Zeroed;
-            }
-            to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
+        to_add.push(create_alloc_family_attr(cx.llcx));
+        // apply to argument place instead of function
+        let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
+        attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
+        to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 0));
+        let mut flags = AllocKindFlags::Alloc | AllocKindFlags::Aligned;
+        if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR) {
+            flags |= AllocKindFlags::Uninitialized;
+        } else {
+            flags |= AllocKindFlags::Zeroed;
         }
+        to_add.push(llvm::CreateAllocKindAttr(cx.llcx, flags));
         // apply to return place instead of function (unlike all other attributes applied in this function)
         let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
         attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
     }
     if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::REALLOCATOR) {
-        if llvm_util::get_version() >= (15, 0, 0) {
-            to_add.push(create_alloc_family_attr(cx.llcx));
-            to_add.push(llvm::CreateAllocKindAttr(
-                cx.llcx,
-                AllocKindFlags::Realloc | AllocKindFlags::Aligned,
-            ));
-            // applies to argument place instead of function place
-            let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
-            attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
-            // apply to argument place instead of function
-            let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
-            attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
-            to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
-        }
+        to_add.push(create_alloc_family_attr(cx.llcx));
+        to_add.push(llvm::CreateAllocKindAttr(
+            cx.llcx,
+            AllocKindFlags::Realloc | AllocKindFlags::Aligned,
+        ));
+        // applies to argument place instead of function place
+        let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
+        attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
+        // apply to argument place instead of function
+        let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
+        attributes::apply_to_llfn(llfn, AttributePlace::Argument(2), &[alloc_align]);
+        to_add.push(llvm::CreateAllocSizeAttr(cx.llcx, 3));
         let no_alias = AttributeKind::NoAlias.create_attr(cx.llcx);
         attributes::apply_to_llfn(llfn, AttributePlace::ReturnValue, &[no_alias]);
     }
     if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::DEALLOCATOR) {
-        if llvm_util::get_version() >= (15, 0, 0) {
-            to_add.push(create_alloc_family_attr(cx.llcx));
-            to_add.push(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
-            // applies to argument place instead of function place
-            let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
-            attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
-        }
+        to_add.push(create_alloc_family_attr(cx.llcx));
+        to_add.push(llvm::CreateAllocKindAttr(cx.llcx, AllocKindFlags::Free));
+        // applies to argument place instead of function place
+        let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
+        attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
     }
     if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::CMSE_NONSECURE_ENTRY) {
         to_add.push(llvm::CreateAttrString(cx.llcx, "cmse_nonsecure_entry"));
@@ -450,7 +444,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
     let mut function_features = function_features
         .iter()
         .flat_map(|feat| {
-            llvm_util::to_llvm_features(cx.tcx.sess, feat).into_iter().map(|f| format!("+{}", f))
+            llvm_util::to_llvm_features(cx.tcx.sess, feat).into_iter().map(|f| format!("+{f}"))
         })
         .chain(codegen_fn_attrs.instruction_set.iter().map(|x| match x {
             InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(),
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs
index 10bf954d242..a82d2c5771a 100644
--- a/compiler/rustc_codegen_llvm/src/back/archive.rs
+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs
@@ -56,7 +56,7 @@ fn llvm_machine_type(cpu: &str) -> LLVMMachineType {
         "x86" => LLVMMachineType::I386,
         "aarch64" => LLVMMachineType::ARM64,
         "arm" => LLVMMachineType::ARM,
-        _ => panic!("unsupported cpu type {}", cpu),
+        _ => panic!("unsupported cpu type {cpu}"),
     }
 }
 
@@ -128,7 +128,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
         let name_suffix = if is_direct_dependency { "_imports" } else { "_imports_indirect" };
         let output_path = {
             let mut output_path: PathBuf = tmpdir.to_path_buf();
-            output_path.push(format!("{}{}", lib_name, name_suffix));
+            output_path.push(format!("{lib_name}{name_suffix}"));
             output_path.with_extension("lib")
         };
 
@@ -156,7 +156,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
             // functions. Therefore, use binutils to create the import library instead,
             // by writing a .DEF file to the temp dir and calling binutils's dlltool.
             let def_file_path =
-                tmpdir.join(format!("{}{}", lib_name, name_suffix)).with_extension("def");
+                tmpdir.join(format!("{lib_name}{name_suffix}")).with_extension("def");
 
             let def_file_content = format!(
                 "EXPORTS\n{}",
@@ -164,7 +164,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
                     .into_iter()
                     .map(|(name, ordinal)| {
                         match ordinal {
-                            Some(n) => format!("{} @{} NONAME", name, n),
+                            Some(n) => format!("{name} @{n} NONAME"),
                             None => name,
                         }
                     })
@@ -435,7 +435,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
 }
 
 fn string_to_io_error(s: String) -> io::Error {
-    io::Error::new(io::ErrorKind::Other, format!("bad archive: {}", s))
+    io::Error::new(io::ErrorKind::Other, format!("bad archive: {s}"))
 }
 
 fn find_binutils_dlltool(sess: &Session) -> OsString {
diff --git a/compiler/rustc_codegen_llvm/src/back/lto.rs b/compiler/rustc_codegen_llvm/src/back/lto.rs
index d7dd98d7938..b2d28cef899 100644
--- a/compiler/rustc_codegen_llvm/src/back/lto.rs
+++ b/compiler/rustc_codegen_llvm/src/back/lto.rs
@@ -7,7 +7,7 @@ use crate::{LlvmCodegenBackend, ModuleLlvm};
 use object::read::archive::ArchiveFile;
 use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule, ThinShared};
 use rustc_codegen_ssa::back::symbol_export;
-use rustc_codegen_ssa::back::write::{CodegenContext, FatLTOInput, TargetMachineFactoryConfig};
+use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, TargetMachineFactoryConfig};
 use rustc_codegen_ssa::traits::*;
 use rustc_codegen_ssa::{looks_like_rust_object_file, ModuleCodegen, ModuleKind};
 use rustc_data_structures::fx::FxHashMap;
@@ -166,7 +166,7 @@ fn get_bitcode_slice_from_object_data(obj: &[u8]) -> Result<&[u8], LtoBitcodeFro
 /// for further optimization.
 pub(crate) fn run_fat(
     cgcx: &CodegenContext<LlvmCodegenBackend>,
-    modules: Vec<FatLTOInput<LlvmCodegenBackend>>,
+    modules: Vec<FatLtoInput<LlvmCodegenBackend>>,
     cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
 ) -> Result<LtoModuleCodegen<LlvmCodegenBackend>, FatalError> {
     let diag_handler = cgcx.create_diag_handler();
@@ -220,7 +220,7 @@ pub(crate) fn prepare_thin(module: ModuleCodegen<ModuleLlvm>) -> (String, ThinBu
 fn fat_lto(
     cgcx: &CodegenContext<LlvmCodegenBackend>,
     diag_handler: &Handler,
-    modules: Vec<FatLTOInput<LlvmCodegenBackend>>,
+    modules: Vec<FatLtoInput<LlvmCodegenBackend>>,
     cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
     mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
     symbols_below_threshold: &[*const libc::c_char],
@@ -245,8 +245,8 @@ fn fat_lto(
     }));
     for module in modules {
         match module {
-            FatLTOInput::InMemory(m) => in_memory.push(m),
-            FatLTOInput::Serialized { name, buffer } => {
+            FatLtoInput::InMemory(m) => in_memory.push(m),
+            FatLtoInput::Serialized { name, buffer } => {
                 info!("pushing serialized module {:?}", name);
                 let buffer = SerializedModule::Local(buffer);
                 serialized_modules.push((buffer, CString::new(name).unwrap()));
@@ -332,7 +332,7 @@ fn fat_lto(
             let _timer = cgcx
                 .prof
                 .generic_activity_with_arg_recorder("LLVM_fat_lto_link_module", |recorder| {
-                    recorder.record_arg(format!("{:?}", name))
+                    recorder.record_arg(format!("{name:?}"))
                 });
             info!("linking {:?}", name);
             let data = bc_decoded.data();
@@ -787,7 +787,7 @@ impl ThinLTOKeysMap {
         let file = File::create(path)?;
         let mut writer = io::BufWriter::new(file);
         for (module, key) in &self.keys {
-            writeln!(writer, "{} {}", module, key)?;
+            writeln!(writer, "{module} {key}")?;
         }
         Ok(())
     }
@@ -801,7 +801,7 @@ impl ThinLTOKeysMap {
             let mut split = line.split(' ');
             let module = split.next().unwrap();
             let key = split.next().unwrap();
-            assert_eq!(split.next(), None, "Expected two space-separated values, found {:?}", line);
+            assert_eq!(split.next(), None, "Expected two space-separated values, found {line:?}");
             keys.insert(module.to_string(), key.to_string());
         }
         Ok(Self { keys })
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index 0f5e975445f..cbcbdea84da 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -259,7 +259,7 @@ pub(crate) fn save_temp_bitcode(
         return;
     }
     unsafe {
-        let ext = format!("{}.bc", name);
+        let ext = format!("{name}.bc");
         let cgu = Some(&module.name[..]);
         let path = cgcx.output_filenames.temp_path_ext(&ext, cgu);
         let cstr = path_to_c_string(&path);
@@ -713,7 +713,7 @@ pub(crate) unsafe fn codegen(
 
                 let Ok(demangled) = rustc_demangle::try_demangle(input) else { return 0 };
 
-                if write!(cursor, "{:#}", demangled).is_err() {
+                if write!(cursor, "{demangled:#}").is_err() {
                     // Possible only if provided buffer is not big enough
                     return 0;
                 }
@@ -834,7 +834,7 @@ pub(crate) unsafe fn codegen(
 }
 
 fn create_section_with_flags_asm(section_name: &str, section_flags: &str, data: &[u8]) -> Vec<u8> {
-    let mut asm = format!(".section {},\"{}\"\n", section_name, section_flags).into_bytes();
+    let mut asm = format!(".section {section_name},\"{section_flags}\"\n").into_bytes();
     asm.extend_from_slice(b".ascii \"");
     asm.reserve(data.len());
     for &byte in data {
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index d55992bf092..8c2b1831f0a 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -1415,9 +1415,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
     ) -> Cow<'b, [&'ll Value]> {
         assert!(
             self.cx.type_kind(fn_ty) == TypeKind::Function,
-            "builder::{} not passed a function, but {:?}",
-            typ,
-            fn_ty
+            "builder::{typ} not passed a function, but {fn_ty:?}"
         );
 
         let param_tys = self.cx.func_params_types(fn_ty);
@@ -1509,12 +1507,9 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
 
         let instr = if signed { "fptosi" } else { "fptoui" };
         let name = if let Some(vector_length) = vector_length {
-            format!(
-                "llvm.{}.sat.v{}i{}.v{}f{}",
-                instr, vector_length, int_width, vector_length, float_width
-            )
+            format!("llvm.{instr}.sat.v{vector_length}i{int_width}.v{vector_length}f{float_width}")
         } else {
-            format!("llvm.{}.sat.i{}.f{}", instr, int_width, float_width)
+            format!("llvm.{instr}.sat.i{int_width}.f{float_width}")
         };
         let f = self.declare_cfn(&name, llvm::UnnamedAddr::No, self.type_func(&[src_ty], dest_ty));
         self.call(self.type_func(&[src_ty], dest_ty), None, None, f, &[val], None)
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs
index 4d879fbdcb7..130ff839e74 100644
--- a/compiler/rustc_codegen_llvm/src/common.rs
+++ b/compiler/rustc_codegen_llvm/src/common.rs
@@ -420,10 +420,10 @@ pub(crate) fn i686_decorated_name(
             DllCallingConvention::C => {}
             DllCallingConvention::Stdcall(arg_list_size)
             | DllCallingConvention::Fastcall(arg_list_size) => {
-                write!(&mut decorated_name, "@{}", arg_list_size).unwrap();
+                write!(&mut decorated_name, "@{arg_list_size}").unwrap();
             }
             DllCallingConvention::Vectorcall(arg_list_size) => {
-                write!(&mut decorated_name, "@@{}", arg_list_size).unwrap();
+                write!(&mut decorated_name, "@@{arg_list_size}").unwrap();
             }
         }
     }
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs
index df52f50f86f..eb5969e5644 100644
--- a/compiler/rustc_codegen_llvm/src/consts.rs
+++ b/compiler/rustc_codegen_llvm/src/consts.rs
@@ -238,8 +238,7 @@ impl<'ll> CodegenCx<'ll, '_> {
         assert!(
             !defined_in_current_codegen_unit,
             "consts::get_static() should always hit the cache for \
-                 statics defined in the same CGU, but did not for `{:?}`",
-            def_id
+                 statics defined in the same CGU, but did not for `{def_id:?}`"
         );
 
         let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
index 37f30917609..ed962bb3e3c 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
@@ -54,7 +54,7 @@ pub fn get_or_insert_gdb_debug_scripts_section_global<'ll>(cx: &CodegenCx<'ll, '
             // The initial byte `4` instructs GDB that the following pretty printer
             // is defined inline as opposed to in a standalone file.
             section_contents.extend_from_slice(b"\x04");
-            let vis_name = format!("pretty-printer-{}-{}\n", crate_name, index);
+            let vis_name = format!("pretty-printer-{crate_name}-{index}\n");
             section_contents.extend_from_slice(vis_name.as_bytes());
             section_contents.extend_from_slice(&visualizer.src);
 
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 905e0e541a8..40f0bcfdf58 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -184,9 +184,7 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
             debug_assert_eq!(
                 (data_layout.pointer_size, data_layout.pointer_align.abi),
                 cx.size_and_align_of(ptr_type),
-                "ptr_type={}, pointee_type={}",
-                ptr_type,
-                pointee_type,
+                "ptr_type={ptr_type}, pointee_type={pointee_type}",
             );
 
             let di_node = unsafe {
@@ -521,7 +519,7 @@ fn recursion_marker_type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> &'ll D
 fn hex_encode(data: &[u8]) -> String {
     let mut hex_string = String::with_capacity(data.len() * 2);
     for byte in data.iter() {
-        write!(&mut hex_string, "{:02x}", byte).unwrap();
+        write!(&mut hex_string, "{byte:02x}").unwrap();
     }
     hex_string
 }
@@ -766,7 +764,7 @@ fn build_param_type_di_node<'ll, 'tcx>(
     t: Ty<'tcx>,
 ) -> DINodeCreationResult<'ll> {
     debug!("build_param_type_di_node: {:?}", t);
-    let name = format!("{:?}", t);
+    let name = format!("{t:?}");
     DINodeCreationResult {
         di_node: unsafe {
             llvm::LLVMRustDIBuilderCreateBasicType(
@@ -814,7 +812,7 @@ pub fn build_compile_unit_di_node<'ll, 'tcx>(
     debug!("build_compile_unit_di_node: {:?}", name_in_debuginfo);
     let rustc_producer = format!("rustc version {}", tcx.sess.cfg_version);
     // FIXME(#41252) Remove "clang LLVM" if we can get GDB and LLVM to play nice.
-    let producer = format!("clang LLVM ({})", rustc_producer);
+    let producer = format!("clang LLVM ({rustc_producer})");
 
     let name_in_debuginfo = name_in_debuginfo.to_string_lossy();
     let work_dir = tcx.sess.opts.working_dir.to_string_lossy(FileNameDisplayPreference::Remapped);
@@ -1331,10 +1329,10 @@ fn build_vtable_type_di_node<'ll, 'tcx>(
                             // Note: This code does not try to give a proper name to each method
                             //       because their might be multiple methods with the same name
                             //       (coming from different traits).
-                            (format!("__method{}", index), void_pointer_type_di_node)
+                            (format!("__method{index}"), void_pointer_type_di_node)
                         }
                         ty::VtblEntry::TraitVPtr(_) => {
-                            (format!("__super_trait_ptr{}", index), void_pointer_type_di_node)
+                            (format!("__super_trait_ptr{index}"), void_pointer_type_di_node)
                         }
                         ty::VtblEntry::MetadataAlign => ("align".to_string(), usize_di_node),
                         ty::VtblEntry::MetadataSize => ("size".to_string(), usize_di_node),
@@ -1504,5 +1502,5 @@ pub fn tuple_field_name(field_index: usize) -> Cow<'static, str> {
     TUPLE_FIELD_NAMES
         .get(field_index)
         .map(|s| Cow::from(*s))
-        .unwrap_or_else(|| Cow::from(format!("__{}", field_index)))
+        .unwrap_or_else(|| Cow::from(format!("__{field_index}")))
 }
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs b/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs
index 7be83638676..c758010c581 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/utils.rs
@@ -91,8 +91,7 @@ pub(crate) fn fat_pointer_kind<'ll, 'tcx>(
             // For all other pointee types we should already have returned None
             // at the beginning of the function.
             panic!(
-                "fat_pointer_kind() - Encountered unexpected `pointee_tail_ty`: {:?}",
-                pointee_tail_ty
+                "fat_pointer_kind() - Encountered unexpected `pointee_tail_ty`: {pointee_tail_ty:?}"
             )
         }
     }
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs
index 6df1b708ccd..ee71fb6e822 100644
--- a/compiler/rustc_codegen_llvm/src/intrinsic.rs
+++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs
@@ -230,22 +230,22 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
                         sym::ctlz | sym::cttz => {
                             let y = self.const_bool(false);
                             self.call_intrinsic(
-                                &format!("llvm.{}.i{}", name, width),
+                                &format!("llvm.{name}.i{width}"),
                                 &[args[0].immediate(), y],
                             )
                         }
                         sym::ctlz_nonzero => {
                             let y = self.const_bool(true);
-                            let llvm_name = &format!("llvm.ctlz.i{}", width);
+                            let llvm_name = &format!("llvm.ctlz.i{width}");
                             self.call_intrinsic(llvm_name, &[args[0].immediate(), y])
                         }
                         sym::cttz_nonzero => {
                             let y = self.const_bool(true);
-                            let llvm_name = &format!("llvm.cttz.i{}", width);
+                            let llvm_name = &format!("llvm.cttz.i{width}");
                             self.call_intrinsic(llvm_name, &[args[0].immediate(), y])
                         }
                         sym::ctpop => self.call_intrinsic(
-                            &format!("llvm.ctpop.i{}", width),
+                            &format!("llvm.ctpop.i{width}"),
                             &[args[0].immediate()],
                         ),
                         sym::bswap => {
@@ -253,13 +253,13 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
                                 args[0].immediate() // byte swap a u8/i8 is just a no-op
                             } else {
                                 self.call_intrinsic(
-                                    &format!("llvm.bswap.i{}", width),
+                                    &format!("llvm.bswap.i{width}"),
                                     &[args[0].immediate()],
                                 )
                             }
                         }
                         sym::bitreverse => self.call_intrinsic(
-                            &format!("llvm.bitreverse.i{}", width),
+                            &format!("llvm.bitreverse.i{width}"),
                             &[args[0].immediate()],
                         ),
                         sym::rotate_left | sym::rotate_right => {
@@ -1283,7 +1283,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
             sym::simd_trunc => ("trunc", bx.type_func(&[vec_ty], vec_ty)),
             _ => return_error!(InvalidMonomorphization::UnrecognizedIntrinsic { span, name }),
         };
-        let llvm_name = &format!("llvm.{0}.v{1}{2}", intr_name, in_len, elem_ty_str);
+        let llvm_name = &format!("llvm.{intr_name}.v{in_len}{elem_ty_str}");
         let f = bx.declare_cfn(llvm_name, llvm::UnnamedAddr::No, fn_ty);
         let c = bx.call(
             fn_ty,
@@ -1498,7 +1498,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
         let llvm_elem_vec_str = llvm_vector_str(underlying_ty, in_len, pointer_count - 1, bx);
 
         let llvm_intrinsic =
-            format!("llvm.masked.gather.{}.{}", llvm_elem_vec_str, llvm_pointer_vec_str);
+            format!("llvm.masked.gather.{llvm_elem_vec_str}.{llvm_pointer_vec_str}");
         let fn_ty = bx.type_func(
             &[llvm_pointer_vec_ty, alignment_ty, mask_ty, llvm_elem_vec_ty],
             llvm_elem_vec_ty,
@@ -1642,7 +1642,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
         let llvm_elem_vec_str = llvm_vector_str(underlying_ty, in_len, pointer_count - 1, bx);
 
         let llvm_intrinsic =
-            format!("llvm.masked.scatter.{}.{}", llvm_elem_vec_str, llvm_pointer_vec_str);
+            format!("llvm.masked.scatter.{llvm_elem_vec_str}.{llvm_pointer_vec_str}");
         let fn_ty =
             bx.type_func(&[llvm_elem_vec_ty, llvm_pointer_vec_ty, alignment_ty, mask_ty], ret_t);
         let f = bx.declare_cfn(&llvm_intrinsic, llvm::UnnamedAddr::No, fn_ty);
@@ -2074,6 +2074,52 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
         simd_neg: Int => neg, Float => fneg;
     }
 
+    // Unary integer intrinsics
+    if matches!(name, sym::simd_bswap | sym::simd_bitreverse | sym::simd_ctlz | sym::simd_cttz) {
+        let vec_ty = bx.cx.type_vector(
+            match *in_elem.kind() {
+                ty::Int(i) => bx.cx.type_int_from_ty(i),
+                ty::Uint(i) => bx.cx.type_uint_from_ty(i),
+                _ => return_error!(InvalidMonomorphization::UnsupportedOperation {
+                    span,
+                    name,
+                    in_ty,
+                    in_elem
+                }),
+            },
+            in_len as u64,
+        );
+        let intrinsic_name = match name {
+            sym::simd_bswap => "bswap",
+            sym::simd_bitreverse => "bitreverse",
+            sym::simd_ctlz => "ctlz",
+            sym::simd_cttz => "cttz",
+            _ => unreachable!(),
+        };
+        let int_size = in_elem.int_size_and_signed(bx.tcx()).0.bits();
+        let llvm_intrinsic = &format!("llvm.{}.v{}i{}", intrinsic_name, in_len, int_size,);
+
+        return if name == sym::simd_bswap && int_size == 8 {
+            // byte swap is no-op for i8/u8
+            Ok(args[0].immediate())
+        } else if matches!(name, sym::simd_ctlz | sym::simd_cttz) {
+            let fn_ty = bx.type_func(&[vec_ty, bx.type_i1()], vec_ty);
+            let f = bx.declare_cfn(llvm_intrinsic, llvm::UnnamedAddr::No, fn_ty);
+            Ok(bx.call(
+                fn_ty,
+                None,
+                None,
+                f,
+                &[args[0].immediate(), bx.const_int(bx.type_i1(), 0)],
+                None,
+            ))
+        } else {
+            let fn_ty = bx.type_func(&[vec_ty], vec_ty);
+            let f = bx.declare_cfn(llvm_intrinsic, llvm::UnnamedAddr::No, fn_ty);
+            Ok(bx.call(fn_ty, None, None, f, &[args[0].immediate()], None))
+        };
+    }
+
     if name == sym::simd_arith_offset {
         // This also checks that the first operand is a ptr type.
         let pointee = in_elem.builtin_deref(true).unwrap_or_else(|| {
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index 5aab06febe4..d283299ac46 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -28,7 +28,7 @@ pub use llvm_util::target_features;
 use rustc_ast::expand::allocator::AllocatorKind;
 use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
 use rustc_codegen_ssa::back::write::{
-    CodegenContext, FatLTOInput, ModuleConfig, TargetMachineFactoryConfig, TargetMachineFactoryFn,
+    CodegenContext, FatLtoInput, ModuleConfig, TargetMachineFactoryConfig, TargetMachineFactoryFn,
 };
 use rustc_codegen_ssa::traits::*;
 use rustc_codegen_ssa::ModuleCodegen;
@@ -141,18 +141,6 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
         back::write::target_machine_factory(sess, optlvl, target_features)
     }
 
-    fn spawn_thread<F, T>(time_trace: bool, f: F) -> std::thread::JoinHandle<T>
-    where
-        F: FnOnce() -> T,
-        F: Send + 'static,
-        T: Send + 'static,
-    {
-        std::thread::spawn(move || {
-            let _profiler = TimeTraceProfiler::new(time_trace);
-            f()
-        })
-    }
-
     fn spawn_named_thread<F, T>(
         time_trace: bool,
         name: String,
@@ -212,7 +200,7 @@ impl WriteBackendMethods for LlvmCodegenBackend {
     }
     fn run_fat_lto(
         cgcx: &CodegenContext<Self>,
-        modules: Vec<FatLTOInput<Self>>,
+        modules: Vec<FatLtoInput<Self>>,
         cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>,
     ) -> Result<LtoModuleCodegen<Self>, FatalError> {
         back::lto::run_fat(cgcx, modules, cached_modules)
@@ -298,21 +286,21 @@ impl CodegenBackend for LlvmCodegenBackend {
                     "ropi-rwpi",
                     "default",
                 ] {
-                    writeln!(out, "    {}", name);
+                    writeln!(out, "    {name}");
                 }
                 writeln!(out);
             }
             PrintKind::CodeModels => {
                 writeln!(out, "Available code models:");
                 for name in &["tiny", "small", "kernel", "medium", "large"] {
-                    writeln!(out, "    {}", name);
+                    writeln!(out, "    {name}");
                 }
                 writeln!(out);
             }
             PrintKind::TlsModels => {
                 writeln!(out, "Available TLS models:");
                 for name in &["global-dynamic", "local-dynamic", "initial-exec", "local-exec"] {
-                    writeln!(out, "    {}", name);
+                    writeln!(out, "    {name}");
                 }
                 writeln!(out);
             }
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index 4f20fbf2045..a76c9c9b735 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -315,7 +315,7 @@ pub fn target_features(sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
 
 pub fn print_version() {
     let (major, minor, patch) = get_version();
-    println!("LLVM version: {}.{}.{}", major, minor, patch);
+    println!("LLVM version: {major}.{minor}.{patch}");
 }
 
 pub fn get_version() -> (u32, u32, u32) {
@@ -390,11 +390,11 @@ fn print_target_features(out: &mut dyn PrintBackendInfo, sess: &Session, tm: &ll
 
     writeln!(out, "Features supported by rustc for this target:");
     for (feature, desc) in &rustc_target_features {
-        writeln!(out, "    {1:0$} - {2}.", max_feature_len, feature, desc);
+        writeln!(out, "    {feature:max_feature_len$} - {desc}.");
     }
     writeln!(out, "\nCode-generation features supported by LLVM for this target:");
     for (feature, desc) in &llvm_target_features {
-        writeln!(out, "    {1:0$} - {2}.", max_feature_len, feature, desc);
+        writeln!(out, "    {feature:max_feature_len$} - {desc}.");
     }
     if llvm_target_features.is_empty() {
         writeln!(out, "    Target features listing is not supported by this LLVM version.");
@@ -507,8 +507,6 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
             .features
             .split(',')
             .filter(|v| !v.is_empty() && backend_feature_name(v).is_some())
-            // Drop +atomics-32 feature introduced in LLVM 15.
-            .filter(|v| *v != "+atomics-32" || get_version() >= (15, 0, 0))
             .map(String::from),
     );
 
@@ -575,7 +573,7 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
                         match (enable_disable, feat) {
                             ('-' | '+', TargetFeatureFoldStrength::Both(f))
                             | ('+', TargetFeatureFoldStrength::EnableOnly(f)) => {
-                                Some(format!("{}{}", enable_disable, f))
+                                Some(format!("{enable_disable}{f}"))
                             }
                             _ => None,
                         }
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index eefa4ac34dd..cd6201648ee 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -748,7 +748,7 @@ fn link_natively<'a>(
 
     for print in &sess.opts.prints {
         if print.kind == PrintKind::LinkArgs {
-            let content = format!("{:?}", cmd);
+            let content = format!("{cmd:?}");
             print.out.overwrite(&content, sess);
         }
     }
@@ -1236,22 +1236,21 @@ fn link_sanitizer_runtime(sess: &Session, linker: &mut dyn Linker, name: &str) {
         }
     }
 
-    let channel = option_env!("CFG_RELEASE_CHANNEL")
-        .map(|channel| format!("-{}", channel))
-        .unwrap_or_default();
+    let channel =
+        option_env!("CFG_RELEASE_CHANNEL").map(|channel| format!("-{channel}")).unwrap_or_default();
 
     if sess.target.is_like_osx {
         // On Apple platforms, the sanitizer is always built as a dylib, and
         // LLVM will link to `@rpath/*.dylib`, so we need to specify an
         // rpath to the library as well (the rpath should be absolute, see
         // PR #41352 for details).
-        let filename = format!("rustc{}_rt.{}", channel, name);
+        let filename = format!("rustc{channel}_rt.{name}");
         let path = find_sanitizer_runtime(&sess, &filename);
         let rpath = path.to_str().expect("non-utf8 component in path");
         linker.args(&["-Wl,-rpath", "-Xlinker", rpath]);
         linker.link_dylib(&filename, false, true);
     } else {
-        let filename = format!("librustc{}_rt.{}.a", channel, name);
+        let filename = format!("librustc{channel}_rt.{name}.a");
         let path = find_sanitizer_runtime(&sess, &filename).join(&filename);
         linker.link_whole_rlib(&path);
     }
@@ -1415,12 +1414,12 @@ fn print_native_static_libs(
                     } else if sess.target.linker_flavor.is_gnu() {
                         Some(format!("-l{}{}", if verbatim { ":" } else { "" }, name))
                     } else {
-                        Some(format!("-l{}", name))
+                        Some(format!("-l{name}"))
                     }
                 }
                 NativeLibKind::Framework { .. } => {
                     // ld-only syntax, since there are no frameworks in MSVC
-                    Some(format!("-framework {}", name))
+                    Some(format!("-framework {name}"))
                 }
                 // These are included, no need to print them
                 NativeLibKind::Static { bundle: None | Some(true), .. }
@@ -1457,12 +1456,12 @@ fn print_native_static_libs(
             // `foo.lib` file if the dll doesn't actually export any symbols, so we
             // check to see if the file is there and just omit linking to it if it's
             // not present.
-            let name = format!("{}.dll.lib", lib);
+            let name = format!("{lib}.dll.lib");
             if path.join(&name).exists() {
                 lib_args.push(name);
             }
         } else {
-            lib_args.push(format!("-l{}", lib));
+            lib_args.push(format!("-l{lib}"));
         }
     }
 
@@ -1628,8 +1627,8 @@ fn exec_linker(
                 write!(f, "\"")?;
                 for c in self.arg.chars() {
                     match c {
-                        '"' => write!(f, "\\{}", c)?,
-                        c => write!(f, "{}", c)?,
+                        '"' => write!(f, "\\{c}")?,
+                        c => write!(f, "{c}")?,
                     }
                 }
                 write!(f, "\"")?;
@@ -1646,8 +1645,8 @@ fn exec_linker(
                 // ensure the line is interpreted as one whole argument.
                 for c in self.arg.chars() {
                     match c {
-                        '\\' | ' ' => write!(f, "\\{}", c)?,
-                        c => write!(f, "{}", c)?,
+                        '\\' | ' ' => write!(f, "\\{c}")?,
+                        c => write!(f, "{c}")?,
                     }
                 }
             }
@@ -2284,7 +2283,7 @@ fn add_order_independent_options(
         } else {
             ""
         };
-        cmd.arg(format!("--dynamic-linker={}ld.so.1", prefix));
+        cmd.arg(format!("--dynamic-linker={prefix}ld.so.1"));
     }
 
     if sess.target.eh_frame_header {
diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs
index cd56f85cccd..4c04fc60b98 100644
--- a/compiler/rustc_codegen_ssa/src/back/linker.rs
+++ b/compiler/rustc_codegen_ssa/src/back/linker.rs
@@ -309,7 +309,7 @@ impl<'a> GccLinker<'a> {
             self.linker_arg(&format!("-plugin-opt=sample-profile={}", path.display()));
         };
         self.linker_args(&[
-            &format!("-plugin-opt={}", opt_level),
+            &format!("-plugin-opt={opt_level}"),
             &format!("-plugin-opt=mcpu={}", self.target_cpu),
         ]);
     }
@@ -487,7 +487,7 @@ impl<'a> Linker for GccLinker<'a> {
 
     fn link_rust_dylib(&mut self, lib: &str, _path: &Path) {
         self.hint_dynamic();
-        self.cmd.arg(format!("-l{}", lib));
+        self.cmd.arg(format!("-l{lib}"));
     }
 
     fn link_framework(&mut self, framework: &str, as_needed: bool) {
@@ -671,8 +671,8 @@ impl<'a> Linker for GccLinker<'a> {
             let res: io::Result<()> = try {
                 let mut f = BufWriter::new(File::create(&path)?);
                 for sym in symbols {
-                    debug!("  _{}", sym);
-                    writeln!(f, "_{}", sym)?;
+                    debug!("  _{sym}");
+                    writeln!(f, "_{sym}")?;
                 }
             };
             if let Err(error) = res {
@@ -686,8 +686,8 @@ impl<'a> Linker for GccLinker<'a> {
                 // because LD doesn't like when it's empty
                 writeln!(f, "EXPORTS")?;
                 for symbol in symbols {
-                    debug!("  _{}", symbol);
-                    writeln!(f, "  {}", symbol)?;
+                    debug!("  _{symbol}");
+                    writeln!(f, "  {symbol}")?;
                 }
             };
             if let Err(error) = res {
@@ -701,8 +701,8 @@ impl<'a> Linker for GccLinker<'a> {
                 if !symbols.is_empty() {
                     writeln!(f, "  global:")?;
                     for sym in symbols {
-                        debug!("    {};", sym);
-                        writeln!(f, "    {};", sym)?;
+                        debug!("    {sym};");
+                        writeln!(f, "    {sym};")?;
                     }
                 }
                 writeln!(f, "\n  local:\n    *;\n}};")?;
@@ -837,7 +837,7 @@ impl<'a> Linker for MsvcLinker<'a> {
         // `foo.lib` file if the dll doesn't actually export any symbols, so we
         // check to see if the file is there and just omit linking to it if it's
         // not present.
-        let name = format!("{}.dll.lib", lib);
+        let name = format!("{lib}.dll.lib");
         if path.join(&name).exists() {
             self.cmd.arg(name);
         }
@@ -977,8 +977,8 @@ impl<'a> Linker for MsvcLinker<'a> {
             writeln!(f, "LIBRARY")?;
             writeln!(f, "EXPORTS")?;
             for symbol in symbols {
-                debug!("  _{}", symbol);
-                writeln!(f, "  {}", symbol)?;
+                debug!("  _{symbol}");
+                writeln!(f, "  {symbol}")?;
             }
         };
         if let Err(error) = res {
@@ -992,7 +992,7 @@ impl<'a> Linker for MsvcLinker<'a> {
     fn subsystem(&mut self, subsystem: &str) {
         // Note that previous passes of the compiler validated this subsystem,
         // so we just blindly pass it to the linker.
-        self.cmd.arg(&format!("/SUBSYSTEM:{}", subsystem));
+        self.cmd.arg(&format!("/SUBSYSTEM:{subsystem}"));
 
         // Windows has two subsystems we're interested in right now, the console
         // and windows subsystems. These both implicitly have different entry
@@ -1147,7 +1147,7 @@ impl<'a> Linker for EmLinker<'a> {
             &symbols.iter().map(|sym| "_".to_owned() + sym).collect::<Vec<_>>(),
         )
         .unwrap();
-        debug!("{}", encoded);
+        debug!("{encoded}");
 
         arg.push(encoded);
 
@@ -1350,7 +1350,7 @@ impl<'a> Linker for L4Bender<'a> {
     }
     fn link_staticlib(&mut self, lib: &str, _verbatim: bool) {
         self.hint_static();
-        self.cmd.arg(format!("-PC{}", lib));
+        self.cmd.arg(format!("-PC{lib}"));
     }
     fn link_rlib(&mut self, lib: &Path) {
         self.hint_static();
@@ -1399,7 +1399,7 @@ impl<'a> Linker for L4Bender<'a> {
 
     fn link_whole_staticlib(&mut self, lib: &str, _verbatim: bool, _search_path: &[PathBuf]) {
         self.hint_static();
-        self.cmd.arg("--whole-archive").arg(format!("-l{}", lib));
+        self.cmd.arg("--whole-archive").arg(format!("-l{lib}"));
         self.cmd.arg("--no-whole-archive");
     }
 
@@ -1453,7 +1453,7 @@ impl<'a> Linker for L4Bender<'a> {
     }
 
     fn subsystem(&mut self, subsystem: &str) {
-        self.cmd.arg(&format!("--subsystem {}", subsystem));
+        self.cmd.arg(&format!("--subsystem {subsystem}"));
     }
 
     fn reset_per_library_state(&mut self) {
@@ -1518,12 +1518,12 @@ impl<'a> AixLinker<'a> {
 impl<'a> Linker for AixLinker<'a> {
     fn link_dylib(&mut self, lib: &str, _verbatim: bool, _as_needed: bool) {
         self.hint_dynamic();
-        self.cmd.arg(format!("-l{}", lib));
+        self.cmd.arg(format!("-l{lib}"));
     }
 
     fn link_staticlib(&mut self, lib: &str, _verbatim: bool) {
         self.hint_static();
-        self.cmd.arg(format!("-l{}", lib));
+        self.cmd.arg(format!("-l{lib}"));
     }
 
     fn link_rlib(&mut self, lib: &Path) {
@@ -1573,7 +1573,7 @@ impl<'a> Linker for AixLinker<'a> {
 
     fn link_rust_dylib(&mut self, lib: &str, _: &Path) {
         self.hint_dynamic();
-        self.cmd.arg(format!("-l{}", lib));
+        self.cmd.arg(format!("-l{lib}"));
     }
 
     fn link_framework(&mut self, _framework: &str, _as_needed: bool) {
@@ -1626,12 +1626,12 @@ impl<'a> Linker for AixLinker<'a> {
             let mut f = BufWriter::new(File::create(&path)?);
             // FIXME: use llvm-nm to generate export list.
             for symbol in symbols {
-                debug!("  _{}", symbol);
-                writeln!(f, "  {}", symbol)?;
+                debug!("  _{symbol}");
+                writeln!(f, "  {symbol}")?;
             }
         };
         if let Err(e) = res {
-            self.sess.fatal(format!("failed to write export file: {}", e));
+            self.sess.fatal(format!("failed to write export file: {e}"));
         }
         self.cmd.arg(format!("-bE:{}", path.to_str().unwrap()));
     }
@@ -1908,7 +1908,7 @@ impl<'a> Linker for BpfLinker<'a> {
         let res: io::Result<()> = try {
             let mut f = BufWriter::new(File::create(&path)?);
             for sym in symbols {
-                writeln!(f, "{}", sym)?;
+                writeln!(f, "{sym}")?;
             }
         };
         if let Err(error) = res {
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs
index c4bb51edade..5c7df29444b 100644
--- a/compiler/rustc_codegen_ssa/src/back/metadata.rs
+++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs
@@ -158,20 +158,19 @@ pub(super) fn get_metadata_xcoff<'a>(path: &Path, data: &'a [u8]) -> Result<&'a
     {
         let offset = metadata_symbol.address() as usize;
         if offset < 4 {
-            return Err(format!("Invalid metadata symbol offset: {}", offset));
+            return Err(format!("Invalid metadata symbol offset: {offset}"));
         }
         // The offset specifies the location of rustc metadata in the comment section.
         // The metadata is preceded by a 4-byte length field.
         let len = u32::from_be_bytes(info_data[(offset - 4)..offset].try_into().unwrap()) as usize;
         if offset + len > (info_data.len() as usize) {
             return Err(format!(
-                "Metadata at offset {} with size {} is beyond .info section",
-                offset, len
+                "Metadata at offset {offset} with size {len} is beyond .info section"
             ));
         }
         return Ok(&info_data[offset..(offset + len)]);
     } else {
-        return Err(format!("Unable to find symbol {}", AIX_METADATA_SYMBOL_NAME));
+        return Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"));
     };
 }
 
diff --git a/compiler/rustc_codegen_ssa/src/back/rpath.rs b/compiler/rustc_codegen_ssa/src/back/rpath.rs
index 0b5656c9ad1..18268622341 100644
--- a/compiler/rustc_codegen_ssa/src/back/rpath.rs
+++ b/compiler/rustc_codegen_ssa/src/back/rpath.rs
@@ -86,7 +86,7 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig<'_>, lib: &Path) -> Str
     output.pop(); // strip filename
     let output = fs::canonicalize(&output).unwrap_or(output);
     let relative = path_relative_from(&lib, &output)
-        .unwrap_or_else(|| panic!("couldn't create relative path from {:?} to {:?}", output, lib));
+        .unwrap_or_else(|| panic!("couldn't create relative path from {output:?} to {lib:?}"));
     // FIXME (#9639): This needs to handle non-utf8 paths
     format!("{}/{}", prefix, relative.to_str().expect("non-utf8 component in path"))
 }
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs
index 0bbb6c9c338..40718525741 100644
--- a/compiler/rustc_codegen_ssa/src/back/write.rs
+++ b/compiler/rustc_codegen_ssa/src/back/write.rs
@@ -349,8 +349,6 @@ pub struct CodegenContext<B: WriteBackendMethods> {
     /// Directory into which should the LLVM optimization remarks be written.
     /// If `None`, they will be written to stderr.
     pub remark_dir: Option<PathBuf>,
-    /// Worker thread number
-    pub worker: usize,
     /// The incremental compilation session directory, or None if we are not
     /// compiling incrementally
     pub incr_comp_session_dir: Option<PathBuf>,
@@ -376,38 +374,39 @@ impl<B: WriteBackendMethods> CodegenContext<B> {
 
 fn generate_lto_work<B: ExtraBackendMethods>(
     cgcx: &CodegenContext<B>,
-    needs_fat_lto: Vec<FatLTOInput<B>>,
+    needs_fat_lto: Vec<FatLtoInput<B>>,
     needs_thin_lto: Vec<(String, B::ThinBuffer)>,
     import_only_modules: Vec<(SerializedModule<B::ModuleBuffer>, WorkProduct)>,
 ) -> Vec<(WorkItem<B>, u64)> {
     let _prof_timer = cgcx.prof.generic_activity("codegen_generate_lto_work");
 
-    let (lto_modules, copy_jobs) = if !needs_fat_lto.is_empty() {
+    if !needs_fat_lto.is_empty() {
         assert!(needs_thin_lto.is_empty());
-        let lto_module =
+        let module =
             B::run_fat_lto(cgcx, needs_fat_lto, import_only_modules).unwrap_or_else(|e| e.raise());
-        (vec![lto_module], vec![])
+        // We are adding a single work item, so the cost doesn't matter.
+        vec![(WorkItem::LTO(module), 0)]
     } else {
         assert!(needs_fat_lto.is_empty());
-        B::run_thin_lto(cgcx, needs_thin_lto, import_only_modules).unwrap_or_else(|e| e.raise())
-    };
-
-    lto_modules
-        .into_iter()
-        .map(|module| {
-            let cost = module.cost();
-            (WorkItem::LTO(module), cost)
-        })
-        .chain(copy_jobs.into_iter().map(|wp| {
-            (
-                WorkItem::CopyPostLtoArtifacts(CachedModuleCodegen {
-                    name: wp.cgu_name.clone(),
-                    source: wp,
-                }),
-                0,
-            )
-        }))
-        .collect()
+        let (lto_modules, copy_jobs) = B::run_thin_lto(cgcx, needs_thin_lto, import_only_modules)
+            .unwrap_or_else(|e| e.raise());
+        lto_modules
+            .into_iter()
+            .map(|module| {
+                let cost = module.cost();
+                (WorkItem::LTO(module), cost)
+            })
+            .chain(copy_jobs.into_iter().map(|wp| {
+                (
+                    WorkItem::CopyPostLtoArtifacts(CachedModuleCodegen {
+                        name: wp.cgu_name.clone(),
+                        source: wp,
+                    }),
+                    0, // copying is very cheap
+                )
+            }))
+            .collect()
+    }
 }
 
 pub struct CompiledModules {
@@ -709,7 +708,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
         fn desc(short: &str, _long: &str, name: &str) -> String {
             // The short label is three bytes, and is followed by a space. That
             // leaves 11 bytes for the CGU name. How we obtain those 11 bytes
-            // depends on the the CGU name form.
+            // depends on the CGU name form.
             //
             // - Non-incremental, e.g. `regex.f10ba03eb5ec7975-cgu.0`: the part
             //   before the `-cgu.0` is the same for every CGU, so use the
@@ -742,22 +741,32 @@ impl<B: WriteBackendMethods> WorkItem<B> {
         }
 
         match self {
-            WorkItem::Optimize(m) => desc("opt", "optimize module {}", &m.name),
-            WorkItem::CopyPostLtoArtifacts(m) => desc("cpy", "copy LTO artifacts for {}", &m.name),
-            WorkItem::LTO(m) => desc("lto", "LTO module {}", m.name()),
+            WorkItem::Optimize(m) => desc("opt", "optimize module", &m.name),
+            WorkItem::CopyPostLtoArtifacts(m) => desc("cpy", "copy LTO artifacts for", &m.name),
+            WorkItem::LTO(m) => desc("lto", "LTO module", m.name()),
         }
     }
 }
 
 /// A result produced by the backend.
 pub(crate) enum WorkItemResult<B: WriteBackendMethods> {
-    Compiled(CompiledModule),
+    /// The backend has finished compiling a CGU, nothing more required.
+    Finished(CompiledModule),
+
+    /// The backend has finished compiling a CGU, which now needs linking
+    /// because `-Zcombine-cgu` was specified.
     NeedsLink(ModuleCodegen<B::Module>),
-    NeedsFatLTO(FatLTOInput<B>),
-    NeedsThinLTO(String, B::ThinBuffer),
+
+    /// The backend has finished compiling a CGU, which now needs to go through
+    /// fat LTO.
+    NeedsFatLto(FatLtoInput<B>),
+
+    /// The backend has finished compiling a CGU, which now needs to go through
+    /// thin LTO.
+    NeedsThinLto(String, B::ThinBuffer),
 }
 
-pub enum FatLTOInput<B: WriteBackendMethods> {
+pub enum FatLtoInput<B: WriteBackendMethods> {
     Serialized { name: String, buffer: B::ModuleBuffer },
     InMemory(ModuleCodegen<B::Module>),
 }
@@ -846,7 +855,7 @@ fn execute_optimize_work_item<B: ExtraBackendMethods>(
                     panic!("Error writing pre-lto-bitcode file `{}`: {}", path.display(), e);
                 });
             }
-            Ok(WorkItemResult::NeedsThinLTO(name, thin_buffer))
+            Ok(WorkItemResult::NeedsThinLto(name, thin_buffer))
         }
         ComputedLtoType::Fat => match bitcode {
             Some(path) => {
@@ -854,9 +863,9 @@ fn execute_optimize_work_item<B: ExtraBackendMethods>(
                 fs::write(&path, buffer.data()).unwrap_or_else(|e| {
                     panic!("Error writing pre-lto-bitcode file `{}`: {}", path.display(), e);
                 });
-                Ok(WorkItemResult::NeedsFatLTO(FatLTOInput::Serialized { name, buffer }))
+                Ok(WorkItemResult::NeedsFatLto(FatLtoInput::Serialized { name, buffer }))
             }
-            None => Ok(WorkItemResult::NeedsFatLTO(FatLTOInput::InMemory(module))),
+            None => Ok(WorkItemResult::NeedsFatLto(FatLtoInput::InMemory(module))),
         },
     }
 }
@@ -906,7 +915,7 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
             load_from_incr_comp_dir(dwarf_obj_out, &saved_dwarf_object_file)
         });
 
-    WorkItemResult::Compiled(CompiledModule {
+    WorkItemResult::Finished(CompiledModule {
         name: module.name,
         kind: ModuleKind::Regular,
         object,
@@ -936,7 +945,7 @@ fn finish_intra_module_work<B: ExtraBackendMethods>(
         || module.kind == ModuleKind::Allocator
     {
         let module = unsafe { B::codegen(cgcx, &diag_handler, module, module_config)? };
-        Ok(WorkItemResult::Compiled(module))
+        Ok(WorkItemResult::Finished(module))
     } else {
         Ok(WorkItemResult::NeedsLink(module))
     }
@@ -987,10 +996,15 @@ struct Diagnostic {
 }
 
 #[derive(PartialEq, Clone, Copy, Debug)]
-enum MainThreadWorkerState {
+enum MainThreadState {
+    /// Doing nothing.
     Idle,
+
+    /// Doing codegen, i.e. MIR-to-LLVM-IR conversion.
     Codegenning,
-    LLVMing,
+
+    /// Idle, but lending the compiler process's Token to an LLVM thread so it can do useful work.
+    Lending,
 }
 
 fn start_executing_work<B: ExtraBackendMethods>(
@@ -1089,7 +1103,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
         exported_symbols,
         remark: sess.opts.cg.remark.clone(),
         remark_dir,
-        worker: 0,
         incr_comp_session_dir: sess.incr_comp_session_dir_opt().map(|r| r.clone()),
         cgu_reuse_tracker: sess.cgu_reuse_tracker.clone(),
         coordinator_send,
@@ -1242,7 +1255,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
     // Each LLVM module is automatically sent back to the coordinator for LTO if
     // necessary. There's already optimizations in place to avoid sending work
     // back to the coordinator if LTO isn't requested.
-    return B::spawn_thread(cgcx.time_trace, move || {
+    return B::spawn_named_thread(cgcx.time_trace, "coordinator".to_string(), move || {
         let mut worker_id_counter = 0;
         let mut free_worker_ids = Vec::new();
         let mut get_worker_id = |free_worker_ids: &mut Vec<usize>| {
@@ -1285,10 +1298,19 @@ fn start_executing_work<B: ExtraBackendMethods>(
         // the implicit Token the compiler process owns no matter what.
         let mut tokens = Vec::new();
 
-        let mut main_thread_worker_state = MainThreadWorkerState::Idle;
-        let mut running = 0;
+        let mut main_thread_state = MainThreadState::Idle;
+
+        // How many LLVM worker threads are running while holding a Token. This
+        // *excludes* any that the main thread is lending a Token to.
+        let mut running_with_own_token = 0;
+
+        // How many LLVM worker threads are running in total. This *includes*
+        // any that the main thread is lending a Token to.
+        let running_with_any_token = |main_thread_state, running_with_own_token| {
+            running_with_own_token
+                + if main_thread_state == MainThreadState::Lending { 1 } else { 0 }
+        };
 
-        let prof = &cgcx.prof;
         let mut llvm_start_time: Option<VerboseTimingGuard<'_>> = None;
 
         // Run the message loop while there's still anything that needs message
@@ -1296,66 +1318,62 @@ fn start_executing_work<B: ExtraBackendMethods>(
         // wait for all existing work to finish, so many of the conditions here
         // only apply if codegen hasn't been aborted as they represent pending
         // work to be done.
-        while codegen_state == Ongoing
-            || running > 0
-            || main_thread_worker_state == MainThreadWorkerState::LLVMing
-            || (codegen_state == Completed
-                && !(work_items.is_empty()
-                    && needs_fat_lto.is_empty()
-                    && needs_thin_lto.is_empty()
-                    && lto_import_only_modules.is_empty()
-                    && main_thread_worker_state == MainThreadWorkerState::Idle))
-        {
+        loop {
             // While there are still CGUs to be codegened, the coordinator has
             // to decide how to utilize the compiler processes implicit Token:
             // For codegenning more CGU or for running them through LLVM.
             if codegen_state == Ongoing {
-                if main_thread_worker_state == MainThreadWorkerState::Idle {
+                if main_thread_state == MainThreadState::Idle {
                     // Compute the number of workers that will be running once we've taken as many
                     // items from the work queue as we can, plus one for the main thread. It's not
-                    // critically important that we use this instead of just `running`, but it
-                    // prevents the `queue_full_enough` heuristic from fluctuating just because a
-                    // worker finished up and we decreased the `running` count, even though we're
-                    // just going to increase it right after this when we put a new worker to work.
-                    let extra_tokens = tokens.len().checked_sub(running).unwrap();
+                    // critically important that we use this instead of just
+                    // `running_with_own_token`, but it prevents the `queue_full_enough` heuristic
+                    // from fluctuating just because a worker finished up and we decreased the
+                    // `running_with_own_token` count, even though we're just going to increase it
+                    // right after this when we put a new worker to work.
+                    let extra_tokens = tokens.len().checked_sub(running_with_own_token).unwrap();
                     let additional_running = std::cmp::min(extra_tokens, work_items.len());
-                    let anticipated_running = running + additional_running + 1;
+                    let anticipated_running = running_with_own_token + additional_running + 1;
 
                     if !queue_full_enough(work_items.len(), anticipated_running) {
                         // The queue is not full enough, process more codegen units:
                         if codegen_worker_send.send(CguMessage).is_err() {
                             panic!("Could not send CguMessage to main thread")
                         }
-                        main_thread_worker_state = MainThreadWorkerState::Codegenning;
+                        main_thread_state = MainThreadState::Codegenning;
                     } else {
                         // The queue is full enough to not let the worker
                         // threads starve. Use the implicit Token to do some
                         // LLVM work too.
                         let (item, _) =
                             work_items.pop().expect("queue empty - queue_full_enough() broken?");
-                        let cgcx = CodegenContext {
-                            worker: get_worker_id(&mut free_worker_ids),
-                            ..cgcx.clone()
-                        };
-                        maybe_start_llvm_timer(
-                            prof,
-                            cgcx.config(item.module_kind()),
+                        main_thread_state = MainThreadState::Lending;
+                        spawn_work(
+                            &cgcx,
                             &mut llvm_start_time,
+                            get_worker_id(&mut free_worker_ids),
+                            item,
                         );
-                        main_thread_worker_state = MainThreadWorkerState::LLVMing;
-                        spawn_work(cgcx, item);
                     }
                 }
             } else if codegen_state == Completed {
-                // If we've finished everything related to normal codegen
-                // then it must be the case that we've got some LTO work to do.
-                // Perform the serial work here of figuring out what we're
-                // going to LTO and then push a bunch of work items onto our
-                // queue to do LTO
-                if work_items.is_empty()
-                    && running == 0
-                    && main_thread_worker_state == MainThreadWorkerState::Idle
+                if running_with_any_token(main_thread_state, running_with_own_token) == 0
+                    && work_items.is_empty()
                 {
+                    // All codegen work is done. Do we have LTO work to do?
+                    if needs_fat_lto.is_empty()
+                        && needs_thin_lto.is_empty()
+                        && lto_import_only_modules.is_empty()
+                    {
+                        // Nothing more to do!
+                        break;
+                    }
+
+                    // We have LTO work to do. Perform the serial work here of
+                    // figuring out what we're going to LTO and then push a
+                    // bunch of work items onto our queue to do LTO. This all
+                    // happens on the coordinator thread but it's very quick so
+                    // we don't worry about tokens.
                     assert!(!started_lto);
                     started_lto = true;
 
@@ -1379,20 +1397,16 @@ fn start_executing_work<B: ExtraBackendMethods>(
                 // In this branch, we know that everything has been codegened,
                 // so it's just a matter of determining whether the implicit
                 // Token is free to use for LLVM work.
-                match main_thread_worker_state {
-                    MainThreadWorkerState::Idle => {
+                match main_thread_state {
+                    MainThreadState::Idle => {
                         if let Some((item, _)) = work_items.pop() {
-                            let cgcx = CodegenContext {
-                                worker: get_worker_id(&mut free_worker_ids),
-                                ..cgcx.clone()
-                            };
-                            maybe_start_llvm_timer(
-                                prof,
-                                cgcx.config(item.module_kind()),
+                            main_thread_state = MainThreadState::Lending;
+                            spawn_work(
+                                &cgcx,
                                 &mut llvm_start_time,
+                                get_worker_id(&mut free_worker_ids),
+                                item,
                             );
-                            main_thread_worker_state = MainThreadWorkerState::LLVMing;
-                            spawn_work(cgcx, item);
                         } else {
                             // There is no unstarted work, so let the main thread
                             // take over for a running worker. Otherwise the
@@ -1400,16 +1414,16 @@ fn start_executing_work<B: ExtraBackendMethods>(
                             // We reduce the `running` counter by one. The
                             // `tokens.truncate()` below will take care of
                             // giving the Token back.
-                            debug_assert!(running > 0);
-                            running -= 1;
-                            main_thread_worker_state = MainThreadWorkerState::LLVMing;
+                            debug_assert!(running_with_own_token > 0);
+                            running_with_own_token -= 1;
+                            main_thread_state = MainThreadState::Lending;
                         }
                     }
-                    MainThreadWorkerState::Codegenning => bug!(
+                    MainThreadState::Codegenning => bug!(
                         "codegen worker should not be codegenning after \
                               codegen was already completed"
                     ),
-                    MainThreadWorkerState::LLVMing => {
+                    MainThreadState::Lending => {
                         // Already making good use of that token
                     }
                 }
@@ -1417,35 +1431,39 @@ fn start_executing_work<B: ExtraBackendMethods>(
                 // Don't queue up any more work if codegen was aborted, we're
                 // just waiting for our existing children to finish.
                 assert!(codegen_state == Aborted);
+                if running_with_any_token(main_thread_state, running_with_own_token) == 0 {
+                    break;
+                }
             }
 
             // Spin up what work we can, only doing this while we've got available
             // parallelism slots and work left to spawn.
-            while codegen_state != Aborted && !work_items.is_empty() && running < tokens.len() {
-                let (item, _) = work_items.pop().unwrap();
-
-                maybe_start_llvm_timer(prof, cgcx.config(item.module_kind()), &mut llvm_start_time);
-
-                let cgcx =
-                    CodegenContext { worker: get_worker_id(&mut free_worker_ids), ..cgcx.clone() };
-
-                spawn_work(cgcx, item);
-                running += 1;
+            if codegen_state != Aborted {
+                while !work_items.is_empty() && running_with_own_token < tokens.len() {
+                    let (item, _) = work_items.pop().unwrap();
+                    spawn_work(
+                        &cgcx,
+                        &mut llvm_start_time,
+                        get_worker_id(&mut free_worker_ids),
+                        item,
+                    );
+                    running_with_own_token += 1;
+                }
             }
 
-            // Relinquish accidentally acquired extra tokens
-            tokens.truncate(running);
+            // Relinquish accidentally acquired extra tokens.
+            tokens.truncate(running_with_own_token);
 
             // If a thread exits successfully then we drop a token associated
-            // with that worker and update our `running` count. We may later
-            // re-acquire a token to continue running more work. We may also not
-            // actually drop a token here if the worker was running with an
-            // "ephemeral token"
+            // with that worker and update our `running_with_own_token` count.
+            // We may later re-acquire a token to continue running more work.
+            // We may also not actually drop a token here if the worker was
+            // running with an "ephemeral token".
             let mut free_worker = |worker_id| {
-                if main_thread_worker_state == MainThreadWorkerState::LLVMing {
-                    main_thread_worker_state = MainThreadWorkerState::Idle;
+                if main_thread_state == MainThreadState::Lending {
+                    main_thread_state = MainThreadState::Idle;
                 } else {
-                    running -= 1;
+                    running_with_own_token -= 1;
                 }
 
                 free_worker_ids.push(worker_id);
@@ -1461,17 +1479,17 @@ fn start_executing_work<B: ExtraBackendMethods>(
                         Ok(token) => {
                             tokens.push(token);
 
-                            if main_thread_worker_state == MainThreadWorkerState::LLVMing {
+                            if main_thread_state == MainThreadState::Lending {
                                 // If the main thread token is used for LLVM work
                                 // at the moment, we turn that thread into a regular
                                 // LLVM worker thread, so the main thread is free
                                 // to react to codegen demand.
-                                main_thread_worker_state = MainThreadWorkerState::Idle;
-                                running += 1;
+                                main_thread_state = MainThreadState::Idle;
+                                running_with_own_token += 1;
                             }
                         }
                         Err(e) => {
-                            let msg = &format!("failed to acquire jobserver token: {}", e);
+                            let msg = &format!("failed to acquire jobserver token: {e}");
                             shared_emitter.fatal(msg);
                             codegen_state = Aborted;
                         }
@@ -1496,16 +1514,16 @@ fn start_executing_work<B: ExtraBackendMethods>(
                     if !cgcx.opts.unstable_opts.no_parallel_llvm {
                         helper.request_token();
                     }
-                    assert_eq!(main_thread_worker_state, MainThreadWorkerState::Codegenning);
-                    main_thread_worker_state = MainThreadWorkerState::Idle;
+                    assert_eq!(main_thread_state, MainThreadState::Codegenning);
+                    main_thread_state = MainThreadState::Idle;
                 }
 
                 Message::CodegenComplete => {
                     if codegen_state != Aborted {
                         codegen_state = Completed;
                     }
-                    assert_eq!(main_thread_worker_state, MainThreadWorkerState::Codegenning);
-                    main_thread_worker_state = MainThreadWorkerState::Idle;
+                    assert_eq!(main_thread_state, MainThreadState::Codegenning);
+                    main_thread_state = MainThreadState::Idle;
                 }
 
                 // If codegen is aborted that means translation was aborted due
@@ -1513,7 +1531,8 @@ fn start_executing_work<B: ExtraBackendMethods>(
                 // to exit as soon as possible, but we want to make sure all
                 // existing work has finished. Flag codegen as being done, and
                 // then conditions above will ensure no more work is spawned but
-                // we'll keep executing this loop until `running` hits 0.
+                // we'll keep executing this loop until `running_with_own_token`
+                // hits 0.
                 Message::CodegenAborted => {
                     codegen_state = Aborted;
                 }
@@ -1522,9 +1541,10 @@ fn start_executing_work<B: ExtraBackendMethods>(
                     free_worker(worker_id);
 
                     match result {
-                        Ok(WorkItemResult::Compiled(compiled_module)) => {
+                        Ok(WorkItemResult::Finished(compiled_module)) => {
                             match compiled_module.kind {
                                 ModuleKind::Regular => {
+                                    assert!(needs_link.is_empty());
                                     compiled_modules.push(compiled_module);
                                 }
                                 ModuleKind::Allocator => {
@@ -1535,14 +1555,17 @@ fn start_executing_work<B: ExtraBackendMethods>(
                             }
                         }
                         Ok(WorkItemResult::NeedsLink(module)) => {
+                            assert!(compiled_modules.is_empty());
                             needs_link.push(module);
                         }
-                        Ok(WorkItemResult::NeedsFatLTO(fat_lto_input)) => {
+                        Ok(WorkItemResult::NeedsFatLto(fat_lto_input)) => {
                             assert!(!started_lto);
+                            assert!(needs_thin_lto.is_empty());
                             needs_fat_lto.push(fat_lto_input);
                         }
-                        Ok(WorkItemResult::NeedsThinLTO(name, thin_buffer)) => {
+                        Ok(WorkItemResult::NeedsThinLto(name, thin_buffer)) => {
                             assert!(!started_lto);
+                            assert!(needs_fat_lto.is_empty());
                             needs_thin_lto.push((name, thin_buffer));
                         }
                         Err(Some(WorkerFatalError)) => {
@@ -1560,9 +1583,9 @@ fn start_executing_work<B: ExtraBackendMethods>(
                 Message::AddImportOnlyModule { module_data, work_product } => {
                     assert!(!started_lto);
                     assert_eq!(codegen_state, Ongoing);
-                    assert_eq!(main_thread_worker_state, MainThreadWorkerState::Codegenning);
+                    assert_eq!(main_thread_state, MainThreadState::Codegenning);
                     lto_import_only_modules.push((module_data, work_product));
-                    main_thread_worker_state = MainThreadWorkerState::Idle;
+                    main_thread_state = MainThreadState::Idle;
                 }
             }
         }
@@ -1595,7 +1618,8 @@ fn start_executing_work<B: ExtraBackendMethods>(
             modules: compiled_modules,
             allocator_module: compiled_allocator_module,
         })
-    });
+    })
+    .expect("failed to spawn coordinator thread");
 
     // A heuristic that determines if we have enough LLVM WorkItems in the
     // queue so that the main thread can do LLVM work instead of codegen
@@ -1653,23 +1677,24 @@ fn start_executing_work<B: ExtraBackendMethods>(
         let quarter_of_workers = workers_running - 3 * workers_running / 4;
         items_in_queue > 0 && items_in_queue >= quarter_of_workers
     }
-
-    fn maybe_start_llvm_timer<'a>(
-        prof: &'a SelfProfilerRef,
-        config: &ModuleConfig,
-        llvm_start_time: &mut Option<VerboseTimingGuard<'a>>,
-    ) {
-        if config.time_module && llvm_start_time.is_none() {
-            *llvm_start_time = Some(prof.verbose_generic_activity("LLVM_passes"));
-        }
-    }
 }
 
 /// `FatalError` is explicitly not `Send`.
 #[must_use]
 pub struct WorkerFatalError;
 
-fn spawn_work<B: ExtraBackendMethods>(cgcx: CodegenContext<B>, work: WorkItem<B>) {
+fn spawn_work<'a, B: ExtraBackendMethods>(
+    cgcx: &'a CodegenContext<B>,
+    llvm_start_time: &mut Option<VerboseTimingGuard<'a>>,
+    worker_id: usize,
+    work: WorkItem<B>,
+) {
+    if cgcx.config(work.module_kind()).time_module && llvm_start_time.is_none() {
+        *llvm_start_time = Some(cgcx.prof.verbose_generic_activity("LLVM_passes"));
+    }
+
+    let cgcx = cgcx.clone();
+
     B::spawn_named_thread(cgcx.time_trace, work.short_description(), move || {
         // Set up a destructor which will fire off a message that we're done as
         // we exit.
@@ -1692,11 +1717,8 @@ fn spawn_work<B: ExtraBackendMethods>(cgcx: CodegenContext<B>, work: WorkItem<B>
             }
         }
 
-        let mut bomb = Bomb::<B> {
-            coordinator_send: cgcx.coordinator_send.clone(),
-            result: None,
-            worker_id: cgcx.worker,
-        };
+        let mut bomb =
+            Bomb::<B> { coordinator_send: cgcx.coordinator_send.clone(), result: None, worker_id };
 
         // Execute the work itself, and if it finishes successfully then flag
         // ourselves as a success as well.
@@ -1728,7 +1750,7 @@ fn spawn_work<B: ExtraBackendMethods>(cgcx: CodegenContext<B>, work: WorkItem<B>
             })
         };
     })
-    .expect("failed to spawn thread");
+    .expect("failed to spawn work thread");
 }
 
 enum SharedEmitterMessage {
@@ -1962,19 +1984,6 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
         )
     }
 
-    pub fn submit_pre_codegened_module_to_llvm(
-        &self,
-        tcx: TyCtxt<'_>,
-        module: ModuleCodegen<B::Module>,
-    ) {
-        self.wait_for_signal_to_codegen_item();
-        self.check_for_errors(tcx.sess);
-
-        // These are generally cheap and won't throw off scheduling.
-        let cost = 0;
-        submit_codegened_module_to_llvm(&self.backend, &self.coordinator.sender, module, cost);
-    }
-
     pub fn codegen_finished(&self, tcx: TyCtxt<'_>) {
         self.wait_for_signal_to_codegen_item();
         self.check_for_errors(tcx.sess);
@@ -2040,8 +2049,8 @@ pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
     })));
 }
 
-pub fn pre_lto_bitcode_filename(module_name: &str) -> String {
-    format!("{}.{}", module_name, PRE_LTO_BC_EXT)
+fn pre_lto_bitcode_filename(module_name: &str) -> String {
+    format!("{module_name}.{PRE_LTO_BC_EXT}")
 }
 
 fn msvc_imps_needed(tcx: TyCtxt<'_>) -> bool {
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index dc862803274..0ccb08c78f7 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -38,6 +38,7 @@ use rustc_span::symbol::sym;
 use rustc_span::Symbol;
 use rustc_target::abi::{Align, FIRST_VARIANT};
 
+use std::cmp;
 use std::collections::BTreeSet;
 use std::time::{Duration, Instant};
 
@@ -663,9 +664,16 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
             )
         });
 
-        ongoing_codegen.submit_pre_codegened_module_to_llvm(
-            tcx,
+        ongoing_codegen.wait_for_signal_to_codegen_item();
+        ongoing_codegen.check_for_errors(tcx.sess);
+
+        // These modules are generally cheap and won't throw off scheduling.
+        let cost = 0;
+        submit_codegened_module_to_llvm(
+            &backend,
+            &ongoing_codegen.coordinator.sender,
             ModuleCodegen { name: llmod_id, module_llvm, kind: ModuleKind::Allocator },
+            cost,
         );
     }
 
@@ -682,10 +690,10 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
     // are large size variations, this can reduce memory usage significantly.
     let codegen_units: Vec<_> = {
         let mut sorted_cgus = codegen_units.iter().collect::<Vec<_>>();
-        sorted_cgus.sort_by_cached_key(|cgu| cgu.size_estimate());
+        sorted_cgus.sort_by_key(|cgu| cmp::Reverse(cgu.size_estimate()));
 
         let (first_half, second_half) = sorted_cgus.split_at(sorted_cgus.len() / 2);
-        second_half.iter().rev().interleave(first_half).copied().collect()
+        first_half.iter().interleave(second_half.iter().rev()).copied().collect()
     };
 
     // Calculate the CGU reuse
@@ -760,7 +768,6 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
                     module,
                     cost,
                 );
-                false
             }
             CguReuse::PreLto => {
                 submit_pre_lto_module_to_llvm(
@@ -772,7 +779,6 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
                         source: cgu.previous_work_product(tcx),
                     },
                 );
-                true
             }
             CguReuse::PostLto => {
                 submit_post_lto_module_to_llvm(
@@ -783,9 +789,8 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
                         source: cgu.previous_work_product(tcx),
                     },
                 );
-                true
             }
-        };
+        }
     }
 
     ongoing_codegen.codegen_finished(tcx);
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
index 64f799bb1e6..067c824aba0 100644
--- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
+++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
@@ -414,7 +414,7 @@ fn push_debuginfo_type_name<'tcx>(
         }
         // Type parameters from polymorphized functions.
         ty::Param(_) => {
-            write!(output, "{:?}", t).unwrap();
+            write!(output, "{t:?}").unwrap();
         }
         ty::Error(_)
         | ty::Infer(_)
@@ -565,9 +565,9 @@ fn push_disambiguated_special_name(
     output: &mut String,
 ) {
     if cpp_like_debuginfo {
-        write!(output, "{}${}", label, disambiguator).unwrap();
+        write!(output, "{label}${disambiguator}").unwrap();
     } else {
-        write!(output, "{{{}#{}}}", label, disambiguator).unwrap();
+        write!(output, "{{{label}#{disambiguator}}}").unwrap();
     }
 }
 
@@ -651,15 +651,15 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
             ty::Int(ity) => {
                 let bits = ct.eval_bits(tcx, ty::ParamEnv::reveal_all(), ct.ty());
                 let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128;
-                write!(output, "{}", val)
+                write!(output, "{val}")
             }
             ty::Uint(_) => {
                 let val = ct.eval_bits(tcx, ty::ParamEnv::reveal_all(), ct.ty());
-                write!(output, "{}", val)
+                write!(output, "{val}")
             }
             ty::Bool => {
                 let val = ct.try_eval_bool(tcx, ty::ParamEnv::reveal_all()).unwrap();
-                write!(output, "{}", val)
+                write!(output, "{val}")
             }
             _ => {
                 // If we cannot evaluate the constant to a known type, we fall back
@@ -678,9 +678,9 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
                 });
 
                 if cpp_like_debuginfo(tcx) {
-                    write!(output, "CONST${:x}", hash_short)
+                    write!(output, "CONST${hash_short:x}")
                 } else {
-                    write!(output, "{{CONST#{:x}}}", hash_short)
+                    write!(output, "{{CONST#{hash_short:x}}}")
                 }
             }
         },
@@ -752,7 +752,7 @@ fn push_close_angle_bracket(cpp_like_debuginfo: bool, output: &mut String) {
 }
 
 fn pop_close_angle_bracket(output: &mut String) {
-    assert!(output.ends_with('>'), "'output' does not end with '>': {}", output);
+    assert!(output.ends_with('>'), "'output' does not end with '>': {output}");
     output.pop();
     if output.ends_with(' ') {
         output.pop();
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs
index dbe1d6e8ba8..b7d8b9b45bf 100644
--- a/compiler/rustc_codegen_ssa/src/errors.rs
+++ b/compiler/rustc_codegen_ssa/src/errors.rs
@@ -177,31 +177,31 @@ impl IntoDiagnostic<'_> for ThorinErrorWrapper {
             }
             thorin::Error::NamelessSection(_, offset) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_section_without_name);
-                diag.set_arg("offset", format!("0x{:08x}", offset));
+                diag.set_arg("offset", format!("0x{offset:08x}"));
                 diag
             }
             thorin::Error::RelocationWithInvalidSymbol(section, offset) => {
                 diag =
                     handler.struct_err(fluent::codegen_ssa_thorin_relocation_with_invalid_symbol);
                 diag.set_arg("section", section);
-                diag.set_arg("offset", format!("0x{:08x}", offset));
+                diag.set_arg("offset", format!("0x{offset:08x}"));
                 diag
             }
             thorin::Error::MultipleRelocations(section, offset) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_multiple_relocations);
                 diag.set_arg("section", section);
-                diag.set_arg("offset", format!("0x{:08x}", offset));
+                diag.set_arg("offset", format!("0x{offset:08x}"));
                 diag
             }
             thorin::Error::UnsupportedRelocation(section, offset) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_unsupported_relocation);
                 diag.set_arg("section", section);
-                diag.set_arg("offset", format!("0x{:08x}", offset));
+                diag.set_arg("offset", format!("0x{offset:08x}"));
                 diag
             }
             thorin::Error::MissingDwoName(id) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_missing_dwo_name);
-                diag.set_arg("id", format!("0x{:08x}", id));
+                diag.set_arg("id", format!("0x{id:08x}"));
                 diag
             }
             thorin::Error::NoCompilationUnits => {
@@ -251,7 +251,7 @@ impl IntoDiagnostic<'_> for ThorinErrorWrapper {
             }
             thorin::Error::StrAtOffset(_, offset) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_str_at_offset);
-                diag.set_arg("offset", format!("0x{:08x}", offset));
+                diag.set_arg("offset", format!("0x{offset:08x}"));
                 diag
             }
             thorin::Error::ParseIndex(_, section) => {
@@ -261,7 +261,7 @@ impl IntoDiagnostic<'_> for ThorinErrorWrapper {
             }
             thorin::Error::UnitNotInIndex(unit) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_unit_not_in_index);
-                diag.set_arg("unit", format!("0x{:08x}", unit));
+                diag.set_arg("unit", format!("0x{unit:08x}"));
                 diag
             }
             thorin::Error::RowNotInIndex(_, row) => {
@@ -275,7 +275,7 @@ impl IntoDiagnostic<'_> for ThorinErrorWrapper {
             }
             thorin::Error::EmptyUnit(unit) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_empty_unit);
-                diag.set_arg("unit", format!("0x{:08x}", unit));
+                diag.set_arg("unit", format!("0x{unit:08x}"));
                 diag
             }
             thorin::Error::MultipleDebugInfoSection => {
@@ -292,12 +292,12 @@ impl IntoDiagnostic<'_> for ThorinErrorWrapper {
             }
             thorin::Error::DuplicateUnit(unit) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_duplicate_unit);
-                diag.set_arg("unit", format!("0x{:08x}", unit));
+                diag.set_arg("unit", format!("0x{unit:08x}"));
                 diag
             }
             thorin::Error::MissingReferencedUnit(unit) => {
                 diag = handler.struct_err(fluent::codegen_ssa_thorin_missing_referenced_unit);
-                diag.set_arg("unit", format!("0x{:08x}", unit));
+                diag.set_arg("unit", format!("0x{unit:08x}"));
                 diag
             }
             thorin::Error::NoOutputObjectCreated => {
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index ed608bdbe9a..23c736c1579 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -703,13 +703,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                     with_no_trimmed_paths!({
                         if layout.abi.is_uninhabited() {
                             // Use this error even for the other intrinsics as it is more precise.
-                            format!("attempted to instantiate uninhabited type `{}`", ty)
+                            format!("attempted to instantiate uninhabited type `{ty}`")
                         } else if requirement == ValidityRequirement::Zero {
-                            format!("attempted to zero-initialize type `{}`, which is invalid", ty)
+                            format!("attempted to zero-initialize type `{ty}`, which is invalid")
                         } else {
                             format!(
-                                "attempted to leave type `{}` uninitialized, which is invalid",
-                                ty
+                                "attempted to leave type `{ty}` uninitialized, which is invalid"
                             )
                         }
                     })
@@ -1045,10 +1044,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
             assert_eq!(
                 fn_abi.args.len(),
                 mir_args + 1,
-                "#[track_caller] fn's must have 1 more argument in their ABI than in their MIR: {:?} {:?} {:?}",
-                instance,
-                fn_span,
-                fn_abi,
+                "#[track_caller] fn's must have 1 more argument in their ABI than in their MIR: {instance:?} {fn_span:?} {fn_abi:?}",
             );
             let location =
                 self.get_caller_location(bx, mir::SourceInfo { span: fn_span, ..source_info });
@@ -1555,7 +1551,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
     fn landing_pad_for_uncached(&mut self, bb: mir::BasicBlock) -> Bx::BasicBlock {
         let llbb = self.llbb(bb);
         if base::wants_new_eh_instructions(self.cx.sess()) {
-            let cleanup_bb = Bx::append_block(self.cx, self.llfn, &format!("funclet_{:?}", bb));
+            let cleanup_bb = Bx::append_block(self.cx, self.llfn, &format!("funclet_{bb:?}"));
             let mut cleanup_bx = Bx::build(self.cx, cleanup_bb);
             let funclet = cleanup_bx.cleanup_pad(None, &[]);
             cleanup_bx.br(llbb);
@@ -1675,7 +1671,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         match self.cached_llbbs[bb] {
             CachedLlbb::None => {
                 // FIXME(eddyb) only name the block if `fewer_names` is `false`.
-                let llbb = Bx::append_block(self.cx, self.llfn, &format!("{:?}", bb));
+                let llbb = Bx::append_block(self.cx, self.llfn, &format!("{bb:?}"));
                 self.cached_llbbs[bb] = CachedLlbb::Some(llbb);
                 Some(llbb)
             }
diff --git a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
index 34b8d8b5a6f..4167a85ccd5 100644
--- a/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs
@@ -337,7 +337,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         } else {
             Some(match whole_local_var.or(fallback_var.clone()) {
                 Some(var) if var.name != kw::Empty => var.name.to_string(),
-                _ => format!("{:?}", local),
+                _ => format!("{local:?}"),
             })
         };
 
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
index 1f90a28eb8e..e7539da0a05 100644
--- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
@@ -397,8 +397,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
     ) -> OperandRef<'tcx, Bx::Value> {
         assert!(
             self.rvalue_creates_operand(rvalue, DUMMY_SP),
-            "cannot codegen {:?} to operand",
-            rvalue,
+            "cannot codegen {rvalue:?} to operand",
         );
 
         match *rvalue {
diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs
index b72a1a07866..6fbf992eda9 100644
--- a/compiler/rustc_codegen_ssa/src/mono_item.rs
+++ b/compiler/rustc_codegen_ssa/src/mono_item.rs
@@ -140,8 +140,8 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
             MonoItem::Fn(instance) => {
                 format!("Fn({:?}, {})", instance.def, instance.args.as_ptr().addr())
             }
-            MonoItem::Static(id) => format!("Static({:?})", id),
-            MonoItem::GlobalAsm(id) => format!("GlobalAsm({:?})", id),
+            MonoItem::Static(id) => format!("Static({id:?})"),
+            MonoItem::GlobalAsm(id) => format!("GlobalAsm({id:?})"),
         }
     }
 }
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs
index 48c6c75bb1a..98e561b0aef 100644
--- a/compiler/rustc_codegen_ssa/src/target_features.rs
+++ b/compiler/rustc_codegen_ssa/src/target_features.rs
@@ -369,9 +369,9 @@ pub fn from_target_feature(
         // We allow comma separation to enable multiple features.
         target_features.extend(value.as_str().split(',').filter_map(|feature| {
             let Some(feature_gate) = supported_target_features.get(feature) else {
-                let msg = format!("the feature named `{}` is not valid for this target", feature);
+                let msg = format!("the feature named `{feature}` is not valid for this target");
                 let mut err = tcx.sess.struct_span_err(item.span(), msg);
-                err.span_label(item.span(), format!("`{}` is not valid for this target", feature));
+                err.span_label(item.span(), format!("`{feature}` is not valid for this target"));
                 if let Some(stripped) = feature.strip_prefix('+') {
                     let valid = supported_target_features.contains_key(stripped);
                     if valid {
@@ -405,7 +405,7 @@ pub fn from_target_feature(
                     &tcx.sess.parse_sess,
                     feature_gate.unwrap(),
                     item.span(),
-                    format!("the target feature `{}` is currently unstable", feature),
+                    format!("the target feature `{feature}` is currently unstable"),
                 )
                 .emit();
             }
diff --git a/compiler/rustc_codegen_ssa/src/traits/backend.rs b/compiler/rustc_codegen_ssa/src/traits/backend.rs
index 1991b55f191..0a02ca6b317 100644
--- a/compiler/rustc_codegen_ssa/src/traits/backend.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/backend.rs
@@ -142,15 +142,6 @@ pub trait ExtraBackendMethods:
         target_features: &[String],
     ) -> TargetMachineFactoryFn<Self>;
 
-    fn spawn_thread<F, T>(_time_trace: bool, f: F) -> std::thread::JoinHandle<T>
-    where
-        F: FnOnce() -> T,
-        F: Send + 'static,
-        T: Send + 'static,
-    {
-        std::thread::spawn(f)
-    }
-
     fn spawn_named_thread<F, T>(
         _time_trace: bool,
         name: String,
diff --git a/compiler/rustc_codegen_ssa/src/traits/write.rs b/compiler/rustc_codegen_ssa/src/traits/write.rs
index a3b11ed4fe8..ecf5095d8a3 100644
--- a/compiler/rustc_codegen_ssa/src/traits/write.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/write.rs
@@ -1,5 +1,5 @@
 use crate::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule};
-use crate::back::write::{CodegenContext, FatLTOInput, ModuleConfig};
+use crate::back::write::{CodegenContext, FatLtoInput, ModuleConfig};
 use crate::{CompiledModule, ModuleCodegen};
 
 use rustc_errors::{FatalError, Handler};
@@ -23,7 +23,7 @@ pub trait WriteBackendMethods: 'static + Sized + Clone {
     /// for further optimization.
     fn run_fat_lto(
         cgcx: &CodegenContext<Self>,
-        modules: Vec<FatLTOInput<Self>>,
+        modules: Vec<FatLtoInput<Self>>,
         cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>,
     ) -> Result<LtoModuleCodegen<Self>, FatalError>;
     /// Performs thin LTO by performing necessary global analysis and returning two
diff --git a/compiler/rustc_const_eval/Cargo.toml b/compiler/rustc_const_eval/Cargo.toml
index 74030a43c50..4e47fed8640 100644
--- a/compiler/rustc_const_eval/Cargo.toml
+++ b/compiler/rustc_const_eval/Cargo.toml
@@ -8,7 +8,7 @@ edition = "2021"
 [dependencies]
 tracing = "0.1"
 either = "1"
-rustc_apfloat = { path = "../rustc_apfloat" }
+rustc_apfloat = "0.2.0"
 rustc_ast = { path = "../rustc_ast" }
 rustc_attr = { path = "../rustc_attr" }
 rustc_data_structures = { path = "../rustc_data_structures" }
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs
index ffeff8d079a..d39a7e8a192 100644
--- a/compiler/rustc_const_eval/src/const_eval/error.rs
+++ b/compiler/rustc_const_eval/src/const_eval/error.rs
@@ -138,7 +138,10 @@ where
         err_inval!(Layout(LayoutError::Unknown(_))) | err_inval!(TooGeneric) => {
             ErrorHandled::TooGeneric
         }
-        err_inval!(AlreadyReported(error_reported)) => ErrorHandled::Reported(error_reported),
+        err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar),
+        err_inval!(Layout(LayoutError::ReferencesError(guar))) => {
+            ErrorHandled::Reported(guar.into())
+        }
         err_inval!(Layout(layout_error @ LayoutError::SizeOverflow(_))) => {
             // We must *always* hard error on these, even if the caller wants just a lint.
             // The `message` makes little sense here, this is a more serious error than the
diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
index 55d719d2703..4c7e9194401 100644
--- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -52,7 +52,7 @@ fn eval_body_using_ecx<'mir, 'tcx>(
     trace!(
         "eval_body_using_ecx: pushing stack frame for global: {}{}",
         with_no_trimmed_paths!(ecx.tcx.def_path_str(cid.instance.def_id())),
-        cid.promoted.map_or_else(String::new, |p| format!("::promoted[{:?}]", p))
+        cid.promoted.map_or_else(String::new, |p| format!("::promoted[{p:?}]"))
     );
 
     ecx.push_stack_frame(
@@ -228,7 +228,6 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> {
-    assert!(key.param_env.is_const());
     // see comment in eval_to_allocation_raw_provider for what we're doing here
     if key.param_env.reveal() == Reveal::All {
         let mut key = key;
@@ -269,7 +268,6 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::EvalToAllocationRawResult<'tcx> {
-    assert!(key.param_env.is_const());
     // Because the constant is computed twice (once per value of `Reveal`), we are at risk of
     // reporting the same error twice here. To resolve this, we check whether we can evaluate the
     // constant in the more restrictive `Reveal::UserFacing`, which most likely already was
diff --git a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
index fa8253d5e49..cc39387c41f 100644
--- a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs
@@ -28,15 +28,18 @@ pub fn is_parent_const_impl_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
         && tcx.constness(parent_id) == hir::Constness::Const
 }
 
-/// Checks whether an item is considered to be `const`. If it is a constructor, it is const. If
-/// it is a trait impl/function, return if it has a `const` modifier. If it is an intrinsic,
-/// report whether said intrinsic has a `rustc_const_{un,}stable` attribute. Otherwise, return
-/// `Constness::NotConst`.
+/// Checks whether an item is considered to be `const`. If it is a constructor, anonymous const,
+/// const block, const item or associated const, it is const. If it is a trait impl/function,
+/// return if it has a `const` modifier. If it is an intrinsic, report whether said intrinsic
+/// has a `rustc_const_{un,}stable` attribute. Otherwise, return `Constness::NotConst`.
 fn constness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Constness {
     let node = tcx.hir().get_by_def_id(def_id);
 
     match node {
-        hir::Node::Ctor(_) => hir::Constness::Const,
+        hir::Node::Ctor(_)
+        | hir::Node::AnonConst(_)
+        | hir::Node::ConstBlock(_)
+        | hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(..), .. }) => hir::Constness::Const,
         hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(impl_), .. }) => impl_.constness,
         hir::Node::ForeignItem(hir::ForeignItem { kind: hir::ForeignItemKind::Fn(..), .. }) => {
             // Intrinsics use `rustc_const_{un,}stable` attributes to indicate constness. All other
diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs
index 744dd114ca7..7c1dbddfc26 100644
--- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs
+++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs
@@ -55,7 +55,7 @@ fn slice_branches<'tcx>(
     place: &MPlaceTy<'tcx>,
     num_nodes: &mut usize,
 ) -> ValTreeCreationResult<'tcx> {
-    let n = place.len(ecx).unwrap_or_else(|_| panic!("expected to use len of place {:?}", place));
+    let n = place.len(ecx).unwrap_or_else(|_| panic!("expected to use len of place {place:?}"));
 
     let mut elems = Vec::with_capacity(n as usize);
     for i in 0..n {
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index 0e6125388a6..3ac6f07e8b7 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -958,7 +958,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         } else {
             self.param_env
         };
-        let param_env = param_env.with_const();
         let val = self.ctfe_query(span, |tcx| tcx.eval_to_allocation_raw(param_env.and(gid)))?;
         self.raw_const_to_mplace(val)
     }
@@ -1016,7 +1015,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug
         match self.place {
             Place::Local { frame, local, offset } => {
                 let mut allocs = Vec::new();
-                write!(fmt, "{:?}", local)?;
+                write!(fmt, "{local:?}")?;
                 if let Some(offset) = offset {
                     write!(fmt, "+{:#x}", offset.bytes())?;
                 }
@@ -1035,7 +1034,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug
                             fmt,
                             " by {} ref {:?}:",
                             match mplace.meta {
-                                MemPlaceMeta::Meta(meta) => format!(" meta({:?})", meta),
+                                MemPlaceMeta::Meta(meta) => format!(" meta({meta:?})"),
                                 MemPlaceMeta::None => String::new(),
                             },
                             mplace.ptr,
@@ -1043,13 +1042,13 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug
                         allocs.extend(mplace.ptr.provenance.map(Provenance::get_alloc_id));
                     }
                     LocalValue::Live(Operand::Immediate(Immediate::Scalar(val))) => {
-                        write!(fmt, " {:?}", val)?;
+                        write!(fmt, " {val:?}")?;
                         if let Scalar::Ptr(ptr, _size) = val {
                             allocs.push(ptr.provenance.get_alloc_id());
                         }
                     }
                     LocalValue::Live(Operand::Immediate(Immediate::ScalarPair(val1, val2))) => {
-                        write!(fmt, " ({:?}, {:?})", val1, val2)?;
+                        write!(fmt, " ({val1:?}, {val2:?})")?;
                         if let Scalar::Ptr(ptr, _size) = val1 {
                             allocs.push(ptr.provenance.get_alloc_id());
                         }
@@ -1065,7 +1064,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> std::fmt::Debug
                 Some(alloc_id) => {
                     write!(fmt, "by ref {:?}: {:?}", mplace.ptr, self.ecx.dump_alloc(alloc_id))
                 }
-                ptr => write!(fmt, " integral by ref: {:?}", ptr),
+                ptr => write!(fmt, " integral by ref: {ptr:?}"),
             },
         }
     }
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index 4020d96b80e..be7c14f33c2 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -394,17 +394,14 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                         // For *all* intrinsics we first check `is_uninhabited` to give a more specific
                         // error message.
                         _ if layout.abi.is_uninhabited() => format!(
-                            "aborted execution: attempted to instantiate uninhabited type `{}`",
-                            ty
+                            "aborted execution: attempted to instantiate uninhabited type `{ty}`"
                         ),
                         ValidityRequirement::Inhabited => bug!("handled earlier"),
                         ValidityRequirement::Zero => format!(
-                            "aborted execution: attempted to zero-initialize type `{}`, which is invalid",
-                            ty
+                            "aborted execution: attempted to zero-initialize type `{ty}`, which is invalid"
                         ),
                         ValidityRequirement::UninitMitigated0x01Fill => format!(
-                            "aborted execution: attempted to leave type `{}` uninitialized, which is invalid",
-                            ty
+                            "aborted execution: attempted to leave type `{ty}` uninitialized, which is invalid"
                         ),
                         ValidityRequirement::Uninit => bug!("assert_uninit_valid doesn't exist"),
                     };
@@ -420,9 +417,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                 assert_eq!(input_len, dest_len, "Return vector length must match input length");
                 assert!(
                     index < dest_len,
-                    "Index `{}` must be in bounds of vector with length {}",
-                    index,
-                    dest_len
+                    "Index `{index}` must be in bounds of vector with length {dest_len}"
                 );
 
                 for i in 0..dest_len {
@@ -440,9 +435,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                 let (input, input_len) = self.operand_to_simd(&args[0])?;
                 assert!(
                     index < input_len,
-                    "index `{}` must be in bounds of vector with length {}",
-                    index,
-                    input_len
+                    "index `{index}` must be in bounds of vector with length {input_len}"
                 );
                 self.copy_op(
                     &self.project_index(&input, index)?,
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs
index 7b44a20ef03..02d022a2252 100644
--- a/compiler/rustc_const_eval/src/interpret/memory.rs
+++ b/compiler/rustc_const_eval/src/interpret/memory.rs
@@ -53,7 +53,7 @@ impl<T: fmt::Display> fmt::Display for MemoryKind<T> {
         match self {
             MemoryKind::Stack => write!(f, "stack variable"),
             MemoryKind::CallerLocation => write!(f, "caller location"),
-            MemoryKind::Machine(m) => write!(f, "{}", m),
+            MemoryKind::Machine(m) => write!(f, "{m}"),
         }
     }
 }
@@ -907,7 +907,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
             match self.ecx.memory.alloc_map.get(id) {
                 Some((kind, alloc)) => {
                     // normal alloc
-                    write!(fmt, " ({}, ", kind)?;
+                    write!(fmt, " ({kind}, ")?;
                     write_allocation_track_relocs(
                         &mut *fmt,
                         *self.ecx.tcx,
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index d1427b09632..6e57a56b445 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -698,10 +698,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             ty::ConstKind::Unevaluated(uv) => {
                 let instance = self.resolve(uv.def, uv.args)?;
                 let cid = GlobalId { instance, promoted: None };
-                self.ctfe_query(span, |tcx| {
-                    tcx.eval_to_valtree(self.param_env.with_const().and(cid))
-                })?
-                .unwrap_or_else(|| bug!("unable to create ValTree for {uv:?}"))
+                self.ctfe_query(span, |tcx| tcx.eval_to_valtree(self.param_env.and(cid)))?
+                    .unwrap_or_else(|| bug!("unable to create ValTree for {uv:?}"))
             }
             ty::ConstKind::Bound(..) | ty::ConstKind::Infer(..) => {
                 span_bug!(self.cur_span(), "unexpected ConstKind in ctfe: {val:?}")
diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs
index 49c3b152e1d..eb064578067 100644
--- a/compiler/rustc_const_eval/src/interpret/operator.rs
+++ b/compiler/rustc_const_eval/src/interpret/operator.rs
@@ -24,8 +24,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         debug_assert_eq!(
             Ty::new_tup(self.tcx.tcx, &[ty, self.tcx.types.bool]),
             dest.layout.ty,
-            "type mismatch for result of {:?}",
-            op,
+            "type mismatch for result of {op:?}",
         );
         // Write the result to `dest`.
         if let Abi::ScalarPair(..) = dest.layout.abi {
@@ -56,7 +55,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
         dest: &PlaceTy<'tcx, M::Provenance>,
     ) -> InterpResult<'tcx> {
         let (val, _overflowed, ty) = self.overflowing_binary_op(op, left, right)?;
-        assert_eq!(ty, dest.layout.ty, "type mismatch for result of {:?}", op);
+        assert_eq!(ty, dest.layout.ty, "type mismatch for result of {op:?}");
         self.write_scalar(val, dest)
     }
 }
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 1f2d04f4008..91341ddacd1 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -178,7 +178,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                 // The operand always has the same type as the result.
                 let val = self.read_immediate(&self.eval_operand(operand, Some(dest.layout))?)?;
                 let val = self.unary_op(un_op, &val)?;
-                assert_eq!(val.layout, dest.layout, "layout mismatch for result of {:?}", un_op);
+                assert_eq!(val.layout, dest.layout, "layout mismatch for result of {un_op:?}");
                 self.write_immediate(*val, &dest)?;
             }
 
diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs
index 4fd5fd13c3c..aee95f70bc2 100644
--- a/compiler/rustc_const_eval/src/interpret/validity.rs
+++ b/compiler/rustc_const_eval/src/interpret/validity.rs
@@ -164,14 +164,14 @@ fn write_path(out: &mut String, path: &[PathElem]) {
 
     for elem in path.iter() {
         match elem {
-            Field(name) => write!(out, ".{}", name),
+            Field(name) => write!(out, ".{name}"),
             EnumTag => write!(out, ".<enum-tag>"),
-            Variant(name) => write!(out, ".<enum-variant({})>", name),
+            Variant(name) => write!(out, ".<enum-variant({name})>"),
             GeneratorTag => write!(out, ".<generator-tag>"),
             GeneratorState(idx) => write!(out, ".<generator-state({})>", idx.index()),
-            CapturedVar(name) => write!(out, ".<captured-var({})>", name),
-            TupleElem(idx) => write!(out, ".{}", idx),
-            ArrayElem(idx) => write!(out, "[{}]", idx),
+            CapturedVar(name) => write!(out, ".<captured-var({name})>"),
+            TupleElem(idx) => write!(out, ".{idx}"),
+            ArrayElem(idx) => write!(out, "[{idx}]"),
             // `.<deref>` does not match Rust syntax, but it is more readable for long paths -- and
             // some of the other items here also are not Rust syntax. Actually we can't
             // even use the usual syntax because we are just showing the projections,
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
index 15a7c0536cb..ad5ffa6511f 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
@@ -21,7 +21,7 @@ use std::mem;
 use std::ops::Deref;
 
 use super::ops::{self, NonConstOp, Status};
-use super::qualifs::{self, CustomEq, HasMutInterior, NeedsDrop, NeedsNonConstDrop};
+use super::qualifs::{self, CustomEq, HasMutInterior, NeedsDrop};
 use super::resolver::FlowSensitiveAnalysis;
 use super::{ConstCx, Qualif};
 use crate::const_eval::is_unstable_const_fn;
@@ -34,7 +34,7 @@ type QualifResults<'mir, 'tcx, Q> =
 pub struct Qualifs<'mir, 'tcx> {
     has_mut_interior: Option<QualifResults<'mir, 'tcx, HasMutInterior>>,
     needs_drop: Option<QualifResults<'mir, 'tcx, NeedsDrop>>,
-    needs_non_const_drop: Option<QualifResults<'mir, 'tcx, NeedsNonConstDrop>>,
+    // needs_non_const_drop: Option<QualifResults<'mir, 'tcx, NeedsNonConstDrop>>,
 }
 
 impl<'mir, 'tcx> Qualifs<'mir, 'tcx> {
@@ -77,15 +77,17 @@ impl<'mir, 'tcx> Qualifs<'mir, 'tcx> {
         local: Local,
         location: Location,
     ) -> bool {
+        // FIXME(effects) replace with `NeedsNonconstDrop` after const traits work again
+        /*
         let ty = ccx.body.local_decls[local].ty;
-        if !NeedsNonConstDrop::in_any_value_of_ty(ccx, ty) {
+        if !NeedsDrop::in_any_value_of_ty(ccx, ty) {
             return false;
         }
 
         let needs_non_const_drop = self.needs_non_const_drop.get_or_insert_with(|| {
             let ConstCx { tcx, body, .. } = *ccx;
 
-            FlowSensitiveAnalysis::new(NeedsNonConstDrop, ccx)
+            FlowSensitiveAnalysis::new(NeedsDrop, ccx)
                 .into_engine(tcx, &body)
                 .iterate_to_fixpoint()
                 .into_results_cursor(&body)
@@ -93,6 +95,9 @@ impl<'mir, 'tcx> Qualifs<'mir, 'tcx> {
 
         needs_non_const_drop.seek_before_primary_effect(location);
         needs_non_const_drop.get().contains(local)
+        */
+
+        self.needs_drop(ccx, local, location)
     }
 
     /// Returns `true` if `local` is `HasMutInterior` at the given `Location`.
@@ -798,16 +803,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                         }
                         Ok(Some(ImplSource::UserDefined(data))) => {
                             let callee_name = tcx.item_name(callee);
-                            if let Some(&did) = tcx
-                                .associated_item_def_ids(data.impl_def_id)
-                                .iter()
-                                .find(|did| tcx.item_name(**did) == callee_name)
-                            {
-                                // using internal args is ok here, since this is only
-                                // used for the `resolve` call below
-                                fn_args = GenericArgs::identity_for_item(tcx, did);
-                                callee = did;
-                            }
 
                             if let hir::Constness::NotConst = tcx.constness(data.impl_def_id) {
                                 self.check_op(ops::FnCallNonConst {
@@ -820,6 +815,17 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                                 });
                                 return;
                             }
+
+                            if let Some(&did) = tcx
+                                .associated_item_def_ids(data.impl_def_id)
+                                .iter()
+                                .find(|did| tcx.item_name(**did) == callee_name)
+                            {
+                                // using internal args is ok here, since this is only
+                                // used for the `resolve` call below
+                                fn_args = GenericArgs::identity_for_item(tcx, did);
+                                callee = did;
+                            }
                         }
                         _ if !tcx.is_const_fn_raw(callee) => {
                             // At this point, it is only legal when the caller is in a trait
@@ -996,8 +1002,9 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                 let mut err_span = self.span;
                 let ty_of_dropped_place = dropped_place.ty(self.body, self.tcx).ty;
 
+                // FIXME(effects) replace with `NeedsNonConstDrop` once we fix const traits
                 let ty_needs_non_const_drop =
-                    qualifs::NeedsNonConstDrop::in_any_value_of_ty(self.ccx, ty_of_dropped_place);
+                    qualifs::NeedsDrop::in_any_value_of_ty(self.ccx, ty_of_dropped_place);
 
                 debug!(?ty_of_dropped_place, ?ty_needs_non_const_drop);
 
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
index 81337079af2..e785196c744 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
@@ -310,8 +310,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallNonConst<'tcx> {
 
         if let Some(feature) = feature && ccx.tcx.sess.is_nightly_build() {
             err.help(format!(
-                "add `#![feature({})]` to the crate attributes to enable",
-                feature,
+                "add `#![feature({feature})]` to the crate attributes to enable",
             ));
         }
 
@@ -346,10 +345,7 @@ impl<'tcx> NonConstOp<'tcx> for FnCallUnstable {
             err.help("const-stable functions can only call other const-stable functions");
         } else if ccx.tcx.sess.is_nightly_build() {
             if let Some(feature) = feature {
-                err.help(format!(
-                    "add `#![feature({})]` to the crate attributes to enable",
-                    feature
-                ));
+                err.help(format!("add `#![feature({feature})]` to the crate attributes to enable"));
             }
         }
 
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/post_drop_elaboration.rs b/compiler/rustc_const_eval/src/transform/check_consts/post_drop_elaboration.rs
index 1f1640fd80a..e3377bd10c6 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/post_drop_elaboration.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/post_drop_elaboration.rs
@@ -5,7 +5,7 @@ use rustc_span::{symbol::sym, Span};
 
 use super::check::Qualifs;
 use super::ops::{self, NonConstOp};
-use super::qualifs::{NeedsNonConstDrop, Qualif};
+use super::qualifs::{NeedsDrop, Qualif};
 use super::ConstCx;
 
 /// Returns `true` if we should use the more precise live drop checker that runs after drop
@@ -82,7 +82,9 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
         match &terminator.kind {
             mir::TerminatorKind::Drop { place: dropped_place, .. } => {
                 let dropped_ty = dropped_place.ty(self.body, self.tcx).ty;
-                if !NeedsNonConstDrop::in_any_value_of_ty(self.ccx, dropped_ty) {
+
+                // FIXME(effects) use `NeedsNonConstDrop`
+                if !NeedsDrop::in_any_value_of_ty(self.ccx, dropped_ty) {
                     // Instead of throwing a bug, we just return here. This is because we have to
                     // run custom `const Drop` impls.
                     return;
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
index b3730dd2648..b152644a551 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs
@@ -23,7 +23,8 @@ pub fn in_any_value_of_ty<'tcx>(
     ConstQualifs {
         has_mut_interior: HasMutInterior::in_any_value_of_ty(cx, ty),
         needs_drop: NeedsDrop::in_any_value_of_ty(cx, ty),
-        needs_non_const_drop: NeedsNonConstDrop::in_any_value_of_ty(cx, ty),
+        // FIXME(effects)
+        needs_non_const_drop: NeedsDrop::in_any_value_of_ty(cx, ty),
         custom_eq: CustomEq::in_any_value_of_ty(cx, ty),
         tainted_by_errors,
     }
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index 7b2bed302db..31effadd2c2 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -149,7 +149,7 @@ impl<'a, 'tcx> CfgChecker<'a, 'tcx> {
                 }
             }
         } else {
-            self.fail(location, format!("encountered jump to invalid basic block {:?}", bb))
+            self.fail(location, format!("encountered jump to invalid basic block {bb:?}"))
         }
     }
 
@@ -222,8 +222,7 @@ impl<'a, 'tcx> CfgChecker<'a, 'tcx> {
                     self.fail(
                         Location { block: bb, statement_index: 0 },
                         format!(
-                            "Cleanup control flow violation: Cycle involving edge {:?} -> {:?}",
-                            bb, parent,
+                            "Cleanup control flow violation: Cycle involving edge {bb:?} -> {parent:?}",
                         ),
                     );
                     break;
@@ -257,7 +256,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> {
         if self.body.local_decls.get(local).is_none() {
             self.fail(
                 location,
-                format!("local {:?} has no corresponding declaration in `body.local_decls`", local),
+                format!("local {local:?} has no corresponding declaration in `body.local_decls`"),
             );
         }
 
@@ -272,7 +271,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> {
             self.storage_liveness.seek_after_primary_effect(location);
             let locals_with_storage = self.storage_liveness.get();
             if !locals_with_storage.contains(local) {
-                self.fail(location, format!("use of local {:?}, which has no storage here", local));
+                self.fail(location, format!("use of local {local:?}, which has no storage here"));
             }
         }
     }
@@ -323,7 +322,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> {
                 // DropsLowered`. However, this causes ICEs with generation of drop shims, which
                 // seem to fail to set their `MirPhase` correctly.
                 if matches!(kind, RetagKind::Raw | RetagKind::TwoPhase) {
-                    self.fail(location, format!("explicit `{:?}` is forbidden", kind));
+                    self.fail(location, format!("explicit `{kind:?}` is forbidden"));
                 }
             }
             StatementKind::StorageLive(local) => {
@@ -556,7 +555,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 let ty = place.ty(&self.body.local_decls, self.tcx).ty;
 
                 if !ty.is_copy_modulo_regions(self.tcx, self.param_env) {
-                    self.fail(location, format!("`Operand::Copy` with non-`Copy` type {}", ty));
+                    self.fail(location, format!("`Operand::Copy` with non-`Copy` type {ty}"));
                 }
             }
         }
@@ -575,7 +574,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
             ProjectionElem::Index(index) => {
                 let index_ty = self.body.local_decls[index].ty;
                 if index_ty != self.tcx.types.usize {
-                    self.fail(location, format!("bad index ({:?} != usize)", index_ty))
+                    self.fail(location, format!("bad index ({index_ty:?} != usize)"))
                 }
             }
             ProjectionElem::Deref
@@ -586,22 +585,21 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 if base_ty.is_box() {
                     self.fail(
                         location,
-                        format!("{:?} dereferenced after ElaborateBoxDerefs", base_ty),
+                        format!("{base_ty:?} dereferenced after ElaborateBoxDerefs"),
                     )
                 }
             }
             ProjectionElem::Field(f, ty) => {
                 let parent_ty = place_ref.ty(&self.body.local_decls, self.tcx);
                 let fail_out_of_bounds = |this: &mut Self, location| {
-                    this.fail(location, format!("Out of bounds field {:?} for {:?}", f, parent_ty));
+                    this.fail(location, format!("Out of bounds field {f:?} for {parent_ty:?}"));
                 };
                 let check_equal = |this: &mut Self, location, f_ty| {
                     if !this.mir_assign_valid_types(ty, f_ty) {
                         this.fail(
                             location,
                             format!(
-                                "Field projection `{:?}.{:?}` specified type `{:?}`, but actual type is `{:?}`",
-                                place_ref, f, ty, f_ty
+                                "Field projection `{place_ref:?}.{f:?}` specified type `{ty:?}`, but actual type is `{f_ty:?}`"
                             )
                         )
                     }
@@ -649,7 +647,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             let Some(layout) = gen_body.generator_layout() else {
                                 self.fail(
                                     location,
-                                    format!("No generator layout for {:?}", parent_ty),
+                                    format!("No generator layout for {parent_ty:?}"),
                                 );
                                 return;
                             };
@@ -662,7 +660,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             let Some(f_ty) = layout.field_tys.get(local) else {
                                 self.fail(
                                     location,
-                                    format!("Out of bounds local {:?} for {:?}", local, parent_ty),
+                                    format!("Out of bounds local {local:?} for {parent_ty:?}"),
                                 );
                                 return;
                             };
@@ -705,7 +703,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 if debuginfo.references != 0 && place.projection.last() == Some(&PlaceElem::Deref) {
                     self.fail(
                         START_BLOCK.start_location(),
-                        format!("debuginfo {:?}, has both ref and deref", debuginfo),
+                        format!("debuginfo {debuginfo:?}, has both ref and deref"),
                     );
                 }
             }
@@ -715,7 +713,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     if ty.is_union() || ty.is_enum() {
                         self.fail(
                             START_BLOCK.start_location(),
-                            format!("invalid type {:?} for composite debuginfo", ty),
+                            format!("invalid type {ty:?} for composite debuginfo"),
                         );
                     }
                     if f.projection.iter().any(|p| !matches!(p, PlaceElem::Field(..))) {
@@ -742,7 +740,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
             && cntxt != PlaceContext::NonUse(NonUseContext::VarDebugInfo)
             && place.projection[1..].contains(&ProjectionElem::Deref)
         {
-            self.fail(location, format!("{:?}, has deref at the wrong place", place));
+            self.fail(location, format!("{place:?}, has deref at the wrong place"));
         }
 
         self.super_place(place, cntxt, location);
@@ -802,7 +800,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     Offset => {
                         check_kinds!(a, "Cannot offset non-pointer type {:?}", ty::RawPtr(..));
                         if b != self.tcx.types.isize && b != self.tcx.types.usize {
-                            self.fail(location, format!("Cannot offset by non-isize type {:?}", b));
+                            self.fail(location, format!("Cannot offset by non-isize type {b:?}"));
                         }
                     }
                     Eq | Lt | Le | Ne | Ge | Gt => {
@@ -867,13 +865,12 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                             self.fail(
                                 location,
                                 format!(
-                                    "Cannot perform checked arithmetic on unequal types {:?} and {:?}",
-                                    a, b
+                                    "Cannot perform checked arithmetic on unequal types {a:?} and {b:?}"
                                 ),
                             );
                         }
                     }
-                    _ => self.fail(location, format!("There is no checked version of {:?}", op)),
+                    _ => self.fail(location, format!("There is no checked version of {op:?}")),
                 }
             }
             Rvalue::UnaryOp(op, operand) => {
@@ -1078,7 +1075,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 if !ty.is_bool() {
                     self.fail(
                         location,
-                        format!("`assume` argument must be `bool`, but got: `{}`", ty),
+                        format!("`assume` argument must be `bool`, but got: `{ty}`"),
                     );
                 }
             }
@@ -1091,7 +1088,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 } else {
                     self.fail(
                         location,
-                        format!("Expected src to be ptr in copy_nonoverlapping, got: {}", src_ty),
+                        format!("Expected src to be ptr in copy_nonoverlapping, got: {src_ty}"),
                     );
                     return;
                 };
@@ -1101,19 +1098,19 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 } else {
                     self.fail(
                         location,
-                        format!("Expected dst to be ptr in copy_nonoverlapping, got: {}", dst_ty),
+                        format!("Expected dst to be ptr in copy_nonoverlapping, got: {dst_ty}"),
                     );
                     return;
                 };
                 // since CopyNonOverlapping is parametrized by 1 type,
                 // we only need to check that they are equal and not keep an extra parameter.
                 if !self.mir_assign_valid_types(op_src_ty, op_dst_ty) {
-                    self.fail(location, format!("bad arg ({:?} != {:?})", op_src_ty, op_dst_ty));
+                    self.fail(location, format!("bad arg ({op_src_ty:?} != {op_dst_ty:?})"));
                 }
 
                 let op_cnt_ty = count.ty(&self.body.local_decls, self.tcx);
                 if op_cnt_ty != self.tcx.types.usize {
-                    self.fail(location, format!("bad arg ({:?} != usize)", op_cnt_ty))
+                    self.fail(location, format!("bad arg ({op_cnt_ty:?} != usize)"))
                 }
             }
             StatementKind::SetDiscriminant { place, .. } => {
@@ -1125,8 +1122,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     self.fail(
                         location,
                         format!(
-                            "`SetDiscriminant` is only allowed on ADTs and generators, not {:?}",
-                            pty
+                            "`SetDiscriminant` is only allowed on ADTs and generators, not {pty:?}"
                         ),
                     );
                 }
@@ -1141,7 +1137,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                 // DropsLowered`. However, this causes ICEs with generation of drop shims, which
                 // seem to fail to set their `MirPhase` correctly.
                 if matches!(kind, RetagKind::Raw | RetagKind::TwoPhase) {
-                    self.fail(location, format!("explicit `{:?}` is forbidden", kind));
+                    self.fail(location, format!("explicit `{kind:?}` is forbidden"));
                 }
             }
             StatementKind::StorageLive(_)
@@ -1174,7 +1170,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     if Scalar::<()>::try_from_uint(value, size).is_none() {
                         self.fail(
                             location,
-                            format!("the value {:#x} is not a proper {:?}", value, switch_ty),
+                            format!("the value {value:#x} is not a proper {switch_ty:?}"),
                         )
                     }
                 }
@@ -1185,7 +1181,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     ty::FnPtr(..) | ty::FnDef(..) => {}
                     _ => self.fail(
                         location,
-                        format!("encountered non-callable type {} in `Call` terminator", func_ty),
+                        format!("encountered non-callable type {func_ty} in `Call` terminator"),
                     ),
                 }
             }
@@ -1195,8 +1191,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
                     self.fail(
                         location,
                         format!(
-                            "encountered non-boolean condition of type {} in `Assert` terminator",
-                            cond_ty
+                            "encountered non-boolean condition of type {cond_ty} in `Assert` terminator"
                         ),
                     );
                 }
diff --git a/compiler/rustc_const_eval/src/util/compare_types.rs b/compiler/rustc_const_eval/src/util/compare_types.rs
index 88d4f5e715c..83376c8e992 100644
--- a/compiler/rustc_const_eval/src/util/compare_types.rs
+++ b/compiler/rustc_const_eval/src/util/compare_types.rs
@@ -57,12 +57,15 @@ pub fn is_subtype<'tcx>(
     // we would get unification errors because we're unable to look into opaque types,
     // even if they're constrained in our current function.
     for (key, ty) in infcx.take_opaque_types() {
-        span_bug!(
-            ty.hidden_type.span,
-            "{}, {}",
-            tcx.type_of(key.def_id).instantiate(tcx, key.args),
-            ty.hidden_type.ty
-        );
+        let hidden_ty = tcx.type_of(key.def_id).instantiate(tcx, key.args);
+        if hidden_ty != ty.hidden_type.ty {
+            span_bug!(
+                ty.hidden_type.span,
+                "{}, {}",
+                tcx.type_of(key.def_id).instantiate(tcx, key.args),
+                ty.hidden_type.ty
+            );
+        }
     }
     errors.is_empty()
 }
diff --git a/compiler/rustc_data_structures/src/binary_search_util/mod.rs b/compiler/rustc_data_structures/src/binary_search_util/mod.rs
index d40172a2e2f..bc8a6b9eac0 100644
--- a/compiler/rustc_data_structures/src/binary_search_util/mod.rs
+++ b/compiler/rustc_data_structures/src/binary_search_util/mod.rs
@@ -10,41 +10,17 @@ pub fn binary_search_slice<'d, E, K>(data: &'d [E], key_fn: impl Fn(&E) -> K, ke
 where
     K: Ord,
 {
-    let Ok(mid) = data.binary_search_by_key(key, &key_fn) else {
+    let size = data.len();
+    let start = data.partition_point(|x| key_fn(x) < *key);
+    // At this point `start` either points at the first entry with equal or
+    // greater key or is equal to `size` in case all elements have smaller keys
+    if start == size || key_fn(&data[start]) != *key {
         return &[];
     };
-    let size = data.len();
-
-    // We get back *some* element with the given key -- so do
-    // a galloping search backwards to find the *first* one.
-    let mut start = mid;
-    let mut previous = mid;
-    let mut step = 1;
-    loop {
-        start = start.saturating_sub(step);
-        if start == 0 || key_fn(&data[start]) != *key {
-            break;
-        }
-        previous = start;
-        step *= 2;
-    }
-    step = previous - start;
-    while step > 1 {
-        let half = step / 2;
-        let mid = start + half;
-        if key_fn(&data[mid]) != *key {
-            start = mid;
-        }
-        step -= half;
-    }
-    // adjust by one if we have overshot
-    if start < size && key_fn(&data[start]) != *key {
-        start += 1;
-    }
 
     // Now search forward to find the *last* one.
-    let mut end = mid;
-    let mut previous = mid;
+    let mut end = start;
+    let mut previous = start;
     let mut step = 1;
     loop {
         end = end.saturating_add(step).min(size);
diff --git a/compiler/rustc_data_structures/src/sync/worker_local.rs b/compiler/rustc_data_structures/src/sync/worker_local.rs
index d61bb55be68..8c84daf4f16 100644
--- a/compiler/rustc_data_structures/src/sync/worker_local.rs
+++ b/compiler/rustc_data_structures/src/sync/worker_local.rs
@@ -116,7 +116,7 @@ pub struct WorkerLocal<T> {
 
 // This is safe because the `deref` call will return a reference to a `T` unique to each thread
 // or it will panic for threads without an associated local. So there isn't a need for `T` to do
-// it's own synchronization. The `verify` method on `RegistryId` has an issue where the the id
+// it's own synchronization. The `verify` method on `RegistryId` has an issue where the id
 // can be reused, but `WorkerLocal` has a reference to `Registry` which will prevent any reuse.
 #[cfg(parallel_compiler)]
 unsafe impl<T: Send> Sync for WorkerLocal<T> {}
diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs
index a49b842d9ff..77e2c900c0d 100644
--- a/compiler/rustc_error_messages/src/lib.rs
+++ b/compiler/rustc_error_messages/src/lib.rs
@@ -71,17 +71,17 @@ pub enum TranslationBundleError {
 impl fmt::Display for TranslationBundleError {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            TranslationBundleError::ReadFtl(e) => write!(f, "could not read ftl file: {}", e),
+            TranslationBundleError::ReadFtl(e) => write!(f, "could not read ftl file: {e}"),
             TranslationBundleError::ParseFtl(e) => {
-                write!(f, "could not parse ftl file: {}", e)
+                write!(f, "could not parse ftl file: {e}")
             }
-            TranslationBundleError::AddResource(e) => write!(f, "failed to add resource: {}", e),
+            TranslationBundleError::AddResource(e) => write!(f, "failed to add resource: {e}"),
             TranslationBundleError::MissingLocale => write!(f, "missing locale directory"),
             TranslationBundleError::ReadLocalesDir(e) => {
-                write!(f, "could not read locales dir: {}", e)
+                write!(f, "could not read locales dir: {e}")
             }
             TranslationBundleError::ReadLocalesDirEntry(e) => {
-                write!(f, "could not read locales dir entry: {}", e)
+                write!(f, "could not read locales dir entry: {e}")
             }
             TranslationBundleError::LocaleIsNotDir => {
                 write!(f, "`$sysroot/share/locales/$locale` is not a directory")
diff --git a/compiler/rustc_errors/messages.ftl b/compiler/rustc_errors/messages.ftl
index 8e8223c3cf8..d68dba0be5e 100644
--- a/compiler/rustc_errors/messages.ftl
+++ b/compiler/rustc_errors/messages.ftl
@@ -1,3 +1,25 @@
+errors_delayed_at_with_newline =
+    delayed at {$emitted_at}
+    {$note}
+
+errors_delayed_at_without_newline =
+    delayed at {$emitted_at} - {$note}
+
+errors_expected_lifetime_parameter =
+    expected lifetime {$count ->
+        [1] parameter
+        *[other] parameters
+    }
+
+errors_indicate_anonymous_lifetime =
+    indicate the anonymous {$count ->
+        [1] lifetime
+        *[other] lifetimes
+    }
+
+errors_invalid_flushed_delayed_diagnostic_level =
+    `flushed_delayed` got diagnostic with level {$level}, instead of the expected `DelayedBug`
+
 errors_target_inconsistent_architecture =
     inconsistent target specification: "data-layout" claims architecture is {$dl}-endian, while "target-endian" is `{$target}`
 
diff --git a/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs b/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs
index 9872b3bda1e..a88fba6dae6 100644
--- a/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs
+++ b/compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs
@@ -157,10 +157,8 @@ impl AnnotateSnippetEmitterWriter {
             {
                 annotated_files.swap(0, pos);
             }
-            // owned: line source, line index, annotations
-            type Owned = (String, usize, Vec<crate::snippet::Annotation>);
-            let filename = source_map.filename_for_diagnostics(&primary_lo.file.name);
-            let origin = filename.to_string_lossy();
+            // owned: file name, line source, line index, annotations
+            type Owned = (String, String, usize, Vec<crate::snippet::Annotation>);
             let annotated_files: Vec<Owned> = annotated_files
                 .into_iter()
                 .flat_map(|annotated_file| {
@@ -169,7 +167,15 @@ impl AnnotateSnippetEmitterWriter {
                         .lines
                         .into_iter()
                         .map(|line| {
-                            (source_string(file.clone(), &line), line.line_index, line.annotations)
+                            // Ensure the source file is present before we try
+                            // to load a string from it.
+                            source_map.ensure_source_file_source_present(file.clone());
+                            (
+                                format!("{}", source_map.filename_for_diagnostics(&file.name)),
+                                source_string(file.clone(), &line),
+                                line.line_index,
+                                line.annotations,
+                            )
                         })
                         .collect::<Vec<Owned>>()
                 })
@@ -192,11 +198,11 @@ impl AnnotateSnippetEmitterWriter {
                 },
                 slices: annotated_files
                     .iter()
-                    .map(|(source, line_index, annotations)| {
+                    .map(|(file_name, source, line_index, annotations)| {
                         Slice {
                             source,
                             line_start: *line_index,
-                            origin: Some(&origin),
+                            origin: Some(&file_name),
                             // FIXME(#59346): Not really sure when `fold` should be true or false
                             fold: false,
                             annotations: annotations
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs
index 132f2c015b8..a170e3a8943 100644
--- a/compiler/rustc_errors/src/diagnostic_impls.rs
+++ b/compiler/rustc_errors/src/diagnostic_impls.rs
@@ -1,3 +1,4 @@
+use crate::diagnostic::DiagnosticLocation;
 use crate::{fluent_generated as fluent, AddToDiagnostic};
 use crate::{DiagnosticArgValue, DiagnosticBuilder, Handler, IntoDiagnostic, IntoDiagnosticArg};
 use rustc_ast as ast;
@@ -10,6 +11,7 @@ use rustc_span::Span;
 use rustc_target::abi::TargetDataLayoutErrors;
 use rustc_target::spec::{PanicStrategy, SplitDebuginfo, StackProtector, TargetTriple};
 use rustc_type_ir as type_ir;
+use std::backtrace::Backtrace;
 use std::borrow::Cow;
 use std::fmt;
 use std::num::ParseIntError;
@@ -317,3 +319,62 @@ pub enum LabelKind {
     Label,
     Help,
 }
+
+#[derive(Subdiagnostic)]
+#[label(errors_expected_lifetime_parameter)]
+pub struct ExpectedLifetimeParameter {
+    #[primary_span]
+    pub span: Span,
+    pub count: usize,
+}
+
+#[derive(Subdiagnostic)]
+#[note(errors_delayed_at_with_newline)]
+pub struct DelayedAtWithNewline {
+    #[primary_span]
+    pub span: Span,
+    pub emitted_at: DiagnosticLocation,
+    pub note: Backtrace,
+}
+#[derive(Subdiagnostic)]
+#[note(errors_delayed_at_without_newline)]
+pub struct DelayedAtWithoutNewline {
+    #[primary_span]
+    pub span: Span,
+    pub emitted_at: DiagnosticLocation,
+    pub note: Backtrace,
+}
+
+impl IntoDiagnosticArg for DiagnosticLocation {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+        DiagnosticArgValue::Str(Cow::from(self.to_string()))
+    }
+}
+
+impl IntoDiagnosticArg for Backtrace {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+        DiagnosticArgValue::Str(Cow::from(self.to_string()))
+    }
+}
+
+#[derive(Subdiagnostic)]
+#[note(errors_invalid_flushed_delayed_diagnostic_level)]
+pub struct InvalidFlushedDelayedDiagnosticLevel {
+    #[primary_span]
+    pub span: Span,
+    pub level: rustc_errors::Level,
+}
+impl IntoDiagnosticArg for rustc_errors::Level {
+    fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
+        DiagnosticArgValue::Str(Cow::from(self.to_string()))
+    }
+}
+
+#[derive(Subdiagnostic)]
+#[suggestion(errors_indicate_anonymous_lifetime, code = "{suggestion}", style = "verbose")]
+pub struct IndicateAnonymousLifetime {
+    #[primary_span]
+    pub span: Span,
+    pub count: usize,
+    pub suggestion: String,
+}
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 961feba3250..44654571d43 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2145,7 +2145,7 @@ impl EmitterWriter {
                         &mut self.dst,
                         self.short_message,
                     ) {
-                        panic!("failed to emit error: {}", e)
+                        panic!("failed to emit error: {e}")
                     }
                 }
                 if !self.short_message {
@@ -2161,7 +2161,7 @@ impl EmitterWriter {
                             true,
                             None,
                         ) {
-                            panic!("failed to emit error: {}", err);
+                            panic!("failed to emit error: {err}");
                         }
                     }
                     for sugg in suggestions {
@@ -2180,7 +2180,7 @@ impl EmitterWriter {
                                     true,
                                     None,
                                 ) {
-                                    panic!("failed to emit error: {}", e);
+                                    panic!("failed to emit error: {e}");
                                 }
                             }
                             SuggestionStyle::HideCodeInline
@@ -2193,22 +2193,22 @@ impl EmitterWriter {
                                     &Level::Help,
                                     max_line_num_len,
                                 ) {
-                                    panic!("failed to emit error: {}", e);
+                                    panic!("failed to emit error: {e}");
                                 }
                             }
                         }
                     }
                 }
             }
-            Err(e) => panic!("failed to emit error: {}", e),
+            Err(e) => panic!("failed to emit error: {e}"),
         }
 
         let mut dst = self.dst.writable();
         match writeln!(dst) {
-            Err(e) => panic!("failed to emit error: {}", e),
+            Err(e) => panic!("failed to emit error: {e}"),
             _ => {
                 if let Err(e) = dst.flush() {
-                    panic!("failed to emit error: {}", e)
+                    panic!("failed to emit error: {e}")
                 }
             }
         }
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs
index f32d6b96b9b..55f7c485024 100644
--- a/compiler/rustc_errors/src/json.rs
+++ b/compiler/rustc_errors/src/json.rs
@@ -159,7 +159,7 @@ impl Emitter for JsonEmitter {
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
-            panic!("failed to print diagnostics: {:?}", e);
+            panic!("failed to print diagnostics: {e:?}");
         }
     }
 
@@ -172,7 +172,7 @@ impl Emitter for JsonEmitter {
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
-            panic!("failed to print notification: {:?}", e);
+            panic!("failed to print notification: {e:?}");
         }
     }
 
@@ -194,7 +194,7 @@ impl Emitter for JsonEmitter {
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
-            panic!("failed to print future breakage report: {:?}", e);
+            panic!("failed to print future breakage report: {e:?}");
         }
     }
 
@@ -208,7 +208,7 @@ impl Emitter for JsonEmitter {
         }
         .and_then(|_| self.dst.flush());
         if let Err(e) = result {
-            panic!("failed to print unused externs: {:?}", e);
+            panic!("failed to print unused externs: {e:?}");
         }
     }
 
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index d18e01d178e..3d1639db4af 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -22,6 +22,8 @@ extern crate rustc_macros;
 #[macro_use]
 extern crate tracing;
 
+extern crate self as rustc_errors;
+
 pub use emitter::ColorConfig;
 
 use rustc_lint_defs::LintExpectationId;
@@ -377,13 +379,16 @@ pub struct ExplicitBug;
 /// rather than a failed assertion, etc.
 pub struct DelayedBugPanic;
 
+use crate::diagnostic_impls::{DelayedAtWithNewline, DelayedAtWithoutNewline};
 pub use diagnostic::{
     AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgValue, DiagnosticId,
     DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
 };
 pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee, Noted};
 pub use diagnostic_impls::{
-    DiagnosticArgFromDisplay, DiagnosticSymbolList, LabelKind, SingleLabelManySpans,
+    DiagnosticArgFromDisplay, DiagnosticSymbolList, ExpectedLifetimeParameter,
+    IndicateAnonymousLifetime, InvalidFlushedDelayedDiagnosticLevel, LabelKind,
+    SingleLabelManySpans,
 };
 use std::backtrace::{Backtrace, BacktraceStatus};
 
@@ -1650,11 +1655,11 @@ impl HandlerInner {
         let backtrace = std::env::var_os("RUST_BACKTRACE").map_or(true, |x| &x != "0");
         for bug in bugs {
             if let Some(file) = self.ice_file.as_ref()
-                && let Ok(mut out) = std::fs::File::options().append(true).open(file)
+                && let Ok(mut out) = std::fs::File::options().create(true).append(true).open(file)
             {
                 let _ = write!(
                     &mut out,
-                    "\n\ndelayed span bug: {}\n{}",
+                    "delayed span bug: {}\n{}\n",
                     bug.inner.styled_message().iter().filter_map(|(msg, _)| msg.as_str()).collect::<String>(),
                     &bug.note
                 );
@@ -1673,11 +1678,10 @@ impl HandlerInner {
             if bug.level != Level::DelayedBug {
                 // NOTE(eddyb) not panicking here because we're already producing
                 // an ICE, and the more information the merrier.
-                bug.note(format!(
-                    "`flushed_delayed` got diagnostic with level {:?}, \
-                     instead of the expected `DelayedBug`",
-                    bug.level,
-                ));
+                bug.subdiagnostic(InvalidFlushedDelayedDiagnosticLevel {
+                    span: bug.span.primary_span().unwrap(),
+                    level: bug.level,
+                });
             }
             bug.level = Level::Bug;
 
@@ -1716,13 +1720,11 @@ impl HandlerInner {
                 (count, delayed_count, as_bug) => {
                     if delayed_count > 0 {
                         panic!(
-                            "aborting after {} errors and {} delayed bugs due to `-Z treat-err-as-bug={}`",
-                            count, delayed_count, as_bug,
+                            "aborting after {count} errors and {delayed_count} delayed bugs due to `-Z treat-err-as-bug={as_bug}`",
                         )
                     } else {
                         panic!(
-                            "aborting after {} errors due to `-Z treat-err-as-bug={}`",
-                            count, as_bug,
+                            "aborting after {count} errors due to `-Z treat-err-as-bug={as_bug}`",
                         )
                     }
                 }
@@ -1744,12 +1746,22 @@ impl DelayedDiagnostic {
     fn decorate(mut self) -> Diagnostic {
         match self.note.status() {
             BacktraceStatus::Captured => {
-                self.inner.note(format!("delayed at {}\n{}", self.inner.emitted_at, self.note));
+                let inner = &self.inner;
+                self.inner.subdiagnostic(DelayedAtWithNewline {
+                    span: inner.span.primary_span().unwrap(),
+                    emitted_at: inner.emitted_at.clone(),
+                    note: self.note,
+                });
             }
             // Avoid the needless newline when no backtrace has been captured,
             // the display impl should just be a single line.
             _ => {
-                self.inner.note(format!("delayed at {} - {}", self.inner.emitted_at, self.note));
+                let inner = &self.inner;
+                self.inner.subdiagnostic(DelayedAtWithoutNewline {
+                    span: inner.span.primary_span().unwrap(),
+                    emitted_at: inner.emitted_at.clone(),
+                    note: self.note,
+                });
             }
         }
 
@@ -1841,20 +1853,36 @@ pub fn add_elided_lifetime_in_path_suggestion(
     incl_angl_brckt: bool,
     insertion_span: Span,
 ) {
-    diag.span_label(path_span, format!("expected lifetime parameter{}", pluralize!(n)));
+    diag.subdiagnostic(ExpectedLifetimeParameter { span: path_span, count: n });
     if !source_map.is_span_accessible(insertion_span) {
         // Do not try to suggest anything if generated by a proc-macro.
         return;
     }
     let anon_lts = vec!["'_"; n].join(", ");
     let suggestion =
-        if incl_angl_brckt { format!("<{}>", anon_lts) } else { format!("{}, ", anon_lts) };
-    diag.span_suggestion_verbose(
-        insertion_span.shrink_to_hi(),
-        format!("indicate the anonymous lifetime{}", pluralize!(n)),
+        if incl_angl_brckt { format!("<{anon_lts}>") } else { format!("{anon_lts}, ") };
+
+    diag.subdiagnostic(IndicateAnonymousLifetime {
+        span: insertion_span.shrink_to_hi(),
+        count: n,
         suggestion,
-        Applicability::MachineApplicable,
-    );
+    });
+}
+
+pub fn report_ambiguity_error<'a, G: EmissionGuarantee>(
+    db: &mut DiagnosticBuilder<'a, G>,
+    ambiguity: rustc_lint_defs::AmbiguityErrorDiag,
+) {
+    db.span_label(ambiguity.label_span, ambiguity.label_msg);
+    db.note(ambiguity.note_msg);
+    db.span_note(ambiguity.b1_span, ambiguity.b1_note_msg);
+    for help_msg in ambiguity.b1_help_msgs {
+        db.help(help_msg);
+    }
+    db.span_note(ambiguity.b2_span, ambiguity.b2_note_msg);
+    for help_msg in ambiguity.b2_help_msgs {
+        db.help(help_msg);
+    }
 }
 
 #[derive(Clone, Copy, PartialEq, Hash, Debug)]
diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_errors/src/markdown/tests/term.rs
index 3b31c6d6295..6f68fb25a58 100644
--- a/compiler/rustc_errors/src/markdown/tests/term.rs
+++ b/compiler/rustc_errors/src/markdown/tests/term.rs
@@ -63,7 +63,7 @@ fn test_wrapping_write() {
 #[test]
 fn test_output() {
     // Capture `--bless` when run via ./x
-    let bless = std::env::var("RUSTC_BLESS").unwrap_or_default() == "1";
+    let bless = std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
     let ast = MdStream::parse_str(INPUT);
     let bufwtr = BufferWriter::stderr(ColorChoice::Always);
     let mut buffer = bufwtr.buffer();
diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs
index 264f30fb10a..7de46994434 100644
--- a/compiler/rustc_expand/src/build.rs
+++ b/compiler/rustc_expand/src/build.rs
@@ -643,7 +643,16 @@ impl<'a> ExtCtxt<'a> {
             span,
             name,
             AttrVec::new(),
-            ast::ItemKind::Const(ast::ConstItem { defaultness, ty, expr: Some(expr) }.into()),
+            ast::ItemKind::Const(
+                ast::ConstItem {
+                    defaultness,
+                    // FIXME(generic_const_items): Pass the generics as a parameter.
+                    generics: ast::Generics::default(),
+                    ty,
+                    expr: Some(expr),
+                }
+                .into(),
+            ),
         )
     }
 
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs
index 4ec5ac22e90..8658cea137a 100644
--- a/compiler/rustc_expand/src/config.rs
+++ b/compiler/rustc_expand/src/config.rs
@@ -365,11 +365,11 @@ impl<'a> StripUnconfigured<'a> {
 
         // Use the `#` in `#[cfg_attr(pred, attr)]` as the `#` token
         // for `attr` when we expand it to `#[attr]`
-        let mut orig_trees = orig_tokens.into_trees();
+        let mut orig_trees = orig_tokens.trees();
         let TokenTree::Token(pound_token @ Token { kind: TokenKind::Pound, .. }, _) =
-            orig_trees.next().unwrap()
+            orig_trees.next().unwrap().clone()
         else {
-            panic!("Bad tokens for attribute {:?}", attr);
+            panic!("Bad tokens for attribute {attr:?}");
         };
         let pound_span = pound_token.span;
 
@@ -377,9 +377,9 @@ impl<'a> StripUnconfigured<'a> {
         if attr.style == AttrStyle::Inner {
             // For inner attributes, we do the same thing for the `!` in `#![some_attr]`
             let TokenTree::Token(bang_token @ Token { kind: TokenKind::Not, .. }, _) =
-                orig_trees.next().unwrap()
+                orig_trees.next().unwrap().clone()
             else {
-                panic!("Bad tokens for attribute {:?}", attr);
+                panic!("Bad tokens for attribute {attr:?}");
             };
             trees.push(AttrTokenTree::Token(bang_token, Spacing::Alone));
         }
@@ -390,7 +390,7 @@ impl<'a> StripUnconfigured<'a> {
             Delimiter::Bracket,
             item.tokens
                 .as_ref()
-                .unwrap_or_else(|| panic!("Missing tokens for {:?}", item))
+                .unwrap_or_else(|| panic!("Missing tokens for {item:?}"))
                 .to_attr_token_stream(),
         );
         trees.push(bracket_group);
diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
index 3b6db9fd39c..165c6d47c8a 100644
--- a/compiler/rustc_expand/src/expand.rs
+++ b/compiler/rustc_expand/src/expand.rs
@@ -803,7 +803,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
             &self.cx.sess.parse_sess,
             sym::proc_macro_hygiene,
             span,
-            format!("custom attributes cannot be applied to {}", kind),
+            format!("custom attributes cannot be applied to {kind}"),
         )
         .emit();
     }
@@ -1707,7 +1707,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
                         &UNUSED_ATTRIBUTES,
                         attr.span,
                         self.cx.current_expansion.lint_node_id,
-                        format!("unused attribute `{}`", attr_name),
+                        format!("unused attribute `{attr_name}`"),
                         BuiltinLintDiagnostics::UnusedBuiltinAttribute {
                             attr_name,
                             macro_name: pprust::path_to_string(&call.path),
diff --git a/compiler/rustc_expand/src/mbe/diagnostics.rs b/compiler/rustc_expand/src/mbe/diagnostics.rs
index 03de33dc854..e060375646c 100644
--- a/compiler/rustc_expand/src/mbe/diagnostics.rs
+++ b/compiler/rustc_expand/src/mbe/diagnostics.rs
@@ -257,7 +257,7 @@ pub(super) fn emit_frag_parse_err(
                         e.span_suggestion_verbose(
                             site_span,
                             "surround the macro invocation with `{}` to interpret the expansion as a statement",
-                            format!("{{ {}; }}", snippet),
+                            format!("{{ {snippet}; }}"),
                             Applicability::MaybeIncorrect,
                         );
                     }
diff --git a/compiler/rustc_expand/src/mbe/macro_check.rs b/compiler/rustc_expand/src/mbe/macro_check.rs
index 34f998274e9..95f5bb2d2e2 100644
--- a/compiler/rustc_expand/src/mbe/macro_check.rs
+++ b/compiler/rustc_expand/src/mbe/macro_check.rs
@@ -593,7 +593,7 @@ fn check_ops_is_prefix(
             return;
         }
     }
-    buffer_lint(sess, span.into(), node_id, format!("unknown macro variable `{}`", name));
+    buffer_lint(sess, span.into(), node_id, format!("unknown macro variable `{name}`"));
 }
 
 /// Returns whether `binder_ops` is a prefix of `occurrence_ops`.
@@ -626,7 +626,7 @@ fn ops_is_prefix(
         if i >= occurrence_ops.len() {
             let mut span = MultiSpan::from_span(span);
             span.push_span_label(binder.span, "expected repetition");
-            let message = format!("variable '{}' is still repeating at this depth", name);
+            let message = format!("variable '{name}' is still repeating at this depth");
             buffer_lint(sess, span, node_id, message);
             return;
         }
diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs
index f0e67cfd50e..05c0cd952b8 100644
--- a/compiler/rustc_expand/src/mbe/macro_parser.rs
+++ b/compiler/rustc_expand/src/mbe/macro_parser.rs
@@ -156,7 +156,7 @@ impl Display for MatcherLoc {
             MatcherLoc::MetaVarDecl { bind, kind, .. } => {
                 write!(f, "meta-variable `${bind}")?;
                 if let Some(kind) = kind {
-                    write!(f, ":{}", kind)?;
+                    write!(f, ":{kind}")?;
                 }
                 write!(f, "`")?;
                 Ok(())
@@ -723,7 +723,7 @@ impl TtParser {
             .iter()
             .map(|mp| match &matcher[mp.idx] {
                 MatcherLoc::MetaVarDecl { bind, kind: Some(kind), .. } => {
-                    format!("{} ('{}')", kind, bind)
+                    format!("{kind} ('{bind}')")
                 }
                 _ => unreachable!(),
             })
@@ -736,8 +736,8 @@ impl TtParser {
                 "local ambiguity when calling macro `{}`: multiple parsing options: {}",
                 self.macro_name,
                 match self.next_mps.len() {
-                    0 => format!("built-in NTs {}.", nts),
-                    n => format!("built-in NTs {} or {n} other option{s}.", nts, s = pluralize!(n)),
+                    0 => format!("built-in NTs {nts}."),
+                    n => format!("built-in NTs {nts} or {n} other option{s}.", s = pluralize!(n)),
                 }
             ),
         )
@@ -757,7 +757,7 @@ impl TtParser {
                     match ret_val.entry(MacroRulesNormalizedIdent::new(bind)) {
                         Vacant(spot) => spot.insert(res.next().unwrap()),
                         Occupied(..) => {
-                            return Error(span, format!("duplicated bind name: {}", bind));
+                            return Error(span, format!("duplicated bind name: {bind}"));
                         }
                     };
                 } else {
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs
index 102bae2a744..1aa0b1fc053 100644
--- a/compiler/rustc_expand/src/mbe/macro_rules.rs
+++ b/compiler/rustc_expand/src/mbe/macro_rules.rs
@@ -500,7 +500,7 @@ pub fn compile_declarative_macro(
             .map(|m| {
                 if let MatchedTokenTree(tt) = m {
                     let tt = mbe::quoted::parse(
-                        TokenStream::new(vec![tt.clone()]),
+                        &TokenStream::new(vec![tt.clone()]),
                         true,
                         &sess.parse_sess,
                         def.id,
@@ -524,7 +524,7 @@ pub fn compile_declarative_macro(
             .map(|m| {
                 if let MatchedTokenTree(tt) = m {
                     return mbe::quoted::parse(
-                        TokenStream::new(vec![tt.clone()]),
+                        &TokenStream::new(vec![tt.clone()]),
                         false,
                         &sess.parse_sess,
                         def.id,
@@ -554,7 +554,7 @@ pub fn compile_declarative_macro(
     let (transparency, transparency_error) = attr::find_transparency(&def.attrs, macro_rules);
     match transparency_error {
         Some(TransparencyError::UnknownTransparency(value, span)) => {
-            diag.span_err(span, format!("unknown macro transparency: `{}`", value));
+            diag.span_err(span, format!("unknown macro transparency: `{value}`"));
         }
         Some(TransparencyError::MultipleTransparencyAttrs(old_span, new_span)) => {
             diag.span_err(vec![old_span, new_span], "multiple macro transparency attributes");
@@ -1197,7 +1197,7 @@ fn check_matcher_core<'tt>(
                                     may_be = may_be
                                 ),
                             );
-                            err.span_label(sp, format!("not allowed after `{}` fragments", kind));
+                            err.span_label(sp, format!("not allowed after `{kind}` fragments"));
 
                             if kind == NonterminalKind::PatWithOr
                                 && sess.edition.at_least_rust_2021()
@@ -1221,8 +1221,7 @@ fn check_matcher_core<'tt>(
                                 &[] => {}
                                 &[t] => {
                                     err.note(format!(
-                                        "only {} is allowed after `{}` fragments",
-                                        t, kind,
+                                        "only {t} is allowed after `{kind}` fragments",
                                     ));
                                 }
                                 ts => {
@@ -1407,9 +1406,9 @@ fn is_in_follow(tok: &mbe::TokenTree, kind: NonterminalKind) -> IsInFollow {
 fn quoted_tt_to_string(tt: &mbe::TokenTree) -> String {
     match tt {
         mbe::TokenTree::Token(token) => pprust::token_to_string(&token).into(),
-        mbe::TokenTree::MetaVar(_, name) => format!("${}", name),
-        mbe::TokenTree::MetaVarDecl(_, name, Some(kind)) => format!("${}:{}", name, kind),
-        mbe::TokenTree::MetaVarDecl(_, name, None) => format!("${}:", name),
+        mbe::TokenTree::MetaVar(_, name) => format!("${name}"),
+        mbe::TokenTree::MetaVarDecl(_, name, Some(kind)) => format!("${name}:{kind}"),
+        mbe::TokenTree::MetaVarDecl(_, name, None) => format!("${name}:"),
         _ => panic!(
             "{}",
             "unexpected mbe::TokenTree::{Sequence or Delimited} \
diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs
index 40bfa3715be..6546199f5e6 100644
--- a/compiler/rustc_expand/src/mbe/quoted.rs
+++ b/compiler/rustc_expand/src/mbe/quoted.rs
@@ -36,7 +36,7 @@ const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \
 ///
 /// A collection of `self::TokenTree`. There may also be some errors emitted to `sess`.
 pub(super) fn parse(
-    input: tokenstream::TokenStream,
+    input: &tokenstream::TokenStream,
     parsing_patterns: bool,
     sess: &ParseSess,
     node_id: NodeId,
@@ -48,7 +48,7 @@ pub(super) fn parse(
 
     // For each token tree in `input`, parse the token into a `self::TokenTree`, consuming
     // additional trees if need be.
-    let mut trees = input.into_trees();
+    let mut trees = input.trees();
     while let Some(tree) = trees.next() {
         // Given the parsed tree, if there is a metavar and we are expecting matchers, actually
         // parse out the matcher (i.e., in `$id:ident` this would parse the `:` and `ident`).
@@ -56,7 +56,7 @@ pub(super) fn parse(
         match tree {
             TokenTree::MetaVar(start_sp, ident) if parsing_patterns => {
                 let span = match trees.next() {
-                    Some(tokenstream::TokenTree::Token(Token { kind: token::Colon, span }, _)) => {
+                    Some(&tokenstream::TokenTree::Token(Token { kind: token::Colon, span }, _)) => {
                         match trees.next() {
                             Some(tokenstream::TokenTree::Token(token, _)) => match token.ident() {
                                 Some((frag, _)) => {
@@ -96,10 +96,10 @@ pub(super) fn parse(
                                 }
                                 _ => token.span,
                             },
-                            tree => tree.as_ref().map_or(span, tokenstream::TokenTree::span),
+                            tree => tree.map_or(span, tokenstream::TokenTree::span),
                         }
                     }
-                    tree => tree.as_ref().map_or(start_sp, tokenstream::TokenTree::span),
+                    tree => tree.map_or(start_sp, tokenstream::TokenTree::span),
                 };
 
                 result.push(TokenTree::MetaVarDecl(span, ident, None));
@@ -134,9 +134,9 @@ fn maybe_emit_macro_metavar_expr_feature(features: &Features, sess: &ParseSess,
 /// - `parsing_patterns`: same as [parse].
 /// - `sess`: the parsing session. Any errors will be emitted to this session.
 /// - `features`: language features so we can do feature gating.
-fn parse_tree(
-    tree: tokenstream::TokenTree,
-    outer_trees: &mut impl Iterator<Item = tokenstream::TokenTree>,
+fn parse_tree<'a>(
+    tree: &'a tokenstream::TokenTree,
+    outer_trees: &mut impl Iterator<Item = &'a tokenstream::TokenTree>,
     parsing_patterns: bool,
     sess: &ParseSess,
     node_id: NodeId,
@@ -146,13 +146,13 @@ fn parse_tree(
     // Depending on what `tree` is, we could be parsing different parts of a macro
     match tree {
         // `tree` is a `$` token. Look at the next token in `trees`
-        tokenstream::TokenTree::Token(Token { kind: token::Dollar, span }, _) => {
+        &tokenstream::TokenTree::Token(Token { kind: token::Dollar, span }, _) => {
             // FIXME: Handle `Invisible`-delimited groups in a more systematic way
             // during parsing.
             let mut next = outer_trees.next();
-            let mut trees: Box<dyn Iterator<Item = tokenstream::TokenTree>>;
+            let mut trees: Box<dyn Iterator<Item = &tokenstream::TokenTree>>;
             if let Some(tokenstream::TokenTree::Delimited(_, Delimiter::Invisible, tts)) = next {
-                trees = Box::new(tts.into_trees());
+                trees = Box::new(tts.trees());
                 next = trees.next();
             } else {
                 trees = Box::new(outer_trees);
@@ -160,7 +160,7 @@ fn parse_tree(
 
             match next {
                 // `tree` is followed by a delimited set of token trees.
-                Some(tokenstream::TokenTree::Delimited(delim_span, delim, tts)) => {
+                Some(&tokenstream::TokenTree::Delimited(delim_span, delim, ref tts)) => {
                     if parsing_patterns {
                         if delim != Delimiter::Parenthesis {
                             span_dollar_dollar_or_metavar_in_the_lhs_err(
@@ -194,7 +194,7 @@ fn parse_tree(
                             Delimiter::Parenthesis => {}
                             _ => {
                                 let tok = pprust::token_kind_to_string(&token::OpenDelim(delim));
-                                let msg = format!("expected `(` or `{{`, found `{}`", tok);
+                                let msg = format!("expected `(` or `{{`, found `{tok}`");
                                 sess.span_diagnostic.span_err(delim_span.entire(), msg);
                             }
                         }
@@ -228,7 +228,7 @@ fn parse_tree(
                 }
 
                 // `tree` is followed by another `$`. This is an escaped `$`.
-                Some(tokenstream::TokenTree::Token(Token { kind: token::Dollar, span }, _)) => {
+                Some(&tokenstream::TokenTree::Token(Token { kind: token::Dollar, span }, _)) => {
                     if parsing_patterns {
                         span_dollar_dollar_or_metavar_in_the_lhs_err(
                             sess,
@@ -256,11 +256,11 @@ fn parse_tree(
         }
 
         // `tree` is an arbitrary token. Keep it.
-        tokenstream::TokenTree::Token(token, _) => TokenTree::Token(token),
+        tokenstream::TokenTree::Token(token, _) => TokenTree::Token(token.clone()),
 
         // `tree` is the beginning of a delimited set of tokens (e.g., `(` or `{`). We need to
         // descend into the delimited set and further parse it.
-        tokenstream::TokenTree::Delimited(span, delim, tts) => TokenTree::Delimited(
+        &tokenstream::TokenTree::Delimited(span, delim, ref tts) => TokenTree::Delimited(
             span,
             Delimited {
                 delim,
@@ -286,16 +286,16 @@ fn kleene_op(token: &Token) -> Option<KleeneOp> {
 /// - Ok(Ok((op, span))) if the next token tree is a KleeneOp
 /// - Ok(Err(tok, span)) if the next token tree is a token but not a KleeneOp
 /// - Err(span) if the next token tree is not a token
-fn parse_kleene_op(
-    input: &mut impl Iterator<Item = tokenstream::TokenTree>,
+fn parse_kleene_op<'a>(
+    input: &mut impl Iterator<Item = &'a tokenstream::TokenTree>,
     span: Span,
 ) -> Result<Result<(KleeneOp, Span), Token>, Span> {
     match input.next() {
         Some(tokenstream::TokenTree::Token(token, _)) => match kleene_op(&token) {
             Some(op) => Ok(Ok((op, token.span))),
-            None => Ok(Err(token)),
+            None => Ok(Err(token.clone())),
         },
-        tree => Err(tree.as_ref().map_or(span, tokenstream::TokenTree::span)),
+        tree => Err(tree.map_or(span, tokenstream::TokenTree::span)),
     }
 }
 
@@ -311,8 +311,8 @@ fn parse_kleene_op(
 /// session `sess`. If the next one (or possibly two) tokens in `input` correspond to a Kleene
 /// operator and separator, then a tuple with `(separator, KleeneOp)` is returned. Otherwise, an
 /// error with the appropriate span is emitted to `sess` and a dummy value is returned.
-fn parse_sep_and_kleene_op(
-    input: &mut impl Iterator<Item = tokenstream::TokenTree>,
+fn parse_sep_and_kleene_op<'a>(
+    input: &mut impl Iterator<Item = &'a tokenstream::TokenTree>,
     span: Span,
     sess: &ParseSess,
 ) -> (Option<Token>, KleeneToken) {
diff --git a/compiler/rustc_expand/src/parse/tests.rs b/compiler/rustc_expand/src/parse/tests.rs
index e133501c5d0..bdc20882a9d 100644
--- a/compiler/rustc_expand/src/parse/tests.rs
+++ b/compiler/rustc_expand/src/parse/tests.rs
@@ -69,9 +69,8 @@ fn bad_path_expr_1() {
 #[test]
 fn string_to_tts_macro() {
     create_default_session_globals_then(|| {
-        let tts: Vec<_> =
-            string_to_stream("macro_rules! zip (($a)=>($a))".to_string()).into_trees().collect();
-        let tts: &[TokenTree] = &tts[..];
+        let stream = string_to_stream("macro_rules! zip (($a)=>($a))".to_string());
+        let tts = &stream.trees().collect::<Vec<_>>()[..];
 
         match tts {
             [
@@ -300,9 +299,7 @@ fn ttdelim_span() {
         .unwrap();
 
         let ast::ExprKind::MacCall(mac) = &expr.kind else { panic!("not a macro") };
-        let tts: Vec<_> = mac.args.tokens.clone().into_trees().collect();
-
-        let span = tts.iter().rev().next().unwrap().span();
+        let span = mac.args.tokens.trees().last().unwrap().span();
 
         match sess.source_map().span_to_snippet(span) {
             Ok(s) => assert_eq!(&s[..], "{ body }"),
diff --git a/compiler/rustc_expand/src/proc_macro.rs b/compiler/rustc_expand/src/proc_macro.rs
index 41b24407fa0..c617cd76e3c 100644
--- a/compiler/rustc_expand/src/proc_macro.rs
+++ b/compiler/rustc_expand/src/proc_macro.rs
@@ -95,7 +95,7 @@ impl base::AttrProcMacro for AttrProcMacro {
             |e| {
                 let mut err = ecx.struct_span_err(span, "custom attribute panicked");
                 if let Some(s) = e.as_str() {
-                    err.help(format!("message: {}", s));
+                    err.help(format!("message: {s}"));
                 }
                 err.emit()
             },
@@ -148,7 +148,7 @@ impl MultiItemModifier for DeriveProcMacro {
                 Err(e) => {
                     let mut err = ecx.struct_span_err(span, "proc-macro derive panicked");
                     if let Some(s) = e.as_str() {
-                        err.help(format!("message: {}", s));
+                        err.help(format!("message: {s}"));
                     }
                     err.emit();
                     return ExpandResult::Ready(vec![]);
diff --git a/compiler/rustc_expand/src/proc_macro_server.rs b/compiler/rustc_expand/src/proc_macro_server.rs
index ecd2315112a..2dc9b51a37e 100644
--- a/compiler/rustc_expand/src/proc_macro_server.rs
+++ b/compiler/rustc_expand/src/proc_macro_server.rs
@@ -94,10 +94,10 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre
         // Estimate the capacity as `stream.len()` rounded up to the next power
         // of two to limit the number of required reallocations.
         let mut trees = Vec::with_capacity(stream.len().next_power_of_two());
-        let mut cursor = stream.into_trees();
+        let mut cursor = stream.trees();
 
         while let Some(tree) = cursor.next() {
-            let (Token { kind, span }, joint) = match tree {
+            let (Token { kind, span }, joint) = match tree.clone() {
                 tokenstream::TokenTree::Delimited(span, delim, tts) => {
                     let delimiter = pm::Delimiter::from_internal(delim);
                     trees.push(TokenTree::Group(Group {
@@ -622,7 +622,7 @@ impl server::SourceFile for Rustc<'_, '_> {
 impl server::Span for Rustc<'_, '_> {
     fn debug(&mut self, span: Self::Span) -> String {
         if self.ecx.ecfg.span_debug {
-            format!("{:?}", span)
+            format!("{span:?}")
         } else {
             format!("{:?} bytes({}..{})", span.ctxt(), span.lo().0, span.hi().0)
         }
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index 56a2c5eff3d..bbc3d291e20 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -379,6 +379,8 @@ declare_features! (
     (active, deprecated_safe, "1.61.0", Some(94978), None),
     /// Allows having using `suggestion` in the `#[deprecated]` attribute.
     (active, deprecated_suggestion, "1.61.0", Some(94785), None),
+    /// Allows using the `#[diagnostic]` attribute tool namespace
+    (active, diagnostic_namespace, "CURRENT_RUSTC_VERSION", Some(94785), None),
     /// Controls errors in trait implementations.
     (active, do_not_recommend, "1.67.0", Some(51992), None),
     /// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.
@@ -422,6 +424,8 @@ declare_features! (
     (incomplete, generic_associated_types_extended, "1.61.0", Some(95451), None),
     /// Allows non-trivial generic constants which have to have wfness manually propagated to callers
     (incomplete, generic_const_exprs, "1.56.0", Some(76560), None),
+    /// Allows generic parameters and where-clauses on free & associated const items.
+    (incomplete, generic_const_items, "CURRENT_RUSTC_VERSION", Some(113521), None),
     /// Allows using `..=X` as a patterns in slices.
     (active, half_open_range_patterns_in_slices, "1.66.0", Some(67264), None),
     /// Allows `if let` guard in match arms.
@@ -445,7 +449,7 @@ declare_features! (
     // Allows setting the threshold for the `large_assignments` lint.
     (active, large_assignments, "1.52.0", Some(83518), None),
     /// Allow to have type alias types for inter-crate use.
-    (active, lazy_type_alias, "1.72.0", Some(112792), None),
+    (incomplete, lazy_type_alias, "1.72.0", Some(112792), None),
     /// Allows `if/while p && let q = r && ...` chains.
     (active, let_chains, "1.37.0", Some(53667), None),
     /// Allows using `reason` in lint attributes and the `#[expect(lint)]` lint check.
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 3663c450ba6..6b76e16825f 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -3130,9 +3130,9 @@ impl<'hir> Item<'hir> {
     }
     /// Expect an [`ItemKind::Const`] or panic.
     #[track_caller]
-    pub fn expect_const(&self) -> (&'hir Ty<'hir>, BodyId) {
-        let ItemKind::Const(ty, body) = self.kind else { self.expect_failed("a constant") };
-        (ty, body)
+    pub fn expect_const(&self) -> (&'hir Ty<'hir>, &'hir Generics<'hir>, BodyId) {
+        let ItemKind::Const(ty, gen, body) = self.kind else { self.expect_failed("a constant") };
+        (ty, gen, body)
     }
     /// Expect an [`ItemKind::Fn`] or panic.
     #[track_caller]
@@ -3319,7 +3319,7 @@ pub enum ItemKind<'hir> {
     /// A `static` item.
     Static(&'hir Ty<'hir>, Mutability, BodyId),
     /// A `const` item.
-    Const(&'hir Ty<'hir>, BodyId),
+    Const(&'hir Ty<'hir>, &'hir Generics<'hir>, BodyId),
     /// A function declaration.
     Fn(FnSig<'hir>, &'hir Generics<'hir>, BodyId),
     /// A MBE macro definition (`macro_rules!` or `macro`).
@@ -3372,6 +3372,7 @@ impl ItemKind<'_> {
         Some(match *self {
             ItemKind::Fn(_, ref generics, _)
             | ItemKind::TyAlias(_, ref generics)
+            | ItemKind::Const(_, ref generics, _)
             | ItemKind::OpaqueTy(OpaqueTy { ref generics, .. })
             | ItemKind::Enum(_, ref generics)
             | ItemKind::Struct(_, ref generics)
@@ -3567,7 +3568,9 @@ impl<'hir> OwnerNode<'hir> {
         match self {
             OwnerNode::Item(Item {
                 kind:
-                    ItemKind::Static(_, _, body) | ItemKind::Const(_, body) | ItemKind::Fn(_, _, body),
+                    ItemKind::Static(_, _, body)
+                    | ItemKind::Const(_, _, body)
+                    | ItemKind::Fn(_, _, body),
                 ..
             })
             | OwnerNode::TraitItem(TraitItem {
@@ -3770,9 +3773,9 @@ impl<'hir> Node<'hir> {
     pub fn ty(self) -> Option<&'hir Ty<'hir>> {
         match self {
             Node::Item(it) => match it.kind {
-                ItemKind::TyAlias(ty, _) | ItemKind::Static(ty, _, _) | ItemKind::Const(ty, _) => {
-                    Some(ty)
-                }
+                ItemKind::TyAlias(ty, _)
+                | ItemKind::Static(ty, _, _)
+                | ItemKind::Const(ty, _, _) => Some(ty),
                 _ => None,
             },
             Node::TraitItem(it) => match it.kind {
@@ -3800,7 +3803,9 @@ impl<'hir> Node<'hir> {
         match self {
             Node::Item(Item {
                 kind:
-                    ItemKind::Static(_, _, body) | ItemKind::Const(_, body) | ItemKind::Fn(_, _, body),
+                    ItemKind::Static(_, _, body)
+                    | ItemKind::Const(_, _, body)
+                    | ItemKind::Fn(_, _, body),
                 ..
             })
             | Node::TraitItem(TraitItem {
diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs
index 347c1f4637f..a8a94e6a476 100644
--- a/compiler/rustc_hir/src/intravisit.rs
+++ b/compiler/rustc_hir/src/intravisit.rs
@@ -467,11 +467,17 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item<'v>) {
         ItemKind::Use(ref path, _) => {
             visitor.visit_use(path, item.hir_id());
         }
-        ItemKind::Static(ref typ, _, body) | ItemKind::Const(ref typ, body) => {
+        ItemKind::Static(ref typ, _, body) => {
             visitor.visit_id(item.hir_id());
             visitor.visit_ty(typ);
             visitor.visit_nested_body(body);
         }
+        ItemKind::Const(ref typ, ref generics, body) => {
+            visitor.visit_id(item.hir_id());
+            visitor.visit_ty(typ);
+            visitor.visit_generics(generics);
+            visitor.visit_nested_body(body);
+        }
         ItemKind::Fn(ref sig, ref generics, body_id) => {
             visitor.visit_id(item.hir_id());
             visitor.visit_fn(
diff --git a/compiler/rustc_hir_analysis/src/astconv/errors.rs b/compiler/rustc_hir_analysis/src/astconv/errors.rs
index 7f4927bbb98..bd311c98fac 100644
--- a/compiler/rustc_hir_analysis/src/astconv/errors.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/errors.rs
@@ -197,7 +197,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             }
         }
 
-        err.span_label(span, format!("associated type `{}` not found", assoc_name));
+        err.span_label(span, format!("associated type `{assoc_name}` not found"));
         err.emit()
     }
 
@@ -393,7 +393,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             .into_iter()
             .map(|error| error.root_obligation.predicate)
             .filter_map(format_pred)
-            .map(|(p, _)| format!("`{}`", p))
+            .map(|(p, _)| format!("`{p}`"))
             .collect();
         bounds.sort();
         bounds.dedup();
@@ -652,7 +652,7 @@ pub(crate) fn fn_trait_to_string(
             }
             .map(|s| {
                 // `s.empty()` checks to see if the type is the unit tuple, if so we don't want a comma
-                if parenthesized || s.is_empty() { format!("({})", s) } else { format!("({},)", s) }
+                if parenthesized || s.is_empty() { format!("({s})") } else { format!("({s},)") }
             })
             .ok(),
             _ => None,
diff --git a/compiler/rustc_hir_analysis/src/astconv/generics.rs b/compiler/rustc_hir_analysis/src/astconv/generics.rs
index e81c61d80ed..1372cc896be 100644
--- a/compiler/rustc_hir_analysis/src/astconv/generics.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/generics.rs
@@ -81,7 +81,7 @@ fn generic_arg_mismatch_err(
                         err.span_suggestion(
                             tcx.def_span(src_def_id),
                             "consider changing this type parameter to a const parameter",
-                            format!("const {}: {}", param_name, param_type),
+                            format!("const {param_name}: {param_type}"),
                             Applicability::MaybeIncorrect,
                         );
                     };
@@ -102,7 +102,7 @@ fn generic_arg_mismatch_err(
                 err.span_suggestion(
                     arg.span(),
                     "array type provided where a `usize` was expected, try",
-                    format!("{{ {} }}", snippet),
+                    format!("{{ {snippet} }}"),
                     Applicability::MaybeIncorrect,
                 );
             }
@@ -130,7 +130,7 @@ fn generic_arg_mismatch_err(
         } else {
             (arg.descr(), param.kind.descr())
         };
-        err.note(format!("{} arguments must be provided before {} arguments", first, last));
+        err.note(format!("{first} arguments must be provided before {last} arguments"));
         if let Some(help) = help {
             err.help(help);
         }
@@ -304,7 +304,7 @@ pub fn create_args_for_parent_generic_args<'tcx, 'a>(
                                         "reorder the arguments: {}: `<{}>`",
                                         param_types_present
                                             .into_iter()
-                                            .map(|ord| format!("{}s", ord))
+                                            .map(|ord| format!("{ord}s"))
                                             .collect::<Vec<String>>()
                                             .join(", then "),
                                         ordered_params
diff --git a/compiler/rustc_hir_analysis/src/astconv/lint.rs b/compiler/rustc_hir_analysis/src/astconv/lint.rs
index ff55174f97a..1bd1270beaf 100644
--- a/compiler/rustc_hir_analysis/src/astconv/lint.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/lint.rs
@@ -34,9 +34,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             let param_name = generics.params.next_type_param_name(None);
 
             let add_generic_sugg = if let Some(span) = generics.span_for_param_suggestion() {
-                (span, format!(", {}: {}", param_name, impl_trait_name))
+                (span, format!(", {param_name}: {impl_trait_name}"))
             } else {
-                (generics.span, format!("<{}: {}>", param_name, impl_trait_name))
+                (generics.span, format!("<{param_name}: {impl_trait_name}>"))
             };
             diag.multipart_suggestion(
             format!("alternatively use a blanket \
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs
index ecbbfd92539..3235a9ceba1 100644
--- a/compiler/rustc_hir_analysis/src/astconv/mod.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs
@@ -1128,7 +1128,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                     ty_param_name
                 )
             };
-            err.span_label(span, format!("ambiguous associated type `{}`", assoc_name));
+            err.span_label(span, format!("ambiguous associated type `{assoc_name}`"));
 
             let mut where_bounds = vec![];
             for bound in bounds {
@@ -1407,7 +1407,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             _ => {
                 let reported = if variant_resolution.is_some() {
                     // Variant in type position
-                    let msg = format!("expected type, found variant `{}`", assoc_ident);
+                    let msg = format!("expected type, found variant `{assoc_ident}`");
                     tcx.sess.span_err(span, msg)
                 } else if qself_ty.is_enum() {
                     let mut err = struct_span_err!(
@@ -1438,12 +1438,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                     } else {
                         err.span_label(
                             assoc_ident.span,
-                            format!("variant not found in `{}`", qself_ty),
+                            format!("variant not found in `{qself_ty}`"),
                         );
                     }
 
                     if let Some(sp) = tcx.hir().span_if_local(adt_def.did()) {
-                        err.span_label(sp, format!("variant `{}` not found here", assoc_ident));
+                        err.span_label(sp, format!("variant `{assoc_ident}` not found here"));
                     }
 
                     err.emit()
@@ -2750,7 +2750,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
                 ty::BrNamed(_, kw::UnderscoreLifetime) | ty::BrAnon(..) | ty::BrEnv => {
                     "an anonymous lifetime".to_string()
                 }
-                ty::BrNamed(_, name) => format!("lifetime `{}`", name),
+                ty::BrNamed(_, name) => format!("lifetime `{name}`"),
             };
 
             let mut err = generate_err(&br_name);
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index a876f169c3a..73627a818e5 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -345,7 +345,7 @@ pub(super) fn check_opaque_for_inheriting_lifetimes(
                 err.span_suggestion(
                     span,
                     "consider spelling out the type instead",
-                    name.unwrap_or_else(|| format!("{:?}", ty)),
+                    name.unwrap_or_else(|| format!("{ty:?}")),
                     Applicability::MaybeIncorrect,
                 );
             }
@@ -576,7 +576,6 @@ fn find_and_apply_rpit_args<'tcx>(
     struct Visitor<'tcx> {
         tcx: TyCtxt<'tcx>,
         opaque: DefId,
-        function: DefId,
         seen: FxHashSet<DefId>,
     }
     impl<'tcx> ty::TypeVisitor<TyCtxt<'tcx>> for Visitor<'tcx> {
@@ -601,19 +600,6 @@ fn find_and_apply_rpit_args<'tcx>(
                         }
                     }
                 }
-                ty::Alias(ty::Projection, alias) => {
-                    if self.tcx.is_impl_trait_in_trait(alias.def_id)
-                        && self.tcx.impl_trait_in_trait_parent_fn(alias.def_id) == self.function
-                    {
-                        // If we're lowering to associated item, install the opaque type which is just
-                        // the `type_of` of the trait's associated item. If we're using the old lowering
-                        // strategy, then just reinterpret the associated type like an opaque :^)
-                        self.tcx
-                            .type_of(alias.def_id)
-                            .instantiate(self.tcx, alias.args)
-                            .visit_with(self)?;
-                    }
-                }
                 ty::Alias(ty::Weak, alias) => {
                     self.tcx
                         .type_of(alias.def_id)
@@ -627,7 +613,7 @@ fn find_and_apply_rpit_args<'tcx>(
         }
     }
     if let ControlFlow::Break(args) =
-        ret.visit_with(&mut Visitor { tcx, function, opaque, seen: Default::default() })
+        ret.visit_with(&mut Visitor { tcx, opaque, seen: Default::default() })
     {
         trace!(?args);
         trace!("expected: {hidden_ty:#?}");
@@ -797,7 +783,7 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) {
                                     "replace the {} parameters with concrete {}{}",
                                     kinds,
                                     kinds_pl,
-                                    egs.map(|egs| format!(" like `{}`", egs)).unwrap_or_default(),
+                                    egs.map(|egs| format!(" like `{egs}`")).unwrap_or_default(),
                                 ),
                             )
                             .emit();
@@ -882,7 +868,7 @@ pub(super) fn check_specialization_validity<'tcx>(
         } else {
             tcx.sess.delay_span_bug(
                 DUMMY_SP,
-                format!("parent item: {:?} not marked as default", parent_impl),
+                format!("parent item: {parent_impl:?} not marked as default"),
             );
         }
     }
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
index 89877280a73..a8c66ff9001 100644
--- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
+++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
@@ -76,7 +76,7 @@ fn check_method_is_structurally_compatible<'tcx>(
     Ok(())
 }
 
-/// This function is best explained by example. Consider a trait with it's implementation:
+/// This function is best explained by example. Consider a trait with its implementation:
 ///
 /// ```rust
 /// trait Trait<'t, T> {
@@ -120,7 +120,7 @@ fn check_method_is_structurally_compatible<'tcx>(
 /// types:
 ///
 /// ```rust,ignore (pseudo-Rust)
-/// <'b> fn(t: &'i0 U0, m: &'b) -> Foo
+/// <'b> fn(t: &'i0 U0, m: &'b N0) -> Foo
 /// ```
 ///
 /// We now want to extract and substitute the type of the *trait*
@@ -137,7 +137,7 @@ fn check_method_is_structurally_compatible<'tcx>(
 /// Applying this to the trait method type yields:
 ///
 /// ```rust,ignore (pseudo-Rust)
-/// <'a> fn(t: &'i0 U0, m: &'a) -> Foo
+/// <'a> fn(t: &'i0 U0, m: &'a N0) -> Foo
 /// ```
 ///
 /// This type is also the same but the name of the bound region (`'a`
@@ -219,11 +219,7 @@ fn compare_method_predicate_entailment<'tcx>(
     // The key step here is to update the caller_bounds's predicates to be
     // the new hybrid bounds we computed.
     let normalize_cause = traits::ObligationCause::misc(impl_m_span, impl_m_def_id);
-    let param_env = ty::ParamEnv::new(
-        tcx.mk_clauses(&hybrid_preds.predicates),
-        Reveal::UserFacing,
-        hir::Constness::NotConst,
-    );
+    let param_env = ty::ParamEnv::new(tcx.mk_clauses(&hybrid_preds.predicates), Reveal::UserFacing);
     let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause);
 
     let infcx = &tcx.infer_ctxt().build();
@@ -262,8 +258,6 @@ fn compare_method_predicate_entailment<'tcx>(
     // type.
 
     // Compute placeholder form of impl and trait method tys.
-    let tcx = infcx.tcx;
-
     let mut wf_tys = FxIndexSet::default();
 
     let unnormalized_impl_sig = infcx.instantiate_binder_with_fresh_vars(
@@ -760,7 +754,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
     );
     ocx.resolve_regions_and_report_errors(impl_m_def_id, &outlives_env)?;
 
-    let mut collected_tys = FxHashMap::default();
+    let mut remapped_types = FxHashMap::default();
     for (def_id, (ty, args)) in collected_types {
         match infcx.fully_resolve((ty, args)) {
             Ok((ty, args)) => {
@@ -810,19 +804,37 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
                     Ok(ty) => ty,
                     Err(guar) => Ty::new_error(tcx, guar),
                 };
-                collected_tys.insert(def_id, ty::EarlyBinder::bind(ty));
+                remapped_types.insert(def_id, ty::EarlyBinder::bind(ty));
             }
             Err(err) => {
                 let reported = tcx.sess.delay_span_bug(
                     return_span,
                     format!("could not fully resolve: {ty} => {err:?}"),
                 );
-                collected_tys.insert(def_id, ty::EarlyBinder::bind(Ty::new_error(tcx, reported)));
+                remapped_types.insert(def_id, ty::EarlyBinder::bind(Ty::new_error(tcx, reported)));
             }
         }
     }
 
-    Ok(&*tcx.arena.alloc(collected_tys))
+    // We may not collect all RPITITs that we see in the HIR for a trait signature
+    // because an RPITIT was located within a missing item. Like if we have a sig
+    // returning `-> Missing<impl Sized>`, that gets converted to `-> [type error]`,
+    // and when walking through the signature we end up never collecting the def id
+    // of the `impl Sized`. Insert that here, so we don't ICE later.
+    for assoc_item in tcx.associated_types_for_impl_traits_in_associated_fn(trait_m.def_id) {
+        if !remapped_types.contains_key(assoc_item) {
+            remapped_types.insert(
+                *assoc_item,
+                ty::EarlyBinder::bind(Ty::new_error_with_message(
+                    tcx,
+                    return_span,
+                    "missing synthetic item for RPITIT",
+                )),
+            );
+        }
+    }
+
+    Ok(&*tcx.arena.alloc(remapped_types))
 }
 
 struct ImplTraitInTraitCollector<'a, 'tcx> {
@@ -1672,19 +1684,19 @@ fn compare_synthetic_generics<'tcx>(
 /// ```rust,ignore (pseudo-Rust)
 /// trait Foo {
 ///     fn foo<const N: u8>();
-///     type bar<const N: u8>;
+///     type Bar<const N: u8>;
 ///     fn baz<const N: u32>();
-///     type blah<T>;
+///     type Blah<T>;
 /// }
 ///
 /// impl Foo for () {
 ///     fn foo<const N: u64>() {}
 ///     //~^ error
-///     type bar<const N: u64> {}
+///     type Bar<const N: u64> = ();
 ///     //~^ error
 ///     fn baz<T>() {}
 ///     //~^ error
-///     type blah<const N: i64> = u32;
+///     type Blah<const N: i64> = u32;
 ///     //~^ error
 /// }
 /// ```
@@ -1744,7 +1756,7 @@ fn compare_generic_param_kinds<'tcx>(
                         tcx.type_of(param.def_id).instantiate_identity()
                     )
                 }
-                Type { .. } => format!("{} type parameter", prefix),
+                Type { .. } => format!("{prefix} type parameter"),
                 Lifetime { .. } => unreachable!(),
             };
 
@@ -1773,36 +1785,82 @@ pub(super) fn compare_impl_const_raw(
     let trait_const_item = tcx.associated_item(trait_const_item_def);
     let impl_trait_ref =
         tcx.impl_trait_ref(impl_const_item.container_id(tcx)).unwrap().instantiate_identity();
-    debug!("compare_const_impl(impl_trait_ref={:?})", impl_trait_ref);
 
-    let impl_c_span = tcx.def_span(impl_const_item_def.to_def_id());
+    debug!("compare_impl_const(impl_trait_ref={:?})", impl_trait_ref);
 
-    let infcx = tcx.infer_ctxt().build();
-    let param_env = tcx.param_env(impl_const_item_def.to_def_id());
-    let ocx = ObligationCtxt::new(&infcx);
+    compare_number_of_generics(tcx, impl_const_item, trait_const_item, false)?;
+    compare_generic_param_kinds(tcx, impl_const_item, trait_const_item, false)?;
+    compare_const_predicate_entailment(tcx, impl_const_item, trait_const_item, impl_trait_ref)
+}
+
+/// The equivalent of [compare_method_predicate_entailment], but for associated constants
+/// instead of associated functions.
+// FIXME(generic_const_items): If possible extract the common parts of `compare_{type,const}_predicate_entailment`.
+fn compare_const_predicate_entailment<'tcx>(
+    tcx: TyCtxt<'tcx>,
+    impl_ct: ty::AssocItem,
+    trait_ct: ty::AssocItem,
+    impl_trait_ref: ty::TraitRef<'tcx>,
+) -> Result<(), ErrorGuaranteed> {
+    let impl_ct_def_id = impl_ct.def_id.expect_local();
+    let impl_ct_span = tcx.def_span(impl_ct_def_id);
 
     // The below is for the most part highly similar to the procedure
     // for methods above. It is simpler in many respects, especially
     // because we shouldn't really have to deal with lifetimes or
     // predicates. In fact some of this should probably be put into
     // shared functions because of DRY violations...
-    let trait_to_impl_args = impl_trait_ref.args;
+    let impl_args = GenericArgs::identity_for_item(tcx, impl_ct.def_id);
+    let trait_to_impl_args =
+        impl_args.rebase_onto(tcx, impl_ct.container_id(tcx), impl_trait_ref.args);
 
     // Create a parameter environment that represents the implementation's
     // method.
     // Compute placeholder form of impl and trait const tys.
-    let impl_ty = tcx.type_of(impl_const_item_def.to_def_id()).instantiate_identity();
-    let trait_ty = tcx.type_of(trait_const_item_def).instantiate(tcx, trait_to_impl_args);
-    let mut cause = ObligationCause::new(
-        impl_c_span,
-        impl_const_item_def,
-        ObligationCauseCode::CompareImplItemObligation {
-            impl_item_def_id: impl_const_item_def,
-            trait_item_def_id: trait_const_item_def,
-            kind: impl_const_item.kind,
-        },
+    let impl_ty = tcx.type_of(impl_ct_def_id).instantiate_identity();
+
+    let trait_ty = tcx.type_of(trait_ct.def_id).instantiate(tcx, trait_to_impl_args);
+    let code = ObligationCauseCode::CompareImplItemObligation {
+        impl_item_def_id: impl_ct_def_id,
+        trait_item_def_id: trait_ct.def_id,
+        kind: impl_ct.kind,
+    };
+    let mut cause = ObligationCause::new(impl_ct_span, impl_ct_def_id, code.clone());
+
+    let impl_ct_predicates = tcx.predicates_of(impl_ct.def_id);
+    let trait_ct_predicates = tcx.predicates_of(trait_ct.def_id);
+
+    check_region_bounds_on_impl_item(tcx, impl_ct, trait_ct, false)?;
+
+    // The predicates declared by the impl definition, the trait and the
+    // associated const in the trait are assumed.
+    let impl_predicates = tcx.predicates_of(impl_ct_predicates.parent.unwrap());
+    let mut hybrid_preds = impl_predicates.instantiate_identity(tcx);
+    hybrid_preds.predicates.extend(
+        trait_ct_predicates
+            .instantiate_own(tcx, trait_to_impl_args)
+            .map(|(predicate, _)| predicate),
+    );
+
+    let param_env = ty::ParamEnv::new(tcx.mk_clauses(&hybrid_preds.predicates), Reveal::UserFacing);
+    let param_env = traits::normalize_param_env_or_error(
+        tcx,
+        param_env,
+        ObligationCause::misc(impl_ct_span, impl_ct_def_id),
     );
 
+    let infcx = tcx.infer_ctxt().build();
+    let ocx = ObligationCtxt::new(&infcx);
+
+    let impl_ct_own_bounds = impl_ct_predicates.instantiate_own(tcx, impl_args);
+    for (predicate, span) in impl_ct_own_bounds {
+        let cause = ObligationCause::misc(span, impl_ct_def_id);
+        let predicate = ocx.normalize(&cause, param_env, predicate);
+
+        let cause = ObligationCause::new(span, impl_ct_def_id, code.clone());
+        ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate));
+    }
+
     // There is no "body" here, so just pass dummy id.
     let impl_ty = ocx.normalize(&cause, param_env, impl_ty);
 
@@ -1821,7 +1879,7 @@ pub(super) fn compare_impl_const_raw(
         );
 
         // Locate the Span containing just the type of the offending impl
-        let (ty, _) = tcx.hir().expect_impl_item(impl_const_item_def).expect_const();
+        let (ty, _) = tcx.hir().expect_impl_item(impl_ct_def_id).expect_const();
         cause.span = ty.span;
 
         let mut diag = struct_span_err!(
@@ -1829,12 +1887,12 @@ pub(super) fn compare_impl_const_raw(
             cause.span,
             E0326,
             "implemented const `{}` has an incompatible type for trait",
-            trait_const_item.name
+            trait_ct.name
         );
 
-        let trait_c_span = trait_const_item_def.as_local().map(|trait_c_def_id| {
+        let trait_c_span = trait_ct.def_id.as_local().map(|trait_ct_def_id| {
             // Add a label to the Span containing just the type of the const
-            let (ty, _) = tcx.hir().expect_trait_item(trait_c_def_id).expect_const();
+            let (ty, _) = tcx.hir().expect_trait_item(trait_ct_def_id).expect_const();
             ty.span
         });
 
@@ -1861,7 +1919,7 @@ pub(super) fn compare_impl_const_raw(
     }
 
     let outlives_env = OutlivesEnvironment::new(param_env);
-    ocx.resolve_regions_and_report_errors(impl_const_item_def, &outlives_env)
+    ocx.resolve_regions_and_report_errors(impl_ct_def_id, &outlives_env)
 }
 
 pub(super) fn compare_impl_ty<'tcx>(
@@ -1903,7 +1961,7 @@ fn compare_type_predicate_entailment<'tcx>(
         return Ok(());
     }
 
-    // This `HirId` should be used for the `body_id` field on each
+    // This `DefId` should be used for the `body_id` field on each
     // `ObligationCause` (and the `FnCtxt`). This is what
     // `regionck_item` expects.
     let impl_ty_def_id = impl_ty.def_id.expect_local();
@@ -1922,12 +1980,8 @@ fn compare_type_predicate_entailment<'tcx>(
     debug!("compare_type_predicate_entailment: bounds={:?}", hybrid_preds);
 
     let impl_ty_span = tcx.def_span(impl_ty_def_id);
-    let normalize_cause = traits::ObligationCause::misc(impl_ty_span, impl_ty_def_id);
-    let param_env = ty::ParamEnv::new(
-        tcx.mk_clauses(&hybrid_preds.predicates),
-        Reveal::UserFacing,
-        hir::Constness::NotConst,
-    );
+    let normalize_cause = ObligationCause::misc(impl_ty_span, impl_ty_def_id);
+    let param_env = ty::ParamEnv::new(tcx.mk_clauses(&hybrid_preds.predicates), Reveal::UserFacing);
     let param_env = traits::normalize_param_env_or_error(tcx, param_env, normalize_cause);
     let infcx = tcx.infer_ctxt().build();
     let ocx = ObligationCtxt::new(&infcx);
@@ -1971,7 +2025,7 @@ fn compare_type_predicate_entailment<'tcx>(
 ///
 /// trait X { type Y: Copy } impl X for T { type Y = S; }
 ///
-/// We are able to normalize `<T as X>::U` to `S`, and so when we check the
+/// We are able to normalize `<T as X>::Y` to `S`, and so when we check the
 /// impl is well-formed we have to prove `S: Copy`.
 ///
 /// For default associated types the normalization is not possible (the value
@@ -2102,7 +2156,7 @@ pub(super) fn check_type_bounds<'tcx>(
                 .to_predicate(tcx),
             ),
         };
-        ty::ParamEnv::new(tcx.mk_clauses(&predicates), Reveal::UserFacing, param_env.constness())
+        ty::ParamEnv::new(tcx.mk_clauses(&predicates), Reveal::UserFacing)
     };
     debug!(?normalize_param_env);
 
diff --git a/compiler/rustc_hir_analysis/src/check/dropck.rs b/compiler/rustc_hir_analysis/src/check/dropck.rs
index 4ac3a7c23ae..dda3f742569 100644
--- a/compiler/rustc_hir_analysis/src/check/dropck.rs
+++ b/compiler/rustc_hir_analysis/src/check/dropck.rs
@@ -129,9 +129,8 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
     // We don't need to normalize this param-env or anything, since we're only
     // substituting it with free params, so no additional param-env normalization
     // can occur on top of what has been done in the param_env query itself.
-    let param_env = ty::EarlyBinder::bind(tcx.param_env(adt_def_id))
-        .instantiate(tcx, adt_to_impl_args)
-        .with_constness(tcx.constness(drop_impl_def_id));
+    let param_env =
+        ty::EarlyBinder::bind(tcx.param_env(adt_def_id)).instantiate(tcx, adt_to_impl_args);
 
     for (pred, span) in tcx.predicates_of(drop_impl_def_id).instantiate_identity(tcx) {
         let normalize_cause = traits::ObligationCause::misc(span, adt_def_id);
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
index d5c9840887a..064021b1ea4 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs
@@ -134,7 +134,7 @@ pub fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: DefId) -> hir
 /// Remember to add all intrinsics here, in `compiler/rustc_codegen_llvm/src/intrinsic.rs`,
 /// and in `library/core/src/intrinsics.rs`.
 pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
-    let param = |n| Ty::new_param(tcx, n, Symbol::intern(&format!("P{}", n)));
+    let param = |n| Ty::new_param(tcx, n, Symbol::intern(&format!("P{n}")));
     let intrinsic_id = it.owner_id.to_def_id();
     let intrinsic_name = tcx.item_name(intrinsic_id);
     let name_str = intrinsic_name.as_str();
@@ -494,7 +494,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
 /// Type-check `extern "platform-intrinsic" { ... }` functions.
 pub fn check_platform_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
     let param = |n| {
-        let name = Symbol::intern(&format!("P{}", n));
+        let name = Symbol::intern(&format!("P{n}"));
         Ty::new_param(tcx, n, name)
     };
 
@@ -521,6 +521,10 @@ pub fn check_platform_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>)
         | sym::simd_saturating_sub => (1, vec![param(0), param(0)], param(0)),
         sym::simd_arith_offset => (2, vec![param(0), param(1)], param(0)),
         sym::simd_neg
+        | sym::simd_bswap
+        | sym::simd_bitreverse
+        | sym::simd_ctlz
+        | sym::simd_cttz
         | sym::simd_fsqrt
         | sym::simd_fsin
         | sym::simd_fcos
diff --git a/compiler/rustc_hir_analysis/src/check/intrinsicck.rs b/compiler/rustc_hir_analysis/src/check/intrinsicck.rs
index 8423a9550ba..b0dd5e5787d 100644
--- a/compiler/rustc_hir_analysis/src/check/intrinsicck.rs
+++ b/compiler/rustc_hir_analysis/src/check/intrinsicck.rs
@@ -211,7 +211,7 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> {
         // register class is usable at all.
         if let Some(feature) = feature {
             if !target_features.contains(feature) {
-                let msg = format!("`{}` target feature is not enabled", feature);
+                let msg = format!("`{feature}` target feature is not enabled");
                 let mut err = self.tcx.sess.struct_span_err(expr.span, msg);
                 err.note(format!(
                     "this is required to use type `{}` with register class `{}`",
diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs
index def7a3a9d88..4cf3587327d 100644
--- a/compiler/rustc_hir_analysis/src/check/mod.rs
+++ b/compiler/rustc_hir_analysis/src/check/mod.rs
@@ -214,7 +214,7 @@ fn missing_items_err(
             trait_item,
             tcx.impl_trait_ref(impl_def_id).unwrap().instantiate_identity(),
         );
-        let code = format!("{}{}\n{}", padding, snippet, padding);
+        let code = format!("{padding}{snippet}\n{padding}");
         if let Some(span) = tcx.hir().span_if_local(trait_item.def_id) {
             missing_trait_item_label
                 .push(errors::MissingTraitItemLabel { span, item: trait_item.name });
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index 4e194f1c381..ad886ce82b1 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -75,12 +75,10 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
             self.body_def_id,
             ObligationCauseCode::WellFormed(loc),
         );
-        // for a type to be WF, we do not need to check if const trait predicates satisfy.
-        let param_env = self.param_env.without_const();
         self.ocx.register_obligation(traits::Obligation::new(
             self.tcx(),
             cause,
-            param_env,
+            self.param_env,
             ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg))),
         ));
     }
@@ -248,8 +246,11 @@ fn check_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) {
         // `ForeignItem`s are handled separately.
         hir::ItemKind::ForeignMod { .. } => {}
         hir::ItemKind::TyAlias(hir_ty, ..) => {
-            if tcx.type_of(item.owner_id.def_id).skip_binder().has_opaque_types() {
-                // Bounds are respected for `type X = impl Trait` and `type X = (impl Trait, Y);`
+            if tcx.features().lazy_type_alias
+                || tcx.type_of(item.owner_id).skip_binder().has_opaque_types()
+            {
+                // Bounds of lazy type aliases and of eager ones that contain opaque types are respected.
+                // E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`.
                 check_item_type(tcx, def_id, hir_ty.span, UnsizedHandling::Allow);
             }
         }
@@ -286,6 +287,17 @@ fn check_trait_item(tcx: TyCtxt<'_>, trait_item: &hir::TraitItem<'_>) {
     };
     check_object_unsafe_self_trait_by_name(tcx, trait_item);
     check_associated_item(tcx, def_id, span, method_sig);
+
+    if matches!(trait_item.kind, hir::TraitItemKind::Fn(..)) {
+        for &assoc_ty_def_id in tcx.associated_types_for_impl_traits_in_associated_fn(def_id) {
+            check_associated_item(
+                tcx,
+                assoc_ty_def_id.expect_local(),
+                tcx.def_span(assoc_ty_def_id),
+                None,
+            );
+        }
+    }
 }
 
 /// Require that the user writes where clauses on GATs for the implicit
@@ -472,8 +484,7 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, associated_items: &[hir::TraitItemRe
             let bound =
                 if unsatisfied_bounds.len() > 1 { "these bounds are" } else { "this bound is" };
             err.note(format!(
-                "{} currently required to ensure that impls have maximum flexibility",
-                bound
+                "{bound} currently required to ensure that impls have maximum flexibility"
             ));
             err.note(
                 "we are soliciting feedback, see issue #87479 \
@@ -505,7 +516,7 @@ fn augment_param_env<'tcx>(
     );
     // FIXME(compiler-errors): Perhaps there is a case where we need to normalize this
     // i.e. traits::normalize_param_env_or_error
-    ty::ParamEnv::new(bounds, param_env.reveal(), param_env.constness())
+    ty::ParamEnv::new(bounds, param_env.reveal())
 }
 
 /// We use the following trait as an example throughout this function.
@@ -989,7 +1000,7 @@ fn check_type_defn<'tcx>(tcx: TyCtxt<'tcx>, item: &hir::Item<'tcx>, all_sized: b
                     let ty = tcx.erase_regions(ty);
                     if ty.has_infer() {
                         tcx.sess
-                            .delay_span_bug(item.span, format!("inference variables in {:?}", ty));
+                            .delay_span_bug(item.span, format!("inference variables in {ty:?}"));
                         // Just treat unresolved type expression as if it needs drop.
                         true
                     } else {
@@ -1416,7 +1427,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
     let wf_obligations = predicates.into_iter().flat_map(|(p, sp)| {
         traits::wf::predicate_obligations(
             infcx,
-            wfcx.param_env.without_const(),
+            wfcx.param_env,
             wfcx.body_def_id,
             p.as_predicate(),
             sp,
@@ -1469,13 +1480,6 @@ fn check_fn_or_method<'tcx>(
 
     check_where_clauses(wfcx, span, def_id);
 
-    check_return_position_impl_trait_in_trait_bounds(
-        wfcx,
-        def_id,
-        sig.output(),
-        hir_decl.output.span(),
-    );
-
     if sig.abi == Abi::RustCall {
         let span = tcx.def_span(def_id);
         let has_implicit_self = hir_decl.implicit_self != hir::ImplicitSelfKind::None;
@@ -1510,87 +1514,6 @@ fn check_fn_or_method<'tcx>(
     }
 }
 
-/// Basically `check_associated_type_bounds`, but separated for now and should be
-/// deduplicated when RPITITs get lowered into real associated items.
-#[tracing::instrument(level = "trace", skip(wfcx))]
-fn check_return_position_impl_trait_in_trait_bounds<'tcx>(
-    wfcx: &WfCheckingCtxt<'_, 'tcx>,
-    fn_def_id: LocalDefId,
-    fn_output: Ty<'tcx>,
-    span: Span,
-) {
-    let tcx = wfcx.tcx();
-    let Some(assoc_item) = tcx.opt_associated_item(fn_def_id.to_def_id()) else {
-        return;
-    };
-    if assoc_item.container != ty::AssocItemContainer::TraitContainer {
-        return;
-    }
-    fn_output.visit_with(&mut ImplTraitInTraitFinder {
-        wfcx,
-        fn_def_id,
-        depth: ty::INNERMOST,
-        seen: FxHashSet::default(),
-    });
-}
-
-// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): Even with the new lowering
-// strategy, we can't just call `check_associated_item` on the new RPITITs,
-// because tests like `tests/ui/async-await/in-trait/implied-bounds.rs` will fail.
-// That's because we need to check that the bounds of the RPITIT hold using
-// the special args that we create during opaque type lowering, otherwise we're
-// getting a bunch of early bound and free regions mixed up... Haven't looked too
-// deep into this, though.
-struct ImplTraitInTraitFinder<'a, 'tcx> {
-    wfcx: &'a WfCheckingCtxt<'a, 'tcx>,
-    fn_def_id: LocalDefId,
-    depth: ty::DebruijnIndex,
-    seen: FxHashSet<DefId>,
-}
-impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
-    type BreakTy = !;
-
-    fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<!> {
-        let tcx = self.wfcx.tcx();
-        if let ty::Alias(ty::Opaque, unshifted_opaque_ty) = *ty.kind()
-            && self.seen.insert(unshifted_opaque_ty.def_id)
-            && let Some(opaque_def_id) = unshifted_opaque_ty.def_id.as_local()
-            && let origin = tcx.opaque_type_origin(opaque_def_id)
-            && let hir::OpaqueTyOrigin::FnReturn(source) | hir::OpaqueTyOrigin::AsyncFn(source) = origin
-            && source == self.fn_def_id
-        {
-            let opaque_ty = tcx.fold_regions(unshifted_opaque_ty, |re, _depth| {
-                match re.kind() {
-                    ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReError(_) | ty::ReStatic => re,
-                    r => bug!("unexpected region: {r:?}"),
-                }
-            });
-            for (bound, bound_span) in tcx
-                .explicit_item_bounds(opaque_ty.def_id)
-                .iter_instantiated_copied(tcx, opaque_ty.args)
-            {
-                let bound = self.wfcx.normalize(bound_span, None, bound);
-                self.wfcx.register_obligations(traits::wf::predicate_obligations(
-                    self.wfcx.infcx,
-                    self.wfcx.param_env,
-                    self.wfcx.body_def_id,
-                    bound.as_predicate(),
-                    bound_span,
-                ));
-                // Set the debruijn index back to innermost here, since we already eagerly
-                // shifted the args that we use to generate these bounds. This is unfortunately
-                // subtly different behavior than the `ImplTraitInTraitFinder` we use in `param_env`,
-                // but that function doesn't actually need to normalize the bound it's visiting
-                // (whereas we have to do so here)...
-                let old_depth = std::mem::replace(&mut self.depth, ty::INNERMOST);
-                bound.visit_with(self);
-                self.depth = old_depth;
-            }
-        }
-        ty.super_visit_with(self)
-    }
-}
-
 const HELP_FOR_SELF_TYPE: &str = "consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, \
      `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one \
      of the previous types except `Self`)";
@@ -1863,8 +1786,7 @@ fn report_bivariance(
 
     if matches!(param.kind, hir::GenericParamKind::Type { .. }) && !has_explicit_bounds {
         err.help(format!(
-            "if you intended `{0}` to be a const parameter, use `const {0}: usize` instead",
-            param_name
+            "if you intended `{param_name}` to be a const parameter, use `const {param_name}: usize` instead"
         ));
     }
     err.emit()
diff --git a/compiler/rustc_hir_analysis/src/check_unused.rs b/compiler/rustc_hir_analysis/src/check_unused.rs
index d10bc5b34ea..9ad73eeffc6 100644
--- a/compiler/rustc_hir_analysis/src/check_unused.rs
+++ b/compiler/rustc_hir_analysis/src/check_unused.rs
@@ -36,7 +36,7 @@ fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
         }
         let (path, _) = item.expect_use();
         let msg = if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(path.span) {
-            format!("unused import: `{}`", snippet)
+            format!("unused import: `{snippet}`")
         } else {
             "unused import".to_owned()
         };
diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
index 3f65adcd36e..c930537d4ae 100644
--- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
@@ -171,8 +171,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef
                 create_err(&format!(
                     "the trait `DispatchFromDyn` may only be implemented \
                             for a coercion between structures with the same \
-                            definition; expected `{}`, found `{}`",
-                    source_path, target_path,
+                            definition; expected `{source_path}`, found `{target_path}`",
                 ))
                 .emit();
 
diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
index f5326e50614..a94c75f918a 100644
--- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
@@ -148,8 +148,7 @@ impl<'tcx> InherentCollect<'tcx> {
                 if let ty::Ref(_, subty, _) = ty.kind() {
                     err.note(format!(
                         "you could also try moving the reference to \
-                            uses of `{}` (such as `self`) within the implementation",
-                        subty
+                            uses of `{subty}` (such as `self`) within the implementation"
                     ));
                 }
                 err.emit();
diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs
index 3bd2931265c..7205b7a21a8 100644
--- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs
@@ -77,8 +77,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
                         "duplicate definitions with name `{}`",
                         ident,
                     );
-                    err.span_label(span, format!("duplicate definitions for `{}`", ident));
-                    err.span_label(*former, format!("other definition for `{}`", ident));
+                    err.span_label(span, format!("duplicate definitions for `{ident}`"));
+                    err.span_label(*former, format!("other definition for `{ident}`"));
 
                     err.emit();
                 }
@@ -114,11 +114,11 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
                 );
                 err.span_label(
                     self.tcx.def_span(item1.def_id),
-                    format!("duplicate definitions for `{}`", name),
+                    format!("duplicate definitions for `{name}`"),
                 );
                 err.span_label(
                     self.tcx.def_span(item2.def_id),
-                    format!("other definition for `{}`", name),
+                    format!("other definition for `{name}`"),
                 );
 
                 for cause in &overlap.intercrate_ambiguity_causes {
diff --git a/compiler/rustc_hir_analysis/src/coherence/orphan.rs b/compiler/rustc_hir_analysis/src/coherence/orphan.rs
index 8d9a6f4d446..bbdb108c59b 100644
--- a/compiler/rustc_hir_analysis/src/coherence/orphan.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/orphan.rs
@@ -412,9 +412,8 @@ fn emit_orphan_check_error<'tcx>(
                 .span_label(
                     sp,
                     format!(
-                        "type parameter `{}` must be covered by another type \
-                    when it appears before the first local type (`{}`)",
-                        param_ty, local_type
+                        "type parameter `{param_ty}` must be covered by another type \
+                    when it appears before the first local type (`{local_type}`)"
                     ),
                 )
                 .note(
@@ -441,9 +440,8 @@ fn emit_orphan_check_error<'tcx>(
                 .span_label(
                     sp,
                     format!(
-                        "type parameter `{}` must be used as the type parameter for some \
+                        "type parameter `{param_ty}` must be used as the type parameter for some \
                     local type",
-                        param_ty,
                     ),
                 )
                 .note(
@@ -541,17 +539,16 @@ fn lint_auto_trait_impl<'tcx>(
             let self_descr = tcx.def_descr(self_type_did);
             match arg {
                 ty::util::NotUniqueParam::DuplicateParam(arg) => {
-                    lint.note(format!("`{}` is mentioned multiple times", arg));
+                    lint.note(format!("`{arg}` is mentioned multiple times"));
                 }
                 ty::util::NotUniqueParam::NotParam(arg) => {
-                    lint.note(format!("`{}` is not a generic parameter", arg));
+                    lint.note(format!("`{arg}` is not a generic parameter"));
                 }
             }
             lint.span_note(
                 item_span,
                 format!(
-                    "try using the same sequence of generic parameters as the {} definition",
-                    self_descr,
+                    "try using the same sequence of generic parameters as the {self_descr} definition",
                 ),
             )
         },
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs
index c160cf2df6e..f568b751951 100644
--- a/compiler/rustc_hir_analysis/src/collect.rs
+++ b/compiler/rustc_hir_analysis/src/collect.rs
@@ -195,9 +195,9 @@ pub(crate) fn placeholder_type_error_diag<'tcx>(
             sugg.push((arg.span, (*type_name).to_string()));
         } else if let Some(span) = generics.span_for_param_suggestion() {
             // Account for bounds, we want `fn foo<T: E, K>(_: K)` not `fn foo<T, K: E>(_: K)`.
-            sugg.push((span, format!(", {}", type_name)));
+            sugg.push((span, format!(", {type_name}")));
         } else {
-            sugg.push((generics.span, format!("<{}>", type_name)));
+            sugg.push((generics.span, format!("<{type_name}>")));
         }
     }
 
@@ -329,7 +329,7 @@ fn bad_placeholder<'tcx>(
     mut spans: Vec<Span>,
     kind: &'static str,
 ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
-    let kind = if kind.ends_with('s') { format!("{}es", kind) } else { format!("{}s", kind) };
+    let kind = if kind.ends_with('s') { format!("{kind}es") } else { format!("{kind}s") };
 
     spans.sort();
     tcx.sess.create_err(errors::PlaceholderNotAllowedItemSignatures { spans, kind })
@@ -425,10 +425,8 @@ impl<'tcx> AstConv<'tcx> for ItemCtxt<'tcx> {
                         | hir::ItemKind::Union(_, generics) => {
                             let lt_name = get_new_lifetime_name(self.tcx, poly_trait_ref, generics);
                             let (lt_sp, sugg) = match generics.params {
-                                [] => (generics.span, format!("<{}>", lt_name)),
-                                [bound, ..] => {
-                                    (bound.span.shrink_to_lo(), format!("{}, ", lt_name))
-                                }
+                                [] => (generics.span, format!("<{lt_name}>")),
+                                [bound, ..] => (bound.span.shrink_to_lo(), format!("{lt_name}, ")),
                             };
                             mpart_sugg = Some(errors::AssociatedTypeTraitUninferredGenericParamsMultipartSuggestion {
                                 fspan: lt_sp,
@@ -1027,7 +1025,7 @@ fn trait_def(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::TraitDef {
             } else {
                 tcx.sess.span_err(
                     meta.span(),
-                    format!("unknown meta item passed to `rustc_deny_explicit_impl` {:?}", meta),
+                    format!("unknown meta item passed to `rustc_deny_explicit_impl` {meta:?}"),
                 );
             }
         }
@@ -1505,7 +1503,7 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
                     .sess
                     .source_map()
                     .span_to_snippet(ast_ty.span)
-                    .map_or_else(|_| String::new(), |s| format!(" `{}`", s));
+                    .map_or_else(|_| String::new(), |s| format!(" `{s}`"));
                 tcx.sess.emit_err(errors::SIMDFFIHighlyExperimental { span: ast_ty.span, snip });
             }
         };
diff --git a/compiler/rustc_hir_analysis/src/collect/generics_of.rs b/compiler/rustc_hir_analysis/src/collect/generics_of.rs
index edcb9527fe2..6e1762c54f2 100644
--- a/compiler/rustc_hir_analysis/src/collect/generics_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/generics_of.rs
@@ -209,6 +209,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
                 | ItemKind::Struct(..)
                 | ItemKind::OpaqueTy(..)
                 | ItemKind::Union(..) => (None, Defaults::Allowed),
+                ItemKind::Const(..) => (None, Defaults::Deny),
                 _ => (None, Defaults::FutureCompatDisallowed),
             }
         }
diff --git a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
index 758e9dc7230..4b7743fae53 100644
--- a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
+++ b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs
@@ -3,7 +3,7 @@ use crate::astconv::{AstConv, PredicateFilter};
 use rustc_hir as hir;
 use rustc_infer::traits::util;
 use rustc_middle::ty::GenericArgs;
-use rustc_middle::ty::{self, Ty, TyCtxt};
+use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder};
 use rustc_span::def_id::{DefId, LocalDefId};
 use rustc_span::Span;
 
@@ -113,7 +113,7 @@ pub(super) fn explicit_item_bounds(
             ..
         }) => associated_type_bounds(tcx, def_id, bounds, *span),
         hir::Node::Item(hir::Item {
-            kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, .. }),
+            kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, in_trait: false, .. }),
             span,
             ..
         }) => {
@@ -121,6 +121,27 @@ pub(super) fn explicit_item_bounds(
             let item_ty = Ty::new_opaque(tcx, def_id.to_def_id(), args);
             opaque_type_bounds(tcx, def_id, bounds, item_ty, *span)
         }
+        // Since RPITITs are astconv'd as projections in `ast_ty_to_ty`, when we're asking
+        // for the item bounds of the *opaques* in a trait's default method signature, we
+        // need to map these projections back to opaques.
+        hir::Node::Item(hir::Item {
+            kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, in_trait: true, origin, .. }),
+            span,
+            ..
+        }) => {
+            let (hir::OpaqueTyOrigin::FnReturn(fn_def_id)
+            | hir::OpaqueTyOrigin::AsyncFn(fn_def_id)) = *origin
+            else {
+                bug!()
+            };
+            let args = GenericArgs::identity_for_item(tcx, def_id);
+            let item_ty = Ty::new_opaque(tcx, def_id.to_def_id(), args);
+            tcx.arena.alloc_slice(
+                &opaque_type_bounds(tcx, def_id, bounds, item_ty, *span)
+                    .to_vec()
+                    .fold_with(&mut AssocTyToOpaque { tcx, fn_def_id: fn_def_id.to_def_id() }),
+            )
+        }
         hir::Node::Item(hir::Item { kind: hir::ItemKind::TyAlias(..), .. }) => &[],
         _ => bug!("item_bounds called on {:?}", def_id),
     };
@@ -135,3 +156,26 @@ pub(super) fn item_bounds(
         tcx.mk_clauses_from_iter(util::elaborate(tcx, bounds.iter().map(|&(bound, _span)| bound)))
     })
 }
+
+struct AssocTyToOpaque<'tcx> {
+    tcx: TyCtxt<'tcx>,
+    fn_def_id: DefId,
+}
+
+impl<'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTyToOpaque<'tcx> {
+    fn interner(&self) -> TyCtxt<'tcx> {
+        self.tcx
+    }
+
+    fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
+        if let ty::Alias(ty::Projection, projection_ty) = ty.kind()
+            && let Some(ty::ImplTraitInTraitData::Trait { fn_def_id, .. })
+                = self.tcx.opt_rpitit_info(projection_ty.def_id)
+            && fn_def_id == self.fn_def_id
+        {
+            self.tcx.type_of(projection_ty.def_id).instantiate(self.tcx, projection_ty.args)
+        } else {
+            ty
+        }
+    }
+}
diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
index 979b101e7fe..ab3b2dde078 100644
--- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs
@@ -156,6 +156,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
             }
             ItemKind::Fn(.., generics, _)
             | ItemKind::TyAlias(_, generics)
+            | ItemKind::Const(_, generics, _)
             | ItemKind::Enum(_, generics)
             | ItemKind::Struct(_, generics)
             | ItemKind::Union(_, generics) => generics,
@@ -762,6 +763,7 @@ pub(super) fn type_param_predicates(
                 ItemKind::Fn(.., generics, _)
                 | ItemKind::Impl(&hir::Impl { generics, .. })
                 | ItemKind::TyAlias(_, generics)
+                | ItemKind::Const(_, generics, _)
                 | ItemKind::OpaqueTy(&OpaqueTy {
                     generics,
                     origin: hir::OpaqueTyOrigin::TyAlias { .. },
diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
index 5e261f80387..3cc6f574aec 100644
--- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
+++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs
@@ -518,7 +518,6 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
             | hir::ItemKind::Mod(..)
             | hir::ItemKind::ForeignMod { .. }
             | hir::ItemKind::Static(..)
-            | hir::ItemKind::Const(..)
             | hir::ItemKind::GlobalAsm(..) => {
                 // These sorts of items have no lifetime parameters at all.
                 intravisit::walk_item(self, item);
@@ -583,6 +582,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
                 })
             }
             hir::ItemKind::TyAlias(_, generics)
+            | hir::ItemKind::Const(_, generics, _)
             | hir::ItemKind::Enum(_, generics)
             | hir::ItemKind::Struct(_, generics)
             | hir::ItemKind::Union(_, generics)
@@ -590,21 +590,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
             | hir::ItemKind::TraitAlias(generics, ..)
             | hir::ItemKind::Impl(&hir::Impl { generics, .. }) => {
                 // These kinds of items have only early-bound lifetime parameters.
-                let bound_vars = generics.params.iter().map(ResolvedArg::early).collect();
-                self.record_late_bound_vars(item.hir_id(), vec![]);
-                let scope = Scope::Binder {
-                    hir_id: item.hir_id(),
-                    bound_vars,
-                    scope_type: BinderScopeType::Normal,
-                    s: self.scope,
-                    where_bound_origin: None,
-                };
-                self.with(scope, |this| {
-                    let scope = Scope::TraitRefBoundary { s: this.scope };
-                    this.with(scope, |this| {
-                        intravisit::walk_item(this, item);
-                    });
-                });
+                self.visit_early(item.hir_id(), generics, |this| intravisit::walk_item(this, item));
             }
         }
     }
@@ -777,39 +763,24 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
         use self::hir::TraitItemKind::*;
         match trait_item.kind {
             Fn(_, _) => {
-                self.visit_early_late(trait_item.hir_id(), &trait_item.generics, |this| {
+                self.visit_early_late(trait_item.hir_id(), trait_item.generics, |this| {
                     intravisit::walk_trait_item(this, trait_item)
                 });
             }
             Type(bounds, ty) => {
-                let generics = &trait_item.generics;
-                let bound_vars = generics.params.iter().map(ResolvedArg::early).collect();
-                self.record_late_bound_vars(trait_item.hir_id(), vec![]);
-                let scope = Scope::Binder {
-                    hir_id: trait_item.hir_id(),
-                    bound_vars,
-                    s: self.scope,
-                    scope_type: BinderScopeType::Normal,
-                    where_bound_origin: None,
-                };
-                self.with(scope, |this| {
-                    let scope = Scope::TraitRefBoundary { s: this.scope };
-                    this.with(scope, |this| {
-                        this.visit_generics(generics);
-                        for bound in bounds {
-                            this.visit_param_bound(bound);
-                        }
-                        if let Some(ty) = ty {
-                            this.visit_ty(ty);
-                        }
-                    })
-                });
-            }
-            Const(_, _) => {
-                // Only methods and types support generics.
-                assert!(trait_item.generics.params.is_empty());
-                intravisit::walk_trait_item(self, trait_item);
+                self.visit_early(trait_item.hir_id(), trait_item.generics, |this| {
+                    this.visit_generics(&trait_item.generics);
+                    for bound in bounds {
+                        this.visit_param_bound(bound);
+                    }
+                    if let Some(ty) = ty {
+                        this.visit_ty(ty);
+                    }
+                })
             }
+            Const(_, _) => self.visit_early(trait_item.hir_id(), trait_item.generics, |this| {
+                intravisit::walk_trait_item(this, trait_item)
+            }),
         }
     }
 
@@ -817,34 +788,16 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
     fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem<'tcx>) {
         use self::hir::ImplItemKind::*;
         match impl_item.kind {
-            Fn(..) => self.visit_early_late(impl_item.hir_id(), &impl_item.generics, |this| {
+            Fn(..) => self.visit_early_late(impl_item.hir_id(), impl_item.generics, |this| {
+                intravisit::walk_impl_item(this, impl_item)
+            }),
+            Type(ty) => self.visit_early(impl_item.hir_id(), impl_item.generics, |this| {
+                this.visit_generics(impl_item.generics);
+                this.visit_ty(ty);
+            }),
+            Const(_, _) => self.visit_early(impl_item.hir_id(), impl_item.generics, |this| {
                 intravisit::walk_impl_item(this, impl_item)
             }),
-            Type(ty) => {
-                let generics = &impl_item.generics;
-                let bound_vars: FxIndexMap<LocalDefId, ResolvedArg> =
-                    generics.params.iter().map(ResolvedArg::early).collect();
-                self.record_late_bound_vars(impl_item.hir_id(), vec![]);
-                let scope = Scope::Binder {
-                    hir_id: impl_item.hir_id(),
-                    bound_vars,
-                    s: self.scope,
-                    scope_type: BinderScopeType::Normal,
-                    where_bound_origin: None,
-                };
-                self.with(scope, |this| {
-                    let scope = Scope::TraitRefBoundary { s: this.scope };
-                    this.with(scope, |this| {
-                        this.visit_generics(generics);
-                        this.visit_ty(ty);
-                    })
-                });
-            }
-            Const(_, _) => {
-                // Only methods and types support generics.
-                assert!(impl_item.generics.params.is_empty());
-                intravisit::walk_impl_item(self, impl_item);
-            }
         }
     }
 
@@ -1180,6 +1133,25 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
         self.with(scope, walk);
     }
 
+    fn visit_early<F>(&mut self, hir_id: hir::HirId, generics: &'tcx hir::Generics<'tcx>, walk: F)
+    where
+        F: for<'b, 'c> FnOnce(&'b mut BoundVarContext<'c, 'tcx>),
+    {
+        let bound_vars = generics.params.iter().map(ResolvedArg::early).collect();
+        self.record_late_bound_vars(hir_id, vec![]);
+        let scope = Scope::Binder {
+            hir_id,
+            bound_vars,
+            s: self.scope,
+            scope_type: BinderScopeType::Normal,
+            where_bound_origin: None,
+        };
+        self.with(scope, |this| {
+            let scope = Scope::TraitRefBoundary { s: this.scope };
+            this.with(scope, walk)
+        });
+    }
+
     #[instrument(level = "debug", skip(self))]
     fn resolve_lifetime_ref(
         &mut self,
@@ -2040,8 +2012,7 @@ fn is_late_bound_map(
                                             tcx.sess.delay_span_bug(
                                                 *span,
                                                 format!(
-                                                    "Incorrect generic arg count for alias {:?}",
-                                                    alias_def
+                                                    "Incorrect generic arg count for alias {alias_def:?}"
                                                 ),
                                             );
                                             None
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs
index c39edaa1577..2bbdbe3a1f6 100644
--- a/compiler/rustc_hir_analysis/src/collect/type_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs
@@ -156,7 +156,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
             let Some(type_dependent_def) = tables.type_dependent_def_id(parent_node_id) else {
                 return Ty::new_error_with_message(tcx,
                     tcx.def_span(def_id),
-                    format!("unable to find type-dependent def for {:?}", parent_node_id),
+                    format!("unable to find type-dependent def for {parent_node_id:?}"),
                 );
             };
             let idx = segment
@@ -197,14 +197,14 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
                     } else {
                         return Ty::new_error_with_message(tcx,
                             tcx.def_span(def_id),
-                            format!("unable to find const parent for {} in pat {:?}", hir_id, pat),
+                            format!("unable to find const parent for {hir_id} in pat {pat:?}"),
                         );
                     }
                 }
                 _ => {
                     return Ty::new_error_with_message(tcx,
                         tcx.def_span(def_id),
-                        format!("unexpected const parent path {:?}", parent_node),
+                        format!("unexpected const parent path {parent_node:?}"),
                     );
                 }
             };
@@ -404,7 +404,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
                         icx.to_ty(ty)
                     }
                 }
-                ItemKind::Const(ty, body_id) => {
+                ItemKind::Const(ty, _, body_id) => {
                     if is_suggestable_infer_ty(ty) {
                         infer_placeholder_type(
                             tcx, def_id, body_id, ty.span, item.ident, "constant",
@@ -544,7 +544,7 @@ fn infer_placeholder_type<'a>(
                 if let Some(ty) = ty.make_suggestable(tcx, false) {
                     err.span_suggestion(
                         span,
-                        format!("provide a type for the {item}", item = kind),
+                        format!("provide a type for the {kind}"),
                         format!("{colon} {ty}"),
                         Applicability::MachineApplicable,
                     );
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index c2d2e5f7e50..0babdf7e5b3 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -216,7 +216,7 @@ impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
             "parameters",
             self.missing_type_params
                 .iter()
-                .map(|n| format!("`{}`", n))
+                .map(|n| format!("`{n}`"))
                 .collect::<Vec<_>>()
                 .join(", "),
         );
diff --git a/compiler/rustc_hir_analysis/src/hir_wf_check.rs b/compiler/rustc_hir_analysis/src/hir_wf_check.rs
index f1765174d79..ca7679cfba0 100644
--- a/compiler/rustc_hir_analysis/src/hir_wf_check.rs
+++ b/compiler/rustc_hir_analysis/src/hir_wf_check.rs
@@ -130,7 +130,7 @@ fn diagnostic_hir_wf_check<'tcx>(
             hir::Node::Item(item) => match item.kind {
                 hir::ItemKind::TyAlias(ty, _)
                 | hir::ItemKind::Static(ty, _, _)
-                | hir::ItemKind::Const(ty, _) => vec![ty],
+                | hir::ItemKind::Const(ty, _, _) => vec![ty],
                 hir::ItemKind::Impl(impl_) => match &impl_.of_trait {
                     Some(t) => t
                         .path
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check.rs b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
index 62f22bda9f9..4f705eaf10a 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check.rs
@@ -77,8 +77,7 @@ fn enforce_impl_params_are_constrained(tcx: TyCtxt<'_>, impl_def_id: LocalDefId)
         tcx.sess.delay_span_bug(
             tcx.def_span(impl_def_id),
             format!(
-                "potentially unconstrained type parameters weren't evaluated: {:?}",
-                impl_self_ty,
+                "potentially unconstrained type parameters weren't evaluated: {impl_self_ty:?}",
             ),
         );
         return;
@@ -180,7 +179,7 @@ fn report_unused_parameter(tcx: TyCtxt<'_>, span: Span, kind: &str, name: Symbol
         kind,
         name
     );
-    err.span_label(span, format!("unconstrained {} parameter", kind));
+    err.span_label(span, format!("unconstrained {kind} parameter"));
     if kind == "const" {
         err.note(
             "expressions using a const parameter must map each value to a distinct output value",
diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
index 81993789bcf..8b2c93d8fd3 100644
--- a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
+++ b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs
@@ -294,7 +294,7 @@ fn check_duplicate_params<'tcx>(
     if let (_, [duplicate, ..]) = base_params.partition_dedup() {
         let param = impl1_args[duplicate.0 as usize];
         tcx.sess
-            .struct_span_err(span, format!("specializing impl repeats parameter `{}`", param))
+            .struct_span_err(span, format!("specializing impl repeats parameter `{param}`"))
             .emit();
     }
 }
@@ -523,7 +523,7 @@ fn check_specialization_on<'tcx>(tcx: TyCtxt<'tcx>, predicate: ty::Predicate<'tc
         }
         _ => {
             tcx.sess
-                .struct_span_err(span, format!("cannot specialize on predicate `{}`", predicate))
+                .struct_span_err(span, format!("cannot specialize on predicate `{predicate}`"))
                 .emit();
         }
     }
diff --git a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
index 0828fe9e0f2..6be8d72aed2 100644
--- a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
+++ b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
@@ -474,7 +474,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 verb
             )
         } else {
-            format!("missing generics for {} `{}`", def_kind, def_path)
+            format!("missing generics for {def_kind} `{def_path}`")
         }
     }
 
@@ -599,7 +599,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 let span = self.path_segment.ident.span;
 
                 // insert a suggestion of the form "Y<'a, 'b>"
-                let sugg = format!("<{}>", suggested_args);
+                let sugg = format!("<{suggested_args}>");
                 debug!("sugg: {:?}", sugg);
 
                 err.span_suggestion_verbose(
@@ -624,7 +624,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 let sugg_suffix =
                     if is_first && (has_non_lt_args || has_bindings) { ", " } else { "" };
 
-                let sugg = format!("{}{}{}", sugg_prefix, suggested_args, sugg_suffix);
+                let sugg = format!("{sugg_prefix}{suggested_args}{sugg_suffix}");
                 debug!("sugg: {:?}", sugg);
 
                 err.span_suggestion_verbose(sugg_span, msg, sugg, Applicability::HasPlaceholders);
@@ -649,7 +649,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 let span = self.path_segment.ident.span;
 
                 // insert a suggestion of the form "Y<T, U>"
-                let sugg = format!("<{}>", suggested_args);
+                let sugg = format!("<{suggested_args}>");
                 debug!("sugg: {:?}", sugg);
 
                 err.span_suggestion_verbose(
@@ -682,7 +682,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                 let sugg_suffix =
                     if is_first && !self.gen_args.bindings.is_empty() { ", " } else { "" };
 
-                let sugg = format!("{}{}{}", sugg_prefix, suggested_args, sugg_suffix);
+                let sugg = format!("{sugg_prefix}{suggested_args}{sugg_suffix}");
                 debug!("sugg: {:?}", sugg);
 
                 err.span_suggestion_verbose(sugg_span, msg, sugg, Applicability::HasPlaceholders);
@@ -1024,7 +1024,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
                     .collect::<Vec<_>>()
                     .join(", ");
 
-                format!(": {}", params)
+                format!(": {params}")
             };
 
             format!(
diff --git a/compiler/rustc_hir_analysis/src/variance/terms.rs b/compiler/rustc_hir_analysis/src/variance/terms.rs
index 3b286bb9c93..ed03c5da26f 100644
--- a/compiler/rustc_hir_analysis/src/variance/terms.rs
+++ b/compiler/rustc_hir_analysis/src/variance/terms.rs
@@ -32,8 +32,8 @@ pub enum VarianceTerm<'a> {
 impl<'a> fmt::Debug for VarianceTerm<'a> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            ConstantTerm(c1) => write!(f, "{:?}", c1),
-            TransformTerm(v1, v2) => write!(f, "({:?} \u{00D7} {:?})", v1, v2),
+            ConstantTerm(c1) => write!(f, "{c1:?}"),
+            TransformTerm(v1, v2) => write!(f, "({v1:?} \u{00D7} {v2:?})"),
             InferredTerm(id) => write!(f, "[{}]", {
                 let InferredIndex(i) = id;
                 i
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index a699cd6c942..2d8b956771b 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -420,12 +420,13 @@ impl<'a> State<'a> {
     fn print_associated_const(
         &mut self,
         ident: Ident,
+        generics: &hir::Generics<'_>,
         ty: &hir::Ty<'_>,
         default: Option<hir::BodyId>,
     ) {
-        self.head("");
         self.word_space("const");
         self.print_ident(ident);
+        self.print_generic_params(generics.params);
         self.word_space(":");
         self.print_type(ty);
         if let Some(expr) = default {
@@ -433,6 +434,7 @@ impl<'a> State<'a> {
             self.word_space("=");
             self.ann.nested(self, Nested::Body(expr));
         }
+        self.print_where_clause(generics);
         self.word(";")
     }
 
@@ -532,9 +534,10 @@ impl<'a> State<'a> {
                 self.word(";");
                 self.end(); // end the outer cbox
             }
-            hir::ItemKind::Const(ty, expr) => {
+            hir::ItemKind::Const(ty, generics, expr) => {
                 self.head("const");
                 self.print_ident(item.ident);
+                self.print_generic_params(generics.params);
                 self.word_space(":");
                 self.print_type(ty);
                 self.space();
@@ -542,6 +545,7 @@ impl<'a> State<'a> {
 
                 self.word_space("=");
                 self.ann.nested(self, Nested::Body(expr));
+                self.print_where_clause(generics);
                 self.word(";");
                 self.end(); // end the outer cbox
             }
@@ -836,7 +840,7 @@ impl<'a> State<'a> {
         self.print_outer_attributes(self.attrs(ti.hir_id()));
         match ti.kind {
             hir::TraitItemKind::Const(ty, default) => {
-                self.print_associated_const(ti.ident, ty, default);
+                self.print_associated_const(ti.ident, ti.generics, ty, default);
             }
             hir::TraitItemKind::Fn(ref sig, hir::TraitFn::Required(arg_names)) => {
                 self.print_method_sig(ti.ident, sig, ti.generics, arg_names, None);
@@ -865,7 +869,7 @@ impl<'a> State<'a> {
 
         match ii.kind {
             hir::ImplItemKind::Const(ty, expr) => {
-                self.print_associated_const(ii.ident, ty, Some(expr));
+                self.print_associated_const(ii.ident, ii.generics, ty, Some(expr));
             }
             hir::ImplItemKind::Fn(ref sig, body) => {
                 self.head("");
diff --git a/compiler/rustc_hir_typeck/messages.ftl b/compiler/rustc_hir_typeck/messages.ftl
index 3d012a15a67..2281343e250 100644
--- a/compiler/rustc_hir_typeck/messages.ftl
+++ b/compiler/rustc_hir_typeck/messages.ftl
@@ -77,6 +77,10 @@ hir_typeck_note_edition_guide = for more on editions, read https://doc.rust-lang
 
 hir_typeck_op_trait_generic_params = `{$method_name}` must not have any generic parameters
 
+hir_typeck_option_result_asref = use `{$def_path}::as_ref` to convert `{$expected_ty}` to `{$expr_ty}`
+hir_typeck_option_result_cloned = use `{$def_path}::cloned` to clone the value inside the `{$def_path}`
+hir_typeck_option_result_copied = use `{$def_path}::copied` to copy the value inside the `{$def_path}`
+
 hir_typeck_return_stmt_outside_of_fn_body =
     {$statement_kind} statement outside of function body
     .encl_body_label = the {$statement_kind} is part of this body...
diff --git a/compiler/rustc_hir_typeck/src/_match.rs b/compiler/rustc_hir_typeck/src/_match.rs
index 119ed2fa408..d5f03a6aaed 100644
--- a/compiler/rustc_hir_typeck/src/_match.rs
+++ b/compiler/rustc_hir_typeck/src/_match.rs
@@ -558,10 +558,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     {
                         let pred = clause.kind().rebind(match clause.kind().skip_binder() {
                             ty::ClauseKind::Trait(trait_pred) => {
-                                // FIXME(rpitit): This will need to be fixed when we move to associated types
                                 assert!(matches!(
                                     *trait_pred.trait_ref.self_ty().kind(),
-                                    ty::Alias(_, ty::AliasTy { def_id, args: alias_args, .. })
+                                    ty::Alias(ty::Opaque, ty::AliasTy { def_id, args: alias_args, .. })
                                     if def_id == rpit_def_id && args == alias_args
                                 ));
                                 ty::ClauseKind::Trait(trait_pred.with_self_ty(self.tcx, ty))
@@ -569,7 +568,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             ty::ClauseKind::Projection(mut proj_pred) => {
                                 assert!(matches!(
                                     *proj_pred.projection_ty.self_ty().kind(),
-                                    ty::Alias(_, ty::AliasTy { def_id, args: alias_args, .. })
+                                    ty::Alias(ty::Opaque, ty::AliasTy { def_id, args: alias_args, .. })
                                     if def_id == rpit_def_id && args == alias_args
                                 ));
                                 proj_pred = proj_pred.with_self_ty(self.tcx, ty);
diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs
index a1fd09d4050..c68f2d94f35 100644
--- a/compiler/rustc_hir_typeck/src/callee.rs
+++ b/compiler/rustc_hir_typeck/src/callee.rs
@@ -402,7 +402,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             .sess
                             .struct_span_err(
                                 callee_expr.span,
-                                format!("evaluate({:?}) = {:?}", predicate, result),
+                                format!("evaluate({predicate:?}) = {result:?}"),
                             )
                             .span_label(predicate_span, "predicate")
                             .emit();
@@ -531,8 +531,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 return;
             }
 
-            let up_to_rcvr_span = segment.ident.span.until(callee_expr.span);
-            let rest_span = callee_expr.span.shrink_to_hi().to(call_expr.span.shrink_to_hi());
+            let Some(callee_expr_span) = callee_expr.span.find_ancestor_inside(call_expr.span)
+            else {
+                return;
+            };
+            let up_to_rcvr_span = segment.ident.span.until(callee_expr_span);
+            let rest_span = callee_expr_span.shrink_to_hi().to(call_expr.span.shrink_to_hi());
             let rest_snippet = if let Some(first) = rest.first() {
                 self.tcx
                     .sess
diff --git a/compiler/rustc_hir_typeck/src/cast.rs b/compiler/rustc_hir_typeck/src/cast.rs
index af8afcc0f0b..5bc0e2ee86c 100644
--- a/compiler/rustc_hir_typeck/src/cast.rs
+++ b/compiler/rustc_hir_typeck/src/cast.rs
@@ -144,7 +144,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 let reported = self
                     .tcx
                     .sess
-                    .delay_span_bug(span, format!("`{:?}` should be sized but is not?", t));
+                    .delay_span_bug(span, format!("`{t:?}` should be sized but is not?"));
                 return Err(reported);
             }
         })
@@ -644,12 +644,12 @@ impl<'a, 'tcx> CastCheck<'tcx> {
                             err.span_suggestion(
                                 self.cast_span,
                                 "try casting to a reference instead",
-                                format!("&{}{}", mtstr, s),
+                                format!("&{mtstr}{s}"),
                                 Applicability::MachineApplicable,
                             );
                         }
                         Err(_) => {
-                            let msg = format!("did you mean `&{}{}`?", mtstr, tstr);
+                            let msg = format!("did you mean `&{mtstr}{tstr}`?");
                             err.span_help(self.cast_span, msg);
                         }
                     }
diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs
index affeee55e79..0624a4baf79 100644
--- a/compiler/rustc_hir_typeck/src/closure.rs
+++ b/compiler/rustc_hir_typeck/src/closure.rs
@@ -81,7 +81,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         debug!(?bound_sig, ?liberated_sig);
 
-        let mut fcx = FnCtxt::new(self, self.param_env.without_const(), closure.def_id);
+        let mut fcx = FnCtxt::new(self, self.param_env, closure.def_id);
         let generator_types = check_fn(
             &mut fcx,
             liberated_sig,
@@ -723,11 +723,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 .iter_instantiated_copied(self.tcx, args)
                 .find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
             ty::Error(_) => return None,
-            ty::Alias(ty::Projection, proj) if self.tcx.is_impl_trait_in_trait(proj.def_id) => self
-                .tcx
-                .explicit_item_bounds(proj.def_id)
-                .iter_instantiated_copied(self.tcx, proj.args)
-                .find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
             _ => span_bug!(
                 self.tcx.def_span(expr_def_id),
                 "async fn generator return type not an inference variable: {ret_ty}"
diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs
index 56e485a4a3c..4fdfc51bc86 100644
--- a/compiler/rustc_hir_typeck/src/coercion.rs
+++ b/compiler/rustc_hir_typeck/src/coercion.rs
@@ -1797,8 +1797,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
             err.span_note(
                 sp,
                 format!(
-                    "return type inferred to be `{}` here",
-                    expected
+                    "return type inferred to be `{expected}` here"
                 ),
             );
         }
diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs
index 05906a4b9f5..36096aa35d4 100644
--- a/compiler/rustc_hir_typeck/src/errors.rs
+++ b/compiler/rustc_hir_typeck/src/errors.rs
@@ -252,6 +252,45 @@ impl HelpUseLatestEdition {
     }
 }
 
+#[derive(Subdiagnostic)]
+pub enum OptionResultRefMismatch<'tcx> {
+    #[suggestion(
+        hir_typeck_option_result_copied,
+        code = ".copied()",
+        style = "verbose",
+        applicability = "machine-applicable"
+    )]
+    Copied {
+        #[primary_span]
+        span: Span,
+        def_path: String,
+    },
+    #[suggestion(
+        hir_typeck_option_result_cloned,
+        code = ".cloned()",
+        style = "verbose",
+        applicability = "machine-applicable"
+    )]
+    Cloned {
+        #[primary_span]
+        span: Span,
+        def_path: String,
+    },
+    #[suggestion(
+        hir_typeck_option_result_asref,
+        code = ".as_ref()",
+        style = "verbose",
+        applicability = "machine-applicable"
+    )]
+    AsRef {
+        #[primary_span]
+        span: Span,
+        def_path: String,
+        expected_ty: Ty<'tcx>,
+        expr_ty: Ty<'tcx>,
+    },
+}
+
 #[derive(Diagnostic)]
 #[diag(hir_typeck_const_select_must_be_const)]
 #[help]
diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs
index 29488c9011a..8f5737dd4ad 100644
--- a/compiler/rustc_hir_typeck/src/expr.rs
+++ b/compiler/rustc_hir_typeck/src/expr.rs
@@ -1334,7 +1334,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 t_cast,
                 t.span,
                 expr.span,
-                self.param_env.constness(),
+                hir::Constness::NotConst,
             ) {
                 Ok(cast_check) => {
                     debug!(
@@ -1394,7 +1394,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         let Some((
             _,
             hir::Node::Local(hir::Local { ty: Some(ty), .. })
-            | hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, _), .. }),
+            | hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, _, _), .. }),
         )) = parent_node
         else {
             return;
@@ -1428,7 +1428,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         // Create a new function context.
         let def_id = block.def_id;
-        let fcx = FnCtxt::new(self, self.param_env.with_const(), def_id);
+        let fcx = FnCtxt::new(self, self.param_env, def_id);
         crate::GatherLocalsVisitor::new(&fcx).visit_body(body);
 
         let ty = fcx.check_expr_with_expectation(&body.value, expected);
@@ -1890,7 +1890,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         let mut truncated_fields_error = String::new();
         let remaining_fields_names = match &displayable_field_names[..] {
-            [field1] => format!("`{}`", field1),
+            [field1] => format!("`{field1}`"),
             [field1, field2] => format!("`{field1}` and `{field2}`"),
             [field1, field2, field3] => format!("`{field1}`, `{field2}` and `{field3}`"),
             _ => {
@@ -2117,16 +2117,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     );
                 }
                 _ => {
-                    err.span_label(variant_ident_span, format!("`{adt}` defined here", adt = ty));
+                    err.span_label(variant_ident_span, format!("`{ty}` defined here"));
                     err.span_label(field.ident.span, "field does not exist");
                     err.span_suggestion_verbose(
                         expr_span,
-                        format!(
-                            "`{adt}` is a tuple {kind_name}, use the appropriate syntax",
-                            adt = ty,
-                            kind_name = kind_name,
-                        ),
-                        format!("{adt}(/* fields */)", adt = ty),
+                        format!("`{ty}` is a tuple {kind_name}, use the appropriate syntax",),
+                        format!("{ty}(/* fields */)"),
                         Applicability::HasPlaceholders,
                     );
                 }
@@ -2243,7 +2239,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         // dynamic limit, to never omit just one field
         let limit = if names.len() == 6 { 6 } else { 5 };
         let mut display =
-            names.iter().take(limit).map(|n| format!("`{}`", n)).collect::<Vec<_>>().join(", ");
+            names.iter().take(limit).map(|n| format!("`{n}`")).collect::<Vec<_>>().join(", ");
         if names.len() > limit {
             display = format!("{} ... and {} others", display, names.len() - limit);
         }
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
index fa1056e724a..ecafb50f420 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
@@ -61,7 +61,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
                 debug!("warn_if_unreachable: id={:?} span={:?} kind={}", id, span, kind);
 
-                let msg = format!("unreachable {}", kind);
+                let msg = format!("unreachable {kind}");
                 self.tcx().struct_span_lint_hir(
                     lint::builtin::UNREACHABLE_CODE,
                     id,
@@ -134,7 +134,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     }
 
     pub fn tag(&self) -> String {
-        format!("{:p}", self)
+        format!("{self:p}")
     }
 
     pub fn local_ty(&self, span: Span, nid: hir::HirId) -> Ty<'tcx> {
@@ -1412,9 +1412,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     self.tcx.sess.delay_span_bug(
                         span,
                         format!(
-                        "instantiate_value_path: (UFCS) {:?} was a subtype of {:?} but now is not?",
-                        self_ty,
-                        impl_ty,
+                        "instantiate_value_path: (UFCS) {self_ty:?} was a subtype of {impl_ty:?} but now is not?",
                     ),
                     );
                 }
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
index a9610009db1..e102c51c7ee 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
@@ -45,12 +45,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
         debug!("FnCtxt::check_casts: {} deferred checks", deferred_cast_checks.len());
         for cast in deferred_cast_checks.drain(..) {
-            let prev_env = self.param_env;
-            self.param_env = self.param_env.with_constness(cast.constness);
-
             cast.check(self);
-
-            self.param_env = prev_env;
         }
 
         *self.deferred_cast_checks.borrow_mut() = deferred_cast_checks;
@@ -689,7 +684,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         );
                         err.span_label(
                             full_call_span,
-                            format!("arguments to this {} are incorrect", call_name),
+                            format!("arguments to this {call_name} are incorrect"),
                         );
                     } else {
                         err = tcx.sess.struct_span_err_with_code(
@@ -796,10 +791,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 None,
                 None,
             );
-            err.span_label(
-                full_call_span,
-                format!("arguments to this {} are incorrect", call_name),
-            );
+            err.span_label(full_call_span, format!("arguments to this {call_name} are incorrect"));
 
             if let hir::ExprKind::MethodCall(_, rcvr, _, _) = call_expr.kind
                 && provided_idx.as_usize() == expected_idx.as_usize()
@@ -874,7 +866,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             if ty.is_unit() {
                 "()".to_string()
             } else if ty.is_suggestable(tcx, false) {
-                format!("/* {} */", ty)
+                format!("/* {ty} */")
             } else if let Some(fn_def_id) = fn_def_id
                 && self.tcx.def_kind(fn_def_id).is_fn_like()
                 && let self_implicit =
@@ -931,12 +923,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     let (provided_ty, provided_span) = provided_arg_tys[arg_idx];
                     let provided_ty_name = if !has_error_or_infer([provided_ty]) {
                         // FIXME: not suggestable, use something else
-                        format!(" of type `{}`", provided_ty)
+                        format!(" of type `{provided_ty}`")
                     } else {
                         "".to_string()
                     };
-                    labels
-                        .push((provided_span, format!("unexpected argument{}", provided_ty_name)));
+                    labels.push((provided_span, format!("unexpected argument{provided_ty_name}")));
                     let mut span = provided_span;
                     if span.can_be_used_for_suggestions() {
                         if arg_idx.index() > 0
@@ -1009,11 +1000,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                 args_span
                             };
                             let rendered = if !has_error_or_infer([input_ty]) {
-                                format!(" of type `{}`", input_ty)
+                                format!(" of type `{input_ty}`")
                             } else {
                                 "".to_string()
                             };
-                            labels.push((span, format!("an argument{} is missing", rendered)));
+                            labels.push((span, format!("an argument{rendered} is missing")));
                             suggestion_text = match suggestion_text {
                                 SuggestionText::None => SuggestionText::Provide(false),
                                 SuggestionText::Provide(_) => SuggestionText::Provide(true),
@@ -1034,13 +1025,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             let rendered =
                                 if !has_error_or_infer([first_expected_ty, second_expected_ty]) {
                                     format!(
-                                        " of type `{}` and `{}`",
-                                        first_expected_ty, second_expected_ty
+                                        " of type `{first_expected_ty}` and `{second_expected_ty}`"
                                     )
                                 } else {
                                     "".to_string()
                                 };
-                            labels.push((span, format!("two arguments{} are missing", rendered)));
+                            labels.push((span, format!("two arguments{rendered} are missing")));
                             suggestion_text = match suggestion_text {
                                 SuggestionText::None | SuggestionText::Provide(_) => {
                                     SuggestionText::Provide(true)
@@ -1066,13 +1056,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                 third_expected_ty,
                             ]) {
                                 format!(
-                                    " of type `{}`, `{}`, and `{}`",
-                                    first_expected_ty, second_expected_ty, third_expected_ty
+                                    " of type `{first_expected_ty}`, `{second_expected_ty}`, and `{third_expected_ty}`"
                                 )
                             } else {
                                 "".to_string()
                             };
-                            labels.push((span, format!("three arguments{} are missing", rendered)));
+                            labels.push((span, format!("three arguments{rendered} are missing")));
                             suggestion_text = match suggestion_text {
                                 SuggestionText::None | SuggestionText::Provide(_) => {
                                     SuggestionText::Provide(true)
@@ -1113,25 +1102,25 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     let (first_provided_ty, first_span) = provided_arg_tys[first_provided_idx];
                     let (_, first_expected_ty) = formal_and_expected_inputs[first_expected_idx];
                     let first_provided_ty_name = if !has_error_or_infer([first_provided_ty]) {
-                        format!(", found `{}`", first_provided_ty)
+                        format!(", found `{first_provided_ty}`")
                     } else {
                         String::new()
                     };
                     labels.push((
                         first_span,
-                        format!("expected `{}`{}", first_expected_ty, first_provided_ty_name),
+                        format!("expected `{first_expected_ty}`{first_provided_ty_name}"),
                     ));
 
                     let (second_provided_ty, second_span) = provided_arg_tys[second_provided_idx];
                     let (_, second_expected_ty) = formal_and_expected_inputs[second_expected_idx];
                     let second_provided_ty_name = if !has_error_or_infer([second_provided_ty]) {
-                        format!(", found `{}`", second_provided_ty)
+                        format!(", found `{second_provided_ty}`")
                     } else {
                         String::new()
                     };
                     labels.push((
                         second_span,
-                        format!("expected `{}`{}", second_expected_ty, second_provided_ty_name),
+                        format!("expected `{second_expected_ty}`{second_provided_ty_name}"),
                     ));
 
                     suggestion_text = match suggestion_text {
@@ -1144,13 +1133,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         let (_, expected_ty) = formal_and_expected_inputs[dst_arg];
                         let (provided_ty, provided_span) = provided_arg_tys[dest_input];
                         let provided_ty_name = if !has_error_or_infer([provided_ty]) {
-                            format!(", found `{}`", provided_ty)
+                            format!(", found `{provided_ty}`")
                         } else {
                             String::new()
                         };
                         labels.push((
                             provided_span,
-                            format!("expected `{}`{}", expected_ty, provided_ty_name),
+                            format!("expected `{expected_ty}`{provided_ty_name}"),
                         ));
                     }
 
@@ -2031,7 +2020,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             } else {
                 ("closure", self.tcx.def_span(def_id))
             };
-            err.span_note(span, format!("{} defined here", kind));
+            err.span_note(span, format!("{kind} defined here"));
         } else {
             err.span_note(
                 self.tcx.def_span(def_id),
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
index 4a1cbaceaf7..c49e4381897 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
@@ -1,8 +1,6 @@
 use super::FnCtxt;
 
-use crate::errors::{
-    AddReturnTypeSuggestion, ExpectedReturnTypeLabel, SuggestBoxing, SuggestConvertViaMethod,
-};
+use crate::errors;
 use crate::fluent_generated as fluent;
 use crate::method::probe::{IsSuggestion, Mode, ProbeScope};
 use rustc_ast::util::parser::{ExprPrecedence, PREC_POSTFIX};
@@ -397,7 +395,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     let struct_pat_shorthand_field =
                         self.tcx.hir().maybe_get_struct_pattern_shorthand_field(expr);
                     if let Some(name) = struct_pat_shorthand_field {
-                        sugg.insert(0, (expr.span.shrink_to_lo(), format!("{}: ", name)));
+                        sugg.insert(0, (expr.span.shrink_to_lo(), format!("{name}: ")));
                     }
                     Some(sugg)
                 })
@@ -434,7 +432,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             // FIXME: This could/should be extended to suggest `as_mut` and `as_deref_mut`,
             // but those checks need to be a bit more delicate and the benefit is diminishing.
             if self.can_eq(self.param_env, found_ty_inner, peeled) && error_tys_equate_as_ref {
-                err.subdiagnostic(SuggestConvertViaMethod {
+                err.subdiagnostic(errors::SuggestConvertViaMethod {
                     span: expr.span.shrink_to_hi(),
                     sugg: ".as_ref()",
                     expected,
@@ -447,7 +445,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 && self.can_eq(self.param_env, deref_ty, peeled)
                 && error_tys_equate_as_ref
             {
-                err.subdiagnostic(SuggestConvertViaMethod {
+                err.subdiagnostic(errors::SuggestConvertViaMethod {
                     span: expr.span.shrink_to_hi(),
                     sugg: ".as_deref()",
                     expected,
@@ -521,7 +519,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         if self.can_coerce(Ty::new_box(self.tcx, found), expected) {
             let suggest_boxing = match found.kind() {
                 ty::Tuple(tuple) if tuple.is_empty() => {
-                    SuggestBoxing::Unit { start: span.shrink_to_lo(), end: span }
+                    errors::SuggestBoxing::Unit { start: span.shrink_to_lo(), end: span }
                 }
                 ty::Generator(def_id, ..)
                     if matches!(
@@ -529,9 +527,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         Some(GeneratorKind::Async(AsyncGeneratorKind::Closure))
                     ) =>
                 {
-                    SuggestBoxing::AsyncBody
+                    errors::SuggestBoxing::AsyncBody
                 }
-                _ => SuggestBoxing::Other { start: span.shrink_to_lo(), end: span.shrink_to_hi() },
+                _ => errors::SuggestBoxing::Other {
+                    start: span.shrink_to_lo(),
+                    end: span.shrink_to_hi(),
+                },
             };
             err.subdiagnostic(suggest_boxing);
 
@@ -558,7 +559,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     .take(4)
                     .map(|(var_hir_id, upvar)| {
                         let var_name = self.tcx.hir().name(*var_hir_id).to_string();
-                        let msg = format!("`{}` captured here", var_name);
+                        let msg = format!("`{var_name}` captured here");
                         (upvar.span, msg)
                     })
                     .collect::<Vec<_>>();
@@ -756,23 +757,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         match &fn_decl.output {
             &hir::FnRetTy::DefaultReturn(span) if expected.is_unit() && !can_suggest => {
                 // `fn main()` must return `()`, do not suggest changing return type
-                err.subdiagnostic(ExpectedReturnTypeLabel::Unit { span });
+                err.subdiagnostic(errors::ExpectedReturnTypeLabel::Unit { span });
                 return true;
             }
             &hir::FnRetTy::DefaultReturn(span) if expected.is_unit() => {
                 if let Some(found) = found.make_suggestable(self.tcx, false) {
-                    err.subdiagnostic(AddReturnTypeSuggestion::Add { span, found: found.to_string() });
+                    err.subdiagnostic(errors::AddReturnTypeSuggestion::Add { span, found: found.to_string() });
                     return true;
                 } else if let ty::Closure(_, args) = found.kind()
                     // FIXME(compiler-errors): Get better at printing binders...
                     && let closure = args.as_closure()
                     && closure.sig().is_suggestable(self.tcx, false)
                 {
-                    err.subdiagnostic(AddReturnTypeSuggestion::Add { span, found: closure.print_as_impl_trait().to_string() });
+                    err.subdiagnostic(errors::AddReturnTypeSuggestion::Add { span, found: closure.print_as_impl_trait().to_string() });
                     return true;
                 } else {
                     // FIXME: if `found` could be `impl Iterator` we should suggest that.
-                    err.subdiagnostic(AddReturnTypeSuggestion::MissingHere { span });
+                    err.subdiagnostic(errors::AddReturnTypeSuggestion::MissingHere { span });
                     return true
                 }
             }
@@ -794,10 +795,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     debug!(?found);
                     if found.is_suggestable(self.tcx, false) {
                         if term.span.is_empty() {
-                            err.subdiagnostic(AddReturnTypeSuggestion::Add { span, found: found.to_string() });
+                            err.subdiagnostic(errors::AddReturnTypeSuggestion::Add { span, found: found.to_string() });
                             return true;
                         } else {
-                            err.subdiagnostic(ExpectedReturnTypeLabel::Other { span, expected });
+                            err.subdiagnostic(errors::ExpectedReturnTypeLabel::Other { span, expected });
                         }
                     }
                 }
@@ -813,7 +814,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 let ty = self.normalize(span, ty);
                 let ty = self.tcx.erase_late_bound_regions(ty);
                 if self.can_coerce(expected, ty) {
-                    err.subdiagnostic(ExpectedReturnTypeLabel::Other { span, expected });
+                    err.subdiagnostic(errors::ExpectedReturnTypeLabel::Other { span, expected });
                     self.try_suggest_return_impl_trait(err, expected, ty, fn_id);
                     return true;
                 }
@@ -931,7 +932,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         err.span_suggestion(
             fn_return.span(),
             "consider using an impl return type",
-            format!("impl {}", all_bounds_str),
+            format!("impl {all_bounds_str}"),
             Applicability::MaybeIncorrect,
         );
     }
@@ -1070,7 +1071,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 .must_apply_modulo_regions()
           {
             let suggestion = match self.tcx.hir().maybe_get_struct_pattern_shorthand_field(expr) {
-                Some(ident) => format!(": {}.clone()", ident),
+                Some(ident) => format!(": {ident}.clone()"),
                 None => ".clone()".to_string()
             };
 
@@ -1103,65 +1104,46 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             return false;
         }
 
-        let mut suggest_copied_cloned_or_as_ref = || {
+        if Some(adt_def.did()) == self.tcx.get_diagnostic_item(sym::Result)
+            && self.can_eq(self.param_env, args.type_at(1), expected_args.type_at(1))
+            || Some(adt_def.did()) == self.tcx.get_diagnostic_item(sym::Option)
+        {
             let expr_inner_ty = args.type_at(0);
             let expected_inner_ty = expected_args.type_at(0);
-            if let &ty::Ref(_, ty, hir::Mutability::Not) = expr_inner_ty.kind()
-                && self.can_eq(self.param_env, ty, expected_inner_ty)
-            {
-                let def_path = self.tcx.def_path_str(adt_def.did());
-                if self.type_is_copy_modulo_regions(self.param_env, ty) {
-                    diag.span_suggestion_verbose(
-                        expr.span.shrink_to_hi(),
-                        format!(
-                            "use `{def_path}::copied` to copy the value inside the `{def_path}`"
-                        ),
-                        ".copied()",
-                        Applicability::MachineApplicable,
-                    );
-                    return true;
-                } else if let Some(expected_ty_expr) = expected_ty_expr {
-                    diag.span_suggestion_verbose(
-                        expected_ty_expr.span.shrink_to_hi(),
-                        format!(
-                            "use `{def_path}::as_ref()` to convert `{expected_ty}` to `{expr_ty}`"
-                        ),
-                        ".as_ref()",
-                        Applicability::MachineApplicable,
-                    );
-                    return true;
-                } else if let Some(clone_did) = self.tcx.lang_items().clone_trait()
-                    && rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions(
-                        self,
-                        self.param_env,
-                        ty,
-                        clone_did,
-                    )
+            if let &ty::Ref(_, ty, mutability) = expr_inner_ty.kind()
+                    && self.can_eq(self.param_env, ty, expected_inner_ty)
                 {
-                    diag.span_suggestion_verbose(
-                        expr.span.shrink_to_hi(),
-                        format!(
-                            "use `{def_path}::cloned` to clone the value inside the `{def_path}`"
-                        ),
-                        ".cloned()",
-                        Applicability::MachineApplicable,
-                    );
+                    let def_path = self.tcx.def_path_str(adt_def.did());
+                    let span = expr.span.shrink_to_hi();
+                    let subdiag = if self.type_is_copy_modulo_regions(self.param_env, ty) {
+                        errors::OptionResultRefMismatch::Copied {
+                            span, def_path
+                        }
+                    } else if let Some(expected_ty_expr) = expected_ty_expr
+                            // FIXME: suggest changes to both expressions to convert both to
+                            // Option/Result<&T>
+                            && mutability.is_not()
+                        {
+                        errors::OptionResultRefMismatch::AsRef {
+                            span: expected_ty_expr.span.shrink_to_hi(), expected_ty, expr_ty, def_path
+                        }
+                    } else if let Some(clone_did) = self.tcx.lang_items().clone_trait()
+                        && rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions(
+                            self,
+                            self.param_env,
+                            ty,
+                            clone_did,
+                        )
+                    {
+                        errors::OptionResultRefMismatch::Cloned {
+                            span, def_path
+                        }
+                    } else {
+                        return false;
+                    };
+                    diag.subdiagnostic(subdiag);
                     return true;
                 }
-            }
-            false
-        };
-
-        if let Some(result_did) = self.tcx.get_diagnostic_item(sym::Result)
-            && adt_def.did() == result_did
-            // Check that the error types are equal
-            && self.can_eq(self.param_env, args.type_at(1), expected_args.type_at(1))
-        {
-            return suggest_copied_cloned_or_as_ref();
-        } else if let Some(option_did) = self.tcx.get_diagnostic_item(sym::Option)
-            && adt_def.did() == option_did
-        {
-            return suggest_copied_cloned_or_as_ref();
         }
 
         false
@@ -1259,7 +1241,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         }
 
         let suggestion = match self.tcx.hir().maybe_get_struct_pattern_shorthand_field(expr) {
-            Some(ident) => format!(": {}.is_some()", ident),
+            Some(ident) => format!(": {ident}.is_some()"),
             None => ".is_some()".to_string(),
         };
 
diff --git a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs
index b059db23bb4..cfedcee9956 100644
--- a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs
+++ b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/cfg_build.rs
@@ -443,9 +443,9 @@ impl<'a, 'tcx> Visitor<'tcx> for DropRangeVisitor<'a, 'tcx> {
                 // We add an edge to the hir_id of the expression/block we are breaking out of, and
                 // then in process_deferred_edges we will map this hir_id to its PostOrderId, which
                 // will refer to the end of the block due to the post order traversal.
-                self.find_target_expression_from_destination(destination).map_or((), |target| {
+                if let Ok(target) = self.find_target_expression_from_destination(destination) {
                     self.drop_ranges.add_control_edge_hir_id(self.expr_index, target)
-                });
+                }
 
                 if let Some(value) = value {
                     self.visit_expr(value);
diff --git a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/mod.rs b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/mod.rs
index e01dcf83a38..e563bd40b65 100644
--- a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/mod.rs
+++ b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/mod.rs
@@ -125,8 +125,8 @@ impl Debug for TrackedValue {
                 write!(f, "{}", tcx.hir().node_to_string(self.hir_id()))
             } else {
                 match self {
-                    Self::Variable(hir_id) => write!(f, "Variable({:?})", hir_id),
-                    Self::Temporary(hir_id) => write!(f, "Temporary({:?})", hir_id),
+                    Self::Variable(hir_id) => write!(f, "Variable({hir_id:?})"),
+                    Self::Temporary(hir_id) => write!(f, "Temporary({hir_id:?})"),
                 }
             }
         })
diff --git a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs
index 50a3bbf49d5..29413f08012 100644
--- a/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs
+++ b/compiler/rustc_hir_typeck/src/generator_interior/drop_ranges/record_consumed_borrow.rs
@@ -150,9 +150,10 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
             hir.node_to_string(diag_expr_id),
             hir.node_to_string(parent)
         );
-        place_with_id
-            .try_into()
-            .map_or((), |tracked_value| self.mark_consumed(parent, tracked_value));
+
+        if let Ok(tracked_value) = place_with_id.try_into() {
+            self.mark_consumed(parent, tracked_value)
+        }
     }
 
     fn borrow(
diff --git a/compiler/rustc_hir_typeck/src/generator_interior/mod.rs b/compiler/rustc_hir_typeck/src/generator_interior/mod.rs
index 86ea092bc40..6a817122491 100644
--- a/compiler/rustc_hir_typeck/src/generator_interior/mod.rs
+++ b/compiler/rustc_hir_typeck/src/generator_interior/mod.rs
@@ -112,7 +112,7 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {
                     self.fcx
                         .tcx
                         .sess
-                        .delay_span_bug(span, format!("Encountered var {:?}", unresolved_term));
+                        .delay_span_bug(span, format!("Encountered var {unresolved_term:?}"));
                 } else {
                     let note = format!(
                         "the type is part of the {} because of this {}",
diff --git a/compiler/rustc_hir_typeck/src/intrinsicck.rs b/compiler/rustc_hir_typeck/src/intrinsicck.rs
index 2d85451c9e1..4e65182f158 100644
--- a/compiler/rustc_hir_typeck/src/intrinsicck.rs
+++ b/compiler/rustc_hir_typeck/src/intrinsicck.rs
@@ -85,7 +85,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             Ok(SizeSkeleton::Pointer { tail, .. }) => format!("pointer to `{tail}`"),
             Ok(SizeSkeleton::Known(size)) => {
                 if let Some(v) = u128::from(size.bytes()).checked_mul(8) {
-                    format!("{} bits", v)
+                    format!("{v} bits")
                 } else {
                     // `u128` should definitely be able to hold the size of different architectures
                     // larger sizes should be reported as error `are too big for the current architecture`
@@ -122,14 +122,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         } else {
             err.note(format!("source type: `{}` ({})", from, skeleton_string(from, sk_from)))
                 .note(format!("target type: `{}` ({})", to, skeleton_string(to, sk_to)));
-            let mut should_delay_as_bug = false;
-            if let Err(LayoutError::Unknown(bad_from)) = sk_from && bad_from.references_error() {
-                should_delay_as_bug = true;
-            }
-            if let Err(LayoutError::Unknown(bad_to)) = sk_to && bad_to.references_error() {
-                should_delay_as_bug = true;
-            }
-            if should_delay_as_bug {
+            if let Err(LayoutError::ReferencesError(_)) = sk_from {
+                err.delay_as_bug();
+            } else if let Err(LayoutError::ReferencesError(_)) = sk_to {
                 err.delay_as_bug();
             }
         }
diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs
index 28e7f290737..c4d3cbc9faa 100644
--- a/compiler/rustc_hir_typeck/src/lib.rs
+++ b/compiler/rustc_hir_typeck/src/lib.rs
@@ -71,7 +71,7 @@ use rustc_middle::traits;
 use rustc_middle::ty::{self, Ty, TyCtxt};
 use rustc_session::config;
 use rustc_span::def_id::{DefId, LocalDefId};
-use rustc_span::{sym, Span};
+use rustc_span::Span;
 
 fluent_messages! { "../messages.ftl" }
 
@@ -101,7 +101,7 @@ fn primary_body_of(
 ) -> Option<(hir::BodyId, Option<&hir::Ty<'_>>, Option<&hir::FnSig<'_>>)> {
     match node {
         Node::Item(item) => match item.kind {
-            hir::ItemKind::Const(ty, body) | hir::ItemKind::Static(ty, _, body) => {
+            hir::ItemKind::Const(ty, _, body) | hir::ItemKind::Static(ty, _, body) => {
                 Some((body, Some(ty), None))
             }
             hir::ItemKind::Fn(ref sig, .., body) => Some((body, None, Some(sig))),
@@ -182,11 +182,7 @@ fn typeck_with_fallback<'tcx>(
     let body = tcx.hir().body(body_id);
 
     let param_env = tcx.param_env(def_id);
-    let param_env = if tcx.has_attr(def_id, sym::rustc_do_not_const_check) {
-        param_env.without_const()
-    } else {
-        param_env
-    };
+
     let inh = Inherited::new(tcx, def_id);
     let mut fcx = FnCtxt::new(&inh, param_env, def_id);
 
@@ -263,11 +259,7 @@ fn typeck_with_fallback<'tcx>(
 
     // Closure and generator analysis may run after fallback
     // because they don't constrain other type variables.
-    // Closure analysis only runs on closures. Therefore they only need to fulfill non-const predicates (as of now)
-    let prev_constness = fcx.param_env.constness();
-    fcx.param_env = fcx.param_env.without_const();
     fcx.closure_analyze(body);
-    fcx.param_env = fcx.param_env.with_constness(prev_constness);
     assert!(fcx.deferred_call_resolutions.borrow().is_empty());
     // Before the generator analysis, temporary scopes shall be marked to provide more
     // precise information on types to be captured.
diff --git a/compiler/rustc_hir_typeck/src/method/confirm.rs b/compiler/rustc_hir_typeck/src/method/confirm.rs
index 6835782b5bd..7c73f6a89cd 100644
--- a/compiler/rustc_hir_typeck/src/method/confirm.rs
+++ b/compiler/rustc_hir_typeck/src/method/confirm.rs
@@ -225,7 +225,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
                         assert!(mutbl.is_mut());
                         Ty::new_ptr(self.tcx, ty::TypeAndMut { mutbl: hir::Mutability::Not, ty })
                     }
-                    other => panic!("Cannot adjust receiver type {:?} to const ptr", other),
+                    other => panic!("Cannot adjust receiver type {other:?} to const ptr"),
                 };
 
                 adjustments.push(Adjustment {
@@ -262,8 +262,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
                 let impl_def_id = pick.item.container_id(self.tcx);
                 assert!(
                     self.tcx.impl_trait_ref(impl_def_id).is_none(),
-                    "impl {:?} is not an inherent impl",
-                    impl_def_id
+                    "impl {impl_def_id:?} is not an inherent impl"
                 );
                 self.fresh_args_for_item(self.span, impl_def_id)
             }
diff --git a/compiler/rustc_hir_typeck/src/method/prelude2021.rs b/compiler/rustc_hir_typeck/src/method/prelude2021.rs
index 4efe95c4dc5..5b19a4c525f 100644
--- a/compiler/rustc_hir_typeck/src/method/prelude2021.rs
+++ b/compiler/rustc_hir_typeck/src/method/prelude2021.rs
@@ -97,28 +97,28 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         let self_adjusted = if let Some(probe::AutorefOrPtrAdjustment::ToConstPtr) =
                             pick.autoref_or_ptr_adjustment
                         {
-                            format!("{}{} as *const _", derefs, self_expr)
+                            format!("{derefs}{self_expr} as *const _")
                         } else {
-                            format!("{}{}{}", autoref, derefs, self_expr)
+                            format!("{autoref}{derefs}{self_expr}")
                         };
 
                         lint.span_suggestion(
                             sp,
                             "disambiguate the method call",
-                            format!("({})", self_adjusted),
+                            format!("({self_adjusted})"),
                             Applicability::MachineApplicable,
                         );
                     } else {
                         let self_adjusted = if let Some(probe::AutorefOrPtrAdjustment::ToConstPtr) =
                             pick.autoref_or_ptr_adjustment
                         {
-                            format!("{}(...) as *const _", derefs)
+                            format!("{derefs}(...) as *const _")
                         } else {
-                            format!("{}{}...", autoref, derefs)
+                            format!("{autoref}{derefs}...")
                         };
                         lint.span_help(
                             sp,
-                            format!("disambiguate the method call with `({})`", self_adjusted,),
+                            format!("disambiguate the method call with `({self_adjusted})`",),
                         );
                     }
 
@@ -168,7 +168,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                     .ok())
                                 {
                                     // Keep turbofish.
-                                    format!("::{}", args)
+                                    format!("::{args}")
                                 } else {
                                     String::new()
                                 },
@@ -347,7 +347,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 // Glob import, so just use its name.
                 return None;
             } else {
-                return Some(format!("{}", any_id));
+                return Some(format!("{any_id}"));
             }
         }
 
@@ -396,9 +396,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         let adjusted_text = if let Some(probe::AutorefOrPtrAdjustment::ToConstPtr) =
             pick.autoref_or_ptr_adjustment
         {
-            format!("{}{} as *const _", derefs, expr_text)
+            format!("{derefs}{expr_text} as *const _")
         } else {
-            format!("{}{}{}", autoref, derefs, expr_text)
+            format!("{autoref}{derefs}{expr_text}")
         };
 
         (adjusted_text, precise)
diff --git a/compiler/rustc_hir_typeck/src/method/suggest.rs b/compiler/rustc_hir_typeck/src/method/suggest.rs
index 3d7187cb16f..f6c07931023 100644
--- a/compiler/rustc_hir_typeck/src/method/suggest.rs
+++ b/compiler/rustc_hir_typeck/src/method/suggest.rs
@@ -153,7 +153,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     E0034,
                     "multiple applicable items in scope"
                 );
-                err.span_label(item_name.span, format!("multiple `{}` found", item_name));
+                err.span_label(item_name.span, format!("multiple `{item_name}` found"));
 
                 self.note_candidates_on_method_error(
                     rcvr_ty,
@@ -177,13 +177,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     kind,
                     item_name
                 );
-                err.span_label(item_name.span, format!("private {}", kind));
+                err.span_label(item_name.span, format!("private {kind}"));
                 let sp = self
                     .tcx
                     .hir()
                     .span_if_local(def_id)
                     .unwrap_or_else(|| self.tcx.def_span(def_id));
-                err.span_label(sp, format!("private {} defined here", kind));
+                err.span_label(sp, format!("private {kind} defined here"));
                 self.suggest_valid_traits(&mut err, out_of_scope_traits);
                 err.emit();
             }
@@ -218,7 +218,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             *region,
                             ty::TypeAndMut { ty: *t_type, mutbl: mutability.invert() },
                         );
-                        let msg = format!("you need `{}` instead of `{}`", trait_type, rcvr_ty);
+                        let msg = format!("you need `{trait_type}` instead of `{rcvr_ty}`");
                         let mut kind = &self_expr.kind;
                         while let hir::ExprKind::AddrOf(_, _, expr)
                         | hir::ExprKind::Unary(hir::UnOp::Deref, expr) = kind
@@ -637,7 +637,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     }
                     // Point at the closure that couldn't satisfy the bound.
                     ty::Closure(def_id, _) => bound_spans
-                        .push((tcx.def_span(*def_id), format!("doesn't satisfy `{}`", quiet))),
+                        .push((tcx.def_span(*def_id), format!("doesn't satisfy `{quiet}`"))),
                     _ => {}
                 }
             };
@@ -659,7 +659,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
                         let term = pred.skip_binder().term;
 
-                        let obligation = format!("{} = {}", projection_ty, term);
+                        let obligation = format!("{projection_ty} = {term}");
                         let quiet = with_forced_trimmed_paths!(format!(
                             "{} = {}",
                             quiet_projection_ty, term
@@ -672,7 +672,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         let p = poly_trait_ref.trait_ref;
                         let self_ty = p.self_ty();
                         let path = p.print_only_trait_path();
-                        let obligation = format!("{}: {}", self_ty, path);
+                        let obligation = format!("{self_ty}: {path}");
                         let quiet = with_forced_trimmed_paths!(format!("_: {}", path));
                         bound_span_label(self_ty, &obligation, &quiet);
                         Some((obligation, self_ty))
@@ -825,12 +825,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 let mut preds: Vec<_> = predicates
                     .iter()
                     .filter_map(|pred| format_pred(**pred))
-                    .map(|(p, _)| format!("`{}`", p))
+                    .map(|(p, _)| format!("`{p}`"))
                     .collect();
                 preds.sort();
                 preds.dedup();
                 let msg = if let [pred] = &preds[..] {
-                    format!("trait bound {} was not satisfied", pred)
+                    format!("trait bound {pred} was not satisfied")
                 } else {
                     format!("the following trait bounds were not satisfied:\n{}", preds.join("\n"),)
                 };
@@ -875,7 +875,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                                 suggested_bounds.insert(pred);
                                             }
                                         }
-                                        format!("`{}`\nwhich is required by `{}`", p, parent_p)
+                                        format!("`{p}`\nwhich is required by `{parent_p}`")
                                     }
                                 },
                             },
@@ -1034,8 +1034,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             "".to_string()
                         };
                         err.note(format!(
-                            "the {item_kind} was found for\n{}{}",
-                            type_candidates, additional_types
+                            "the {item_kind} was found for\n{type_candidates}{additional_types}"
                         ));
                     } else {
                         'outer: for inherent_impl_did in self.tcx.inherent_impls(adt.did()) {
@@ -1249,8 +1248,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     } else {
                         (
                             format!(
-                                "the candidate is defined in an impl{} for the type `{}`",
-                                insertion, impl_ty,
+                                "the candidate is defined in an impl{insertion} for the type `{impl_ty}`",
                             ),
                             None,
                         )
@@ -1452,11 +1450,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             err.span_suggestion(
                 sugg_span,
                 "use associated function syntax instead",
-                format!("{}::{}{}", ty_str, item_name, args),
+                format!("{ty_str}::{item_name}{args}"),
                 applicability,
             );
         } else {
-            err.help(format!("try with `{}::{}`", ty_str, item_name,));
+            err.help(format!("try with `{ty_str}::{item_name}`",));
         }
     }
 
@@ -1491,9 +1489,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     let expr_span = expr.span.to(item_name.span);
                     err.multipart_suggestion(
                         format!(
-                            "to call the function stored in `{}`, \
+                            "to call the function stored in `{item_name}`, \
                                          surround the field access with parentheses",
-                            item_name,
                         ),
                         vec![
                             (expr_span.shrink_to_lo(), '('.to_string()),
@@ -1516,7 +1513,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             }
 
             let field_kind = if is_accessible { "field" } else { "private field" };
-            err.span_label(item_name.span, format!("{}, not a method", field_kind));
+            err.span_label(item_name.span, format!("{field_kind}, not a method"));
             return true;
         }
         false
@@ -1669,8 +1666,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         lit.span,
                         format!(
                             "you must specify a concrete type for this numeric value, \
-                                         like `{}`",
-                            concrete_type
+                                         like `{concrete_type}`"
                         ),
                         format!("{snippet}_{concrete_type}"),
                         Applicability::MaybeIncorrect,
@@ -1685,8 +1681,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         let parent_node =
                             self.tcx.hir().get_parent(hir_id);
                         let msg = format!(
-                            "you must specify a type for this binding, like `{}`",
-                            concrete_type,
+                            "you must specify a type for this binding, like `{concrete_type}`",
                         );
 
                         match (filename, parent_node) {
@@ -2194,7 +2189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             if let Some((last_self_name, _, ref mut last_trait_names)) = derives_grouped.last_mut()
             {
                 if last_self_name == &self_name {
-                    last_trait_names.push_str(format!(", {}", trait_name).as_str());
+                    last_trait_names.push_str(format!(", {trait_name}").as_str());
                     continue;
                 }
             }
@@ -2226,8 +2221,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         for (self_name, self_span, traits) in &derives_grouped {
             err.span_suggestion_verbose(
                 self_span.shrink_to_lo(),
-                format!("consider annotating `{}` with `#[derive({})]`", self_name, traits),
-                format!("#[derive({})]\n", traits),
+                format!("consider annotating `{self_name}` with `#[derive({traits})]`"),
+                format!("#[derive({traits})]\n"),
                 Applicability::MaybeIncorrect,
             );
         }
@@ -2475,7 +2470,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         if pick.autoderefs == 0 && !skip {
                             err.span_label(
                                 pick.item.ident(self.tcx).span,
-                                format!("the method is available for `{}` here", rcvr_ty),
+                                format!("the method is available for `{rcvr_ty}` here"),
                             );
                         }
                         break;
@@ -2521,13 +2516,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         if pick.autoderefs == 0 && !skip {
                             err.span_label(
                                 pick.item.ident(self.tcx).span,
-                                format!("the method is available for `{}` here", new_rcvr_t),
+                                format!("the method is available for `{new_rcvr_t}` here"),
                             );
                             err.multipart_suggestion(
                                 "consider wrapping the receiver expression with the \
                                     appropriate type",
                                 vec![
-                                    (rcvr.span.shrink_to_lo(), format!("{}({}", pre, post)),
+                                    (rcvr.span.shrink_to_lo(), format!("{pre}({post}")),
                                     (rcvr.span.shrink_to_hi(), ")".to_string()),
                                 ],
                                 Applicability::MaybeIncorrect,
@@ -2767,7 +2762,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             };
                             err.span_suggestions(
                                 sp,
-                                message(format!("add {} supertrait for", article)),
+                                message(format!("add {article} supertrait for")),
                                 candidates.iter().map(|t| {
                                     format!("{} {}", sep, self.tcx.def_path_str(t.def_id),)
                                 }),
@@ -2836,7 +2831,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 trait_infos => {
                     let mut msg = message(param_type.map_or_else(
                         || "implement".to_string(), // FIXME: it might only need to be imported into scope, not implemented.
-                        |param| format!("restrict type parameter `{}` with", param),
+                        |param| format!("restrict type parameter `{param}` with"),
                     ));
                     for (i, trait_info) in trait_infos.iter().enumerate() {
                         msg.push_str(&format!(
@@ -2860,8 +2855,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 }
                 trait_infos => {
                     let mut msg = format!(
-                        "the following traits define an item `{}`, but are explicitly unimplemented:",
-                        item_name
+                        "the following traits define an item `{item_name}`, but are explicitly unimplemented:"
                     );
                     for trait_info in trait_infos {
                         msg.push_str(&format!("\n{}", self.tcx.def_path_str(trait_info.def_id)));
@@ -3027,13 +3021,13 @@ fn print_disambiguation_help<'tcx>(
                 .join(", "),
         );
         let trait_name = if !fn_has_self_parameter {
-            format!("<{} as {}>", rcvr_ty, trait_name)
+            format!("<{rcvr_ty} as {trait_name}>")
         } else {
             trait_name
         };
-        (span, format!("{}::{}{}", trait_name, item_name, args))
+        (span, format!("{trait_name}::{item_name}{args}"))
     } else {
-        (span.with_hi(item_name.span.lo()), format!("<{} as {}>::", rcvr_ty, trait_name))
+        (span.with_hi(item_name.span.lo()), format!("<{rcvr_ty} as {trait_name}>::"))
     };
     err.span_suggestion_verbose(
         span,
@@ -3041,7 +3035,7 @@ fn print_disambiguation_help<'tcx>(
             "disambiguate the {} for {}",
             def_kind_descr,
             if let Some(candidate) = candidate {
-                format!("candidate #{}", candidate)
+                format!("candidate #{candidate}")
             } else {
                 "the candidate".to_string()
             },
diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs
index 8bf95d4bf9a..d8eb8c71b5e 100644
--- a/compiler/rustc_hir_typeck/src/pat.rs
+++ b/compiler/rustc_hir_typeck/src/pat.rs
@@ -516,7 +516,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
 
     fn endpoint_has_type(&self, err: &mut Diagnostic, span: Span, ty: Ty<'_>) {
         if !ty.references_error() {
-            err.span_label(span, format!("this is of type `{}`", ty));
+            err.span_label(span, format!("this is of type `{ty}`"));
         }
     }
 
@@ -540,7 +540,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         );
         let msg = |ty| {
             let ty = self.resolve_vars_if_possible(ty);
-            format!("this is of type `{}` but it should be `char` or numeric", ty)
+            format!("this is of type `{ty}` but it should be `char` or numeric")
         };
         let mut one_side_err = |first_span, first_ty, second: Option<(bool, Ty<'tcx>, Span)>| {
             err.span_label(first_span, msg(first_ty));
@@ -653,7 +653,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 )
             });
             let pre = if in_match { "in the same arm, " } else { "" };
-            err.note(format!("{}a binding must have the same type in all alternatives", pre));
+            err.note(format!("{pre}a binding must have the same type in all alternatives"));
             self.suggest_adding_missing_ref_or_removing_ref(
                 &mut err,
                 span,
@@ -755,7 +755,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             match binding_parent {
                 // Check that there is explicit type (ie this is not a closure param with inferred type)
                 // so we don't suggest moving something to the type that does not exist
-                hir::Node::Param(hir::Param { ty_span, .. }) if binding.span != *ty_span => {
+                hir::Node::Param(hir::Param { ty_span, pat, .. }) if pat.span != *ty_span => {
                     err.multipart_suggestion_verbose(
                         format!("to take parameter `{binding}` by reference, move `&{mutability}` to the type"),
                         vec![
@@ -924,7 +924,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         match opt_def_id {
             Some(def_id) => match self.tcx.hir().get_if_local(def_id) {
                 Some(hir::Node::Item(hir::Item {
-                    kind: hir::ItemKind::Const(_, body_id), ..
+                    kind: hir::ItemKind::Const(_, _, body_id),
+                    ..
                 })) => match self.tcx.hir().get(body_id.hir_id) {
                     hir::Node::Expr(expr) => {
                         if hir::is_range_literal(expr) {
@@ -1710,7 +1711,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             err.span_suggestion_verbose(
                 qpath.span().shrink_to_hi().to(pat.span.shrink_to_hi()),
                 "use the tuple variant pattern syntax instead",
-                format!("({})", sugg),
+                format!("({sugg})"),
                 appl,
             );
             return Some(err);
@@ -1812,7 +1813,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             const LIMIT: usize = 3;
             match witnesses {
                 [] => bug!(),
-                [witness] => format!("`{}`", witness),
+                [witness] => format!("`{witness}`"),
                 [head @ .., tail] if head.len() < LIMIT => {
                     let head: Vec<_> = head.iter().map(<_>::to_string).collect();
                     format!("`{}` and `{}`", head.join("`, `"), tail)
@@ -1834,8 +1835,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             "ensure that all fields are mentioned explicitly by adding the suggested fields",
         );
         lint.note(format!(
-            "the pattern is of type `{}` and the `non_exhaustive_omitted_patterns` attribute was found",
-            ty,
+            "the pattern is of type `{ty}` and the `non_exhaustive_omitted_patterns` attribute was found",
         ));
 
         lint
@@ -1864,10 +1864,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         } else {
             let fields = unmentioned_fields
                 .iter()
-                .map(|(_, name)| format!("`{}`", name))
+                .map(|(_, name)| format!("`{name}`"))
                 .collect::<Vec<String>>()
                 .join(", ");
-            format!("fields {}{}", fields, inaccessible)
+            format!("fields {fields}{inaccessible}")
         };
         let mut err = struct_span_err!(
             self.tcx.sess,
@@ -1876,7 +1876,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             "pattern does not mention {}",
             field_names
         );
-        err.span_label(pat.span, format!("missing {}", field_names));
+        err.span_label(pat.span, format!("missing {field_names}"));
         let len = unmentioned_fields.len();
         let (prefix, postfix, sp) = match fields {
             [] => match &pat.kind {
@@ -1909,11 +1909,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     .iter()
                     .map(|(_, name)| {
                         let field_name = name.to_string();
-                        if is_number(&field_name) {
-                            format!("{}: _", field_name)
-                        } else {
-                            field_name
-                        }
+                        if is_number(&field_name) { format!("{field_name}: _") } else { field_name }
                     })
                     .collect::<Vec<_>>()
                     .join(", "),
@@ -1930,7 +1926,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 s = pluralize!(len),
                 them = if len == 1 { "it" } else { "them" },
             ),
-            format!("{}..{}", prefix, postfix),
+            format!("{prefix}..{postfix}"),
             Applicability::MachineApplicable,
         );
         err
diff --git a/compiler/rustc_hir_typeck/src/upvar.rs b/compiler/rustc_hir_typeck/src/upvar.rs
index 22fe823acb7..be939560c45 100644
--- a/compiler/rustc_hir_typeck/src/upvar.rs
+++ b/compiler/rustc_hir_typeck/src/upvar.rs
@@ -109,11 +109,11 @@ impl MigrationWarningReason {
     fn migration_message(&self) -> String {
         let base = "changes to closure capture in Rust 2021 will affect";
         if !self.auto_traits.is_empty() && self.drop_order {
-            format!("{} drop order and which traits the closure implements", base)
+            format!("{base} drop order and which traits the closure implements")
         } else if self.drop_order {
-            format!("{} drop order", base)
+            format!("{base} drop order")
         } else {
-            format!("{} which traits the closure implements", base)
+            format!("{base} which traits the closure implements")
         }
     }
 }
@@ -824,8 +824,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     lint.note("for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>");
 
                     let diagnostic_msg = format!(
-                        "add a dummy let to cause {} to be fully captured",
-                        migrated_variables_concat
+                        "add a dummy let to cause {migrated_variables_concat} to be fully captured"
                     );
 
                     let closure_span = self.tcx.hir().span_with_body(closure_hir_id);
@@ -1943,7 +1942,7 @@ fn construct_place_string<'tcx>(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String
     let mut projections_str = String::new();
     for (i, item) in place.projections.iter().enumerate() {
         let proj = match item.kind {
-            ProjectionKind::Field(a, b) => format!("({:?}, {:?})", a, b),
+            ProjectionKind::Field(a, b) => format!("({a:?}, {b:?})"),
             ProjectionKind::Deref => String::from("Deref"),
             ProjectionKind::Index => String::from("Index"),
             ProjectionKind::Subslice => String::from("Subslice"),
@@ -1966,7 +1965,7 @@ fn construct_capture_kind_reason_string<'tcx>(
 
     let capture_kind_str = match capture_info.capture_kind {
         ty::UpvarCapture::ByValue => "ByValue".into(),
-        ty::UpvarCapture::ByRef(kind) => format!("{:?}", kind),
+        ty::UpvarCapture::ByRef(kind) => format!("{kind:?}"),
     };
 
     format!("{place_str} captured as {capture_kind_str} here")
@@ -1987,7 +1986,7 @@ fn construct_capture_info_string<'tcx>(
 
     let capture_kind_str = match capture_info.capture_kind {
         ty::UpvarCapture::ByValue => "ByValue".into(),
-        ty::UpvarCapture::ByRef(kind) => format!("{:?}", kind),
+        ty::UpvarCapture::ByRef(kind) => format!("{kind:?}"),
     };
     format!("{place_str} -> {capture_kind_str}")
 }
diff --git a/compiler/rustc_hir_typeck/src/writeback.rs b/compiler/rustc_hir_typeck/src/writeback.rs
index 2329a1f63ce..6f47623ec43 100644
--- a/compiler/rustc_hir_typeck/src/writeback.rs
+++ b/compiler/rustc_hir_typeck/src/writeback.rs
@@ -217,7 +217,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
                 // When encountering `return [0][0]` outside of a `fn` body we can encounter a base
                 // that isn't in the type table. We assume more relevant errors have already been
                 // emitted, so we delay an ICE if none have. (#64638)
-                self.tcx().sess.delay_span_bug(e.span, format!("bad base: `{:?}`", base));
+                self.tcx().sess.delay_span_bug(e.span, format!("bad base: `{base:?}`"));
             }
             if let Some(base_ty) = base_ty
                 && let ty::Ref(_, base_ty_inner, _) = *base_ty.kind()
@@ -231,7 +231,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
                         Ty::new_error_with_message(
                             self.fcx.tcx,
                             e.span,
-                            format!("bad index {:?} for base: `{:?}`", index, base),
+                            format!("bad index {index:?} for base: `{base:?}`"),
                         )
                     });
                 if self.is_builtin_index(e, base_ty_inner, index_ty) {
@@ -488,10 +488,8 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
                     let span = self.tcx().hir().span(hir_id);
                     // We need to buffer the errors in order to guarantee a consistent
                     // order when emitting them.
-                    let err = self
-                        .tcx()
-                        .sess
-                        .struct_span_err(span, format!("user args: {:?}", user_args));
+                    let err =
+                        self.tcx().sess.struct_span_err(span, format!("user args: {user_args:?}"));
                     err.buffer(&mut errors_buffer);
                 }
             }
diff --git a/compiler/rustc_incremental/src/assert_dep_graph.rs b/compiler/rustc_incremental/src/assert_dep_graph.rs
index 52a84b204d0..5e7ae3ecdb8 100644
--- a/compiler/rustc_incremental/src/assert_dep_graph.rs
+++ b/compiler/rustc_incremental/src/assert_dep_graph.rs
@@ -241,16 +241,16 @@ fn dump_graph(query: &DepGraphQuery) {
 
     {
         // dump a .txt file with just the edges:
-        let txt_path = format!("{}.txt", path);
+        let txt_path = format!("{path}.txt");
         let mut file = BufWriter::new(File::create(&txt_path).unwrap());
         for (source, target) in &edges {
-            write!(file, "{:?} -> {:?}\n", source, target).unwrap();
+            write!(file, "{source:?} -> {target:?}\n").unwrap();
         }
     }
 
     {
         // dump a .dot file in graphviz format:
-        let dot_path = format!("{}.dot", path);
+        let dot_path = format!("{path}.dot");
         let mut v = Vec::new();
         dot::render(&GraphvizDepGraph(nodes, edges), &mut v).unwrap();
         fs::write(dot_path, v).unwrap();
@@ -285,7 +285,7 @@ impl<'a> dot::Labeller<'a> for GraphvizDepGraph {
         dot::Id::new("DependencyGraph").unwrap()
     }
     fn node_id(&self, n: &DepKind) -> dot::Id<'_> {
-        let s: String = format!("{:?}", n)
+        let s: String = format!("{n:?}")
             .chars()
             .map(|c| if c == '_' || c.is_alphanumeric() { c } else { '_' })
             .collect();
@@ -293,7 +293,7 @@ impl<'a> dot::Labeller<'a> for GraphvizDepGraph {
         dot::Id::new(s).unwrap()
     }
     fn node_label(&self, n: &DepKind) -> dot::LabelText<'_> {
-        dot::LabelText::label(format!("{:?}", n))
+        dot::LabelText::label(format!("{n:?}"))
     }
 }
 
diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs
index f9cd01fd80d..5dd06c6ca4f 100644
--- a/compiler/rustc_incremental/src/persist/dirty_clean.rs
+++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs
@@ -300,7 +300,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
             },
             _ => self.tcx.sess.emit_fatal(errors::UndefinedCleanDirty {
                 span: attr.span,
-                kind: format!("{:?}", node),
+                kind: format!("{node:?}"),
             }),
         };
         let labels =
diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs
index 929a1e149b6..1111a1a17e2 100644
--- a/compiler/rustc_incremental/src/persist/fs.rs
+++ b/compiler/rustc_incremental/src/persist/fs.rs
@@ -427,13 +427,11 @@ fn copy_files(sess: &Session, target_dir: &Path, source_dir: &Path) -> Result<bo
     if sess.opts.unstable_opts.incremental_info {
         eprintln!(
             "[incremental] session directory: \
-                  {} files hard-linked",
-            files_linked
+                  {files_linked} files hard-linked"
         );
         eprintln!(
             "[incremental] session directory: \
-                 {} files copied",
-            files_copied
+                 {files_copied} files copied"
         );
     }
 
@@ -604,7 +602,7 @@ fn crate_path(sess: &Session, crate_name: Symbol, stable_crate_id: StableCrateId
 
     let stable_crate_id = base_n::encode(stable_crate_id.as_u64() as u128, INT_ENCODE_BASE);
 
-    let crate_name = format!("{}-{}", crate_name, stable_crate_id);
+    let crate_name = format!("{crate_name}-{stable_crate_id}");
     incr_dir.join(crate_name)
 }
 
diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs
index 1ffa8633afd..a7e045e1e89 100644
--- a/compiler/rustc_infer/src/errors/mod.rs
+++ b/compiler/rustc_infer/src/errors/mod.rs
@@ -210,10 +210,8 @@ impl<'a> SourceKindMultiSuggestion<'a> {
             _ => ("", ""),
         };
         let (start_span, start_span_code, end_span) = match should_wrap_expr {
-            Some(end_span) => {
-                (data.span(), format!("{}{}{}{{ ", arrow, ty_info, post), Some(end_span))
-            }
-            None => (data.span(), format!("{}{}{}", arrow, ty_info, post), None),
+            Some(end_span) => (data.span(), format!("{arrow}{ty_info}{post}{{ "), Some(end_span)),
+            None => (data.span(), format!("{arrow}{ty_info}{post}"), None),
         };
         Self::ClosureReturn { start_span, start_span_code, end_span }
     }
@@ -404,9 +402,9 @@ impl AddToDiagnostic for AddLifetimeParamsSuggestion<'_> {
             debug!(?lifetime_sub.ident.span);
             let make_suggestion = |ident: Ident| {
                 let sugg = if ident.name == kw::Empty {
-                    format!("{}, ", suggestion_param_name)
+                    format!("{suggestion_param_name}, ")
                 } else if ident.name == kw::UnderscoreLifetime && ident.span.is_empty() {
-                    format!("{} ", suggestion_param_name)
+                    format!("{suggestion_param_name} ")
                 } else {
                     suggestion_param_name.clone()
                 };
@@ -419,9 +417,9 @@ impl AddToDiagnostic for AddLifetimeParamsSuggestion<'_> {
                 let new_param_suggestion = if let Some(first) =
                     generics.params.iter().find(|p| !p.name.ident().span.is_empty())
                 {
-                    (first.span.shrink_to_lo(), format!("{}, ", suggestion_param_name))
+                    (first.span.shrink_to_lo(), format!("{suggestion_param_name}, "))
                 } else {
-                    (generics.span, format!("<{}>", suggestion_param_name))
+                    (generics.span, format!("<{suggestion_param_name}>"))
                 };
 
                 suggestions.push(new_param_suggestion);
@@ -1320,7 +1318,7 @@ impl AddToDiagnostic for SuggestTuplePatternMany {
             message,
             self.compatible_variants.into_iter().map(|variant| {
                 vec![
-                    (self.cause_span.shrink_to_lo(), format!("{}(", variant)),
+                    (self.cause_span.shrink_to_lo(), format!("{variant}(")),
                     (self.cause_span.shrink_to_hi(), ")".to_string()),
                 ]
             }),
diff --git a/compiler/rustc_infer/src/errors/note_and_explain.rs b/compiler/rustc_infer/src/errors/note_and_explain.rs
index 7328241dfbc..bd168f047fa 100644
--- a/compiler/rustc_infer/src/errors/note_and_explain.rs
+++ b/compiler/rustc_infer/src/errors/note_and_explain.rs
@@ -80,7 +80,7 @@ impl<'a> DescriptionCtx<'a> {
             // We shouldn't really be having unification failures with ReVar
             // and ReLateBound though.
             ty::ReVar(_) | ty::ReLateBound(..) | ty::ReErased => {
-                (alt_span, "revar", format!("{:?}", region))
+                (alt_span, "revar", format!("{region:?}"))
             }
         };
         Some(DescriptionCtx { span, kind, arg })
diff --git a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
index 1fd5d2adf80..54d901f20da 100644
--- a/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
+++ b/compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
@@ -205,7 +205,7 @@ impl CanonicalizeMode for CanonicalizeQueryResponse {
                 // `delay_span_bug` to allow type error over an ICE.
                 canonicalizer.tcx.sess.delay_span_bug(
                     rustc_span::DUMMY_SP,
-                    format!("unexpected region in query response: `{:?}`", r),
+                    format!("unexpected region in query response: `{r:?}`"),
                 );
                 r
             }
diff --git a/compiler/rustc_infer/src/infer/combine.rs b/compiler/rustc_infer/src/infer/combine.rs
index 38f8ad744a6..ddc8e7e50eb 100644
--- a/compiler/rustc_infer/src/infer/combine.rs
+++ b/compiler/rustc_infer/src/infer/combine.rs
@@ -177,7 +177,7 @@ impl<'tcx> InferCtxt<'tcx> {
             self.tcx.check_tys_might_be_eq(canonical).map_err(|_| {
                 self.tcx.sess.delay_span_bug(
                     DUMMY_SP,
-                    format!("cannot relate consts of different types (a={:?}, b={:?})", a, b,),
+                    format!("cannot relate consts of different types (a={a:?}, b={b:?})",),
                 )
             })
         });
diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
index d3978e242a8..5a78790ec6e 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs
@@ -238,7 +238,7 @@ fn msg_span_from_named_region<'tcx>(
                         let text = if name == kw::UnderscoreLifetime {
                             "the anonymous lifetime as defined here".to_string()
                         } else {
-                            format!("the lifetime `{}` as defined here", name)
+                            format!("the lifetime `{name}` as defined here")
                         };
                         (text, Some(span))
                     }
@@ -250,7 +250,7 @@ fn msg_span_from_named_region<'tcx>(
                         })
                     ),
                     _ => (
-                        format!("the lifetime `{}` as defined here", region),
+                        format!("the lifetime `{region}` as defined here"),
                         Some(tcx.def_span(scope)),
                     ),
                 }
@@ -280,7 +280,7 @@ fn emit_msg_span(
     span: Option<Span>,
     suffix: &str,
 ) {
-    let message = format!("{}{}{}", prefix, description, suffix);
+    let message = format!("{prefix}{description}{suffix}");
 
     if let Some(span) = span {
         err.span_note(span, message);
@@ -296,7 +296,7 @@ fn label_msg_span(
     span: Option<Span>,
     suffix: &str,
 ) {
-    let message = format!("{}{}{}", prefix, description, suffix);
+    let message = format!("{prefix}{description}{suffix}");
 
     if let Some(span) = span {
         err.span_label(span, message);
@@ -333,7 +333,7 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
             explain_free_region(
                 tcx,
                 &mut err,
-                &format!("hidden type `{}` captures ", hidden_ty),
+                &format!("hidden type `{hidden_ty}` captures "),
                 hidden_region,
                 "",
             );
@@ -345,7 +345,7 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
                     fn_returns,
                     hidden_region.to_string(),
                     None,
-                    format!("captures `{}`", hidden_region),
+                    format!("captures `{hidden_region}`"),
                     None,
                     Some(reg_info.def_id),
                 )
@@ -373,7 +373,7 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
             note_and_explain_region(
                 tcx,
                 &mut err,
-                &format!("hidden type `{}` captures ", hidden_ty),
+                &format!("hidden type `{hidden_ty}` captures "),
                 hidden_region,
                 "",
                 None,
@@ -716,7 +716,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     {
                         err.span_label(span, format!("this is an iterator with items of type `{}`", args.type_at(0)));
                     } else {
-                    err.span_label(span, format!("this expression has type `{}`", ty));
+                    err.span_label(span, format!("this expression has type `{ty}`"));
                 }
                 }
                 if let Some(ty::error::ExpectedFound { found, .. }) = exp_found
@@ -726,7 +726,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     err.span_suggestion(
                         span,
                         "consider dereferencing the boxed value",
-                        format!("*{}", snippet),
+                        format!("*{snippet}"),
                         Applicability::MachineApplicable,
                     );
                 }
@@ -785,13 +785,13 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     if prior_arms.len() <= 4 {
                         for sp in prior_arms {
                             any_multiline_arm |= source_map.is_multiline(*sp);
-                            err.span_label(*sp, format!("this is found to be of type `{}`", t));
+                            err.span_label(*sp, format!("this is found to be of type `{t}`"));
                         }
                     } else if let Some(sp) = prior_arms.last() {
                         any_multiline_arm |= source_map.is_multiline(*sp);
                         err.span_label(
                             *sp,
-                            format!("this and all prior arms are found to be of type `{}`", t),
+                            format!("this and all prior arms are found to be of type `{t}`"),
                         );
                     }
                     let outer = if any_multiline_arm || !source_map.is_multiline(cause.span) {
@@ -1661,7 +1661,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     ..
                 })) = values
                 {
-                    Cow::from(format!("expected this to be `{}`", expected))
+                    Cow::from(format!("expected this to be `{expected}`"))
                 } else {
                     terr.to_string(self.tcx)
                 };
@@ -2068,7 +2068,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                 visitor.visit_body(body);
                 visitor.result.map(|r| &r.peel_refs().kind)
             }
-            Some(hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, _), .. })) => {
+            Some(hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, _, _), .. })) => {
                 Some(&ty.peel_refs().kind)
             }
             _ => None,
@@ -2368,13 +2368,13 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
         }
 
         let labeled_user_string = match bound_kind {
-            GenericKind::Param(ref p) => format!("the parameter type `{}`", p),
+            GenericKind::Param(ref p) => format!("the parameter type `{p}`"),
             GenericKind::Alias(ref p) => match p.kind(self.tcx) {
                 ty::AliasKind::Projection | ty::AliasKind::Inherent => {
-                    format!("the associated type `{}`", p)
+                    format!("the associated type `{p}`")
                 }
-                ty::AliasKind::Weak => format!("the type alias `{}`", p),
-                ty::AliasKind::Opaque => format!("the opaque type `{}`", p),
+                ty::AliasKind::Weak => format!("the type alias `{p}`"),
+                ty::AliasKind::Opaque => format!("the opaque type `{p}`"),
             },
         };
 
@@ -2388,7 +2388,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                 span,
                 impl_item_def_id,
                 trait_item_def_id,
-                &format!("`{}: {}`", bound_kind, sub),
+                &format!("`{bound_kind}: {sub}`"),
             );
         }
 
@@ -2402,7 +2402,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
             let msg = "consider adding an explicit lifetime bound";
             if let Some((sp, has_lifetimes)) = type_param_span {
                 let suggestion =
-                    if has_lifetimes { format!(" + {}", sub) } else { format!(": {}", sub) };
+                    if has_lifetimes { format!(" + {sub}") } else { format!(": {sub}") };
                 let mut suggestions = vec![(sp, suggestion)];
                 for add_lt_sugg in add_lt_suggs.into_iter().flatten() {
                     suggestions.push(add_lt_sugg);
@@ -2413,7 +2413,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     Applicability::MaybeIncorrect, // Issue #41966
                 );
             } else {
-                let consider = format!("{} `{}: {}`...", msg, bound_kind, sub);
+                let consider = format!("{msg} `{bound_kind}: {sub}`...");
                 err.help(consider);
             }
         }
@@ -2422,13 +2422,10 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
             |err: &mut Diagnostic, type_param_span: Option<(Span, bool)>| {
                 let msg = "consider introducing an explicit lifetime bound";
                 if let Some((sp, has_lifetimes)) = type_param_span {
-                    let suggestion = if has_lifetimes {
-                        format!(" + {}", new_lt)
-                    } else {
-                        format!(": {}", new_lt)
-                    };
+                    let suggestion =
+                        if has_lifetimes { format!(" + {new_lt}") } else { format!(": {new_lt}") };
                     let mut sugg =
-                        vec![(sp, suggestion), (span.shrink_to_hi(), format!(" + {}", new_lt))];
+                        vec![(sp, suggestion), (span.shrink_to_hi(), format!(" + {new_lt}"))];
                     for lt in add_lt_suggs.clone().into_iter().flatten() {
                         sugg.push(lt);
                         sugg.rotate_right(1);
@@ -2508,7 +2505,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     "{} may not live long enough",
                     labeled_user_string
                 );
-                let pred = format!("{}: {}", bound_kind, sub);
+                let pred = format!("{bound_kind}: {sub}");
                 let suggestion = format!("{} {}", generics.add_where_or_trailing_comma(), pred,);
                 err.span_suggestion(
                     generics.tail_span_for_predicate_suggestion(),
@@ -2564,7 +2561,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                 note_and_explain_region(
                     self.tcx,
                     &mut err,
-                    &format!("{} must be valid for ", labeled_user_string),
+                    &format!("{labeled_user_string} must be valid for "),
                     sub,
                     "...",
                     None,
@@ -2814,10 +2811,10 @@ impl<'tcx> InferCtxt<'tcx> {
                 br_string(br),
                 self.tcx.associated_item(def_id).name
             ),
-            infer::EarlyBoundRegion(_, name) => format!(" for lifetime parameter `{}`", name),
+            infer::EarlyBoundRegion(_, name) => format!(" for lifetime parameter `{name}`"),
             infer::UpvarRegion(ref upvar_id, _) => {
                 let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id);
-                format!(" for capture of `{}` by closure", var_name)
+                format!(" for capture of `{var_name}` by closure")
             }
             infer::Nll(..) => bug!("NLL variable found in lexical phase"),
         };
diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
index 36b56fe782c..9dfa45858a7 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
@@ -246,7 +246,7 @@ fn closure_as_fn_str<'tcx>(infcx: &InferCtxt<'tcx>, ty: Ty<'tcx>) -> String {
     } else {
         format!(" -> {}", ty_to_string(infcx, fn_sig.output().skip_binder(), None))
     };
-    format!("fn({}){}", args, ret)
+    format!("fn({args}){ret}")
 }
 
 impl<'tcx> InferCtxt<'tcx> {
diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
index 40dc6497611..d08b6ba5e47 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs
@@ -235,10 +235,10 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
         }
 
         let arg = match param.param.pat.simple_ident() {
-            Some(simple_ident) => format!("argument `{}`", simple_ident),
+            Some(simple_ident) => format!("argument `{simple_ident}`"),
             None => "the argument".to_string(),
         };
-        let captures = format!("captures data from {}", arg);
+        let captures = format!("captures data from {arg}");
         suggest_new_region_bound(
             tcx,
             &mut err,
@@ -269,11 +269,11 @@ pub fn suggest_new_region_bound(
     // FIXME: account for the need of parens in `&(dyn Trait + '_)`
     let consider = "consider changing";
     let declare = "to declare that";
-    let explicit = format!("you can add an explicit `{}` lifetime bound", lifetime_name);
+    let explicit = format!("you can add an explicit `{lifetime_name}` lifetime bound");
     let explicit_static =
-        arg.map(|arg| format!("explicit `'static` bound to the lifetime of {}", arg));
+        arg.map(|arg| format!("explicit `'static` bound to the lifetime of {arg}"));
     let add_static_bound = "alternatively, add an explicit `'static` bound to this reference";
-    let plus_lt = format!(" + {}", lifetime_name);
+    let plus_lt = format!(" + {lifetime_name}");
     for fn_return in fn_returns {
         if fn_return.span.desugaring_kind().is_some() {
             // Skip `async` desugaring `impl Future`.
@@ -383,12 +383,7 @@ pub fn suggest_new_region_bound(
                 if let LifetimeName::ImplicitObjectLifetimeDefault = lt.res {
                     err.span_suggestion_verbose(
                         fn_return.span.shrink_to_hi(),
-                        format!(
-                            "{declare} the trait object {captures}, {explicit}",
-                            declare = declare,
-                            captures = captures,
-                            explicit = explicit,
-                        ),
+                        format!("{declare} the trait object {captures}, {explicit}",),
                         &plus_lt,
                         Applicability::MaybeIncorrect,
                     );
@@ -400,7 +395,7 @@ pub fn suggest_new_region_bound(
                     if let Some(explicit_static) = &explicit_static {
                         err.span_suggestion_verbose(
                             lt.ident.span,
-                            format!("{} the trait object's {}", consider, explicit_static),
+                            format!("{consider} the trait object's {explicit_static}"),
                             &lifetime_name,
                             Applicability::MaybeIncorrect,
                         );
diff --git a/compiler/rustc_infer/src/infer/error_reporting/note.rs b/compiler/rustc_infer/src/infer/error_reporting/note.rs
index 7144084c78e..8d3cd23b7fa 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/note.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/note.rs
@@ -227,7 +227,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     span,
                     impl_item_def_id,
                     trait_item_def_id,
-                    &format!("`{}: {}`", sup, sub),
+                    &format!("`{sup}: {sub}`"),
                 );
                 // We should only suggest rewriting the `where` clause if the predicate is within that `where` clause
                 if let Some(generics) = self.tcx.hir().get_generics(impl_item_def_id)
@@ -243,12 +243,18 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
             }
             infer::CheckAssociatedTypeBounds { impl_item_def_id, trait_item_def_id, parent } => {
                 let mut err = self.report_concrete_failure(*parent, sub, sup);
-                let trait_item_span = self.tcx.def_span(trait_item_def_id);
-                let item_name = self.tcx.item_name(impl_item_def_id.to_def_id());
-                err.span_label(
-                    trait_item_span,
-                    format!("definition of `{}` from trait", item_name),
-                );
+
+                // Don't mention the item name if it's an RPITIT, since that'll just confuse
+                // folks.
+                if !self.tcx.is_impl_trait_in_trait(impl_item_def_id.to_def_id()) {
+                    let trait_item_span = self.tcx.def_span(trait_item_def_id);
+                    let item_name = self.tcx.item_name(impl_item_def_id.to_def_id());
+                    err.span_label(
+                        trait_item_span,
+                        format!("definition of `{item_name}` from trait"),
+                    );
+                }
+
                 self.suggest_copy_trait_method_bounds(
                     trait_item_def_id,
                     impl_item_def_id,
diff --git a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
index 8e3f6b97e8f..372539d73b1 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
@@ -47,7 +47,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                             diag.span_suggestion(
                                 sp,
                                 "use a float literal",
-                                format!("{}.0", snippet),
+                                format!("{snippet}.0"),
                                 MachineApplicable,
                             );
                         }
@@ -134,7 +134,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
 
                             if matched_end_of_args {
                                 // Append suggestion to the end of our args
-                                let path = format!(", {}{} = {}",item_name, item_args, p);
+                                let path = format!(", {item_name}{item_args} = {p}");
                                 note = !suggest_constraining_type_param(
                                     tcx,
                                     generics,
@@ -148,7 +148,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                                 // Suggest adding a bound to an existing trait
                                 // or if the trait doesn't exist, add the trait
                                 // and the suggested bounds.
-                                let path = format!("<{}{} = {}>", item_name, item_args, p);
+                                let path = format!("<{item_name}{item_args} = {p}>");
                                 note = !suggest_constraining_type_param(
                                     tcx,
                                     generics,
@@ -213,8 +213,7 @@ impl<T> Trait<T> for X {
                         }
                         diag.help(format!(
                             "every closure has a distinct type and so could not always match the \
-                             caller-chosen type of parameter `{}`",
-                            p
+                             caller-chosen type of parameter `{p}`"
                         ));
                     }
                     (ty::Param(p), _) | (_, ty::Param(p)) => {
diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
index ce5d3791a48..f1d53cb59cd 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs
@@ -575,12 +575,12 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
                     if param_hir.pat.span == param_hir.ty_span {
                         // for `|x|`, `|_|`, `|x: impl Foo|`
                         let Ok(pat) = self.tcx.sess.source_map().span_to_snippet(param_hir.pat.span) else { return; };
-                        suggestion += &format!("{}: &_", pat);
+                        suggestion += &format!("{pat}: &_");
                     } else {
                         // for `|x: ty|`, `|_: ty|`
                         let Ok(pat) = self.tcx.sess.source_map().span_to_snippet(param_hir.pat.span) else { return; };
                         let Ok(ty) = self.tcx.sess.source_map().span_to_snippet(param_hir.ty_span) else { return; };
-                        suggestion += &format!("{}: &{}", pat, ty);
+                        suggestion += &format!("{pat}: &{ty}");
                     }
                     has_suggestion = true;
                 } else {
diff --git a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
index 485e34fe2bf..be424424f3a 100644
--- a/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
+++ b/compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
@@ -837,9 +837,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
             self.var_infos[node_idx].origin.span(),
             format!(
                 "collect_error_for_expanding_node() could not find \
-                 error for var {:?} in universe {:?}, lower_bounds={:#?}, \
-                 upper_bounds={:#?}",
-                node_idx, node_universe, lower_bounds, upper_bounds
+                 error for var {node_idx:?} in universe {node_universe:?}, lower_bounds={lower_bounds:#?}, \
+                 upper_bounds={upper_bounds:#?}"
             ),
         );
     }
diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs
index 71c07f31bc9..c8049164391 100644
--- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs
+++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs
@@ -557,7 +557,7 @@ where
                 // Forbid inference variables in the RHS.
                 self.infcx.tcx.sess.delay_span_bug(
                     self.delegate.span(),
-                    format!("unexpected inference var {:?}", b,),
+                    format!("unexpected inference var {b:?}",),
                 );
                 Ok(a)
             }
diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs
index 945136fbff2..9c90b704586 100644
--- a/compiler/rustc_infer/src/infer/opaque_types.rs
+++ b/compiler/rustc_infer/src/infer/opaque_types.rs
@@ -619,13 +619,6 @@ impl<'tcx> InferCtxt<'tcx> {
                     {
                         hidden_ty
                     }
-                    // FIXME(RPITIT): This can go away when we move to associated types
-                    // FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
-                    ty::Alias(ty::Projection, ty::AliasTy { def_id: def_id2, args: args2, .. })
-                        if def_id == def_id2 && args == args2 =>
-                    {
-                        hidden_ty
-                    }
                     _ => ty,
                 },
                 lt_op: |lt| lt,
diff --git a/compiler/rustc_infer/src/infer/outlives/obligations.rs b/compiler/rustc_infer/src/infer/outlives/obligations.rs
index 0681f414ce9..f36802e1284 100644
--- a/compiler/rustc_infer/src/infer/outlives/obligations.rs
+++ b/compiler/rustc_infer/src/infer/outlives/obligations.rs
@@ -253,7 +253,7 @@ where
                     // this point it never will be
                     self.tcx.sess.delay_span_bug(
                         origin.span(),
-                        format!("unresolved inference variable in outlives: {:?}", v),
+                        format!("unresolved inference variable in outlives: {v:?}"),
                     );
                 }
             }
diff --git a/compiler/rustc_infer/src/infer/outlives/verify.rs b/compiler/rustc_infer/src/infer/outlives/verify.rs
index 2bc6546ba28..4279d0ab7ab 100644
--- a/compiler/rustc_infer/src/infer/outlives/verify.rs
+++ b/compiler/rustc_infer/src/infer/outlives/verify.rs
@@ -179,7 +179,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
                 // this point it never will be
                 self.tcx.sess.delay_span_bug(
                     rustc_span::DUMMY_SP,
-                    format!("unresolved inference variable in outlives: {:?}", v),
+                    format!("unresolved inference variable in outlives: {v:?}"),
                 );
                 // add a bound that never holds
                 VerifyBound::AnyBound(vec![])
diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs
index 613da8a0b45..708c51cabeb 100644
--- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs
+++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs
@@ -704,8 +704,8 @@ impl fmt::Debug for RegionSnapshot {
 impl<'tcx> fmt::Debug for GenericKind<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            GenericKind::Param(ref p) => write!(f, "{:?}", p),
-            GenericKind::Alias(ref p) => write!(f, "{:?}", p),
+            GenericKind::Param(ref p) => write!(f, "{p:?}"),
+            GenericKind::Alias(ref p) => write!(f, "{p:?}"),
         }
     }
 }
@@ -713,8 +713,8 @@ impl<'tcx> fmt::Debug for GenericKind<'tcx> {
 impl<'tcx> fmt::Display for GenericKind<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            GenericKind::Param(ref p) => write!(f, "{}", p),
-            GenericKind::Alias(ref p) => write!(f, "{}", p),
+            GenericKind::Param(ref p) => write!(f, "{p}"),
+            GenericKind::Alias(ref p) => write!(f, "{p}"),
         }
     }
 }
diff --git a/compiler/rustc_infer/src/traits/error_reporting/mod.rs b/compiler/rustc_infer/src/traits/error_reporting/mod.rs
index 9f440f39849..e72a43630e9 100644
--- a/compiler/rustc_infer/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_infer/src/traits/error_reporting/mod.rs
@@ -28,11 +28,11 @@ impl<'tcx> InferCtxt<'tcx> {
         if !self.tcx.is_impl_trait_in_trait(trait_item_def_id) {
             if let Some(span) = self.tcx.hir().span_if_local(trait_item_def_id) {
                 let item_name = self.tcx.item_name(impl_item_def_id.to_def_id());
-                err.span_label(span, format!("definition of `{}` from trait", item_name));
+                err.span_label(span, format!("definition of `{item_name}` from trait"));
             }
         }
 
-        err.span_label(error_span, format!("impl has extra requirement {}", requirement));
+        err.span_label(error_span, format!("impl has extra requirement {requirement}"));
 
         err
     }
@@ -56,7 +56,7 @@ pub fn report_object_safety_error<'tcx>(
         "the trait `{}` cannot be made into an object",
         trait_str
     );
-    err.span_label(span, format!("`{}` cannot be made into an object", trait_str));
+    err.span_label(span, format!("`{trait_str}` cannot be made into an object"));
 
     let mut reported_violations = FxIndexSet::default();
     let mut multi_span = vec![];
diff --git a/compiler/rustc_infer/src/traits/mod.rs b/compiler/rustc_infer/src/traits/mod.rs
index 626dd9359a1..a9da6104b38 100644
--- a/compiler/rustc_infer/src/traits/mod.rs
+++ b/compiler/rustc_infer/src/traits/mod.rs
@@ -79,7 +79,6 @@ impl<'tcx> PredicateObligation<'tcx> {
     }
 
     pub fn without_const(mut self, tcx: TyCtxt<'tcx>) -> PredicateObligation<'tcx> {
-        self.param_env = self.param_env.without_const();
         if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred)) = self.predicate.kind().skip_binder() && trait_pred.is_const_if_const() {
             self.predicate = tcx.mk_predicate(self.predicate.kind().map_bound(|_| ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred.without_const()))));
         }
@@ -88,14 +87,6 @@ impl<'tcx> PredicateObligation<'tcx> {
 }
 
 impl<'tcx> PolyTraitObligation<'tcx> {
-    /// Returns `true` if the trait predicate is considered `const` in its ParamEnv.
-    pub fn is_const(&self) -> bool {
-        matches!(
-            (self.predicate.skip_binder().constness, self.param_env.constness()),
-            (ty::BoundConstness::ConstIfConst, hir::Constness::Const)
-        )
-    }
-
     pub fn derived_cause(
         &self,
         variant: impl FnOnce(DerivedObligationCause<'tcx>) -> ObligationCauseCode<'tcx>,
diff --git a/compiler/rustc_infer/src/traits/project.rs b/compiler/rustc_infer/src/traits/project.rs
index e375d611936..afba2e50a23 100644
--- a/compiler/rustc_infer/src/traits/project.rs
+++ b/compiler/rustc_infer/src/traits/project.rs
@@ -190,7 +190,7 @@ impl<'tcx> ProjectionCache<'_, 'tcx> {
         }
         let fresh_key =
             map.insert(key, ProjectionCacheEntry::NormalizedTy { ty: value, complete: None });
-        assert!(!fresh_key, "never started projecting `{:?}`", key);
+        assert!(!fresh_key, "never started projecting `{key:?}`");
     }
 
     /// Mark the relevant projection cache key as having its derived obligations
@@ -229,7 +229,7 @@ impl<'tcx> ProjectionCache<'_, 'tcx> {
     /// be different).
     pub fn ambiguous(&mut self, key: ProjectionCacheKey<'tcx>) {
         let fresh = self.map().insert(key, ProjectionCacheEntry::Ambiguous);
-        assert!(!fresh, "never started projecting `{:?}`", key);
+        assert!(!fresh, "never started projecting `{key:?}`");
     }
 
     /// Indicates that while trying to normalize `key`, `key` was required to
@@ -237,14 +237,14 @@ impl<'tcx> ProjectionCache<'_, 'tcx> {
     /// an error here.
     pub fn recur(&mut self, key: ProjectionCacheKey<'tcx>) {
         let fresh = self.map().insert(key, ProjectionCacheEntry::Recur);
-        assert!(!fresh, "never started projecting `{:?}`", key);
+        assert!(!fresh, "never started projecting `{key:?}`");
     }
 
     /// Indicates that trying to normalize `key` resulted in
     /// error.
     pub fn error(&mut self, key: ProjectionCacheKey<'tcx>) {
         let fresh = self.map().insert(key, ProjectionCacheEntry::Error);
-        assert!(!fresh, "never started projecting `{:?}`", key);
+        assert!(!fresh, "never started projecting `{key:?}`");
     }
 }
 
diff --git a/compiler/rustc_infer/src/traits/structural_impls.rs b/compiler/rustc_infer/src/traits/structural_impls.rs
index 1563d92af0e..8a7c59da09e 100644
--- a/compiler/rustc_infer/src/traits/structural_impls.rs
+++ b/compiler/rustc_infer/src/traits/structural_impls.rs
@@ -38,17 +38,17 @@ impl<'tcx> fmt::Debug for traits::FulfillmentError<'tcx> {
 impl<'tcx> fmt::Debug for traits::FulfillmentErrorCode<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            super::CodeSelectionError(ref e) => write!(f, "{:?}", e),
-            super::CodeProjectionError(ref e) => write!(f, "{:?}", e),
+            super::CodeSelectionError(ref e) => write!(f, "{e:?}"),
+            super::CodeProjectionError(ref e) => write!(f, "{e:?}"),
             super::CodeSubtypeError(ref a, ref b) => {
-                write!(f, "CodeSubtypeError({:?}, {:?})", a, b)
+                write!(f, "CodeSubtypeError({a:?}, {b:?})")
             }
             super::CodeConstEquateError(ref a, ref b) => {
-                write!(f, "CodeConstEquateError({:?}, {:?})", a, b)
+                write!(f, "CodeConstEquateError({a:?}, {b:?})")
             }
             super::CodeAmbiguity { overflow: false } => write!(f, "Ambiguity"),
             super::CodeAmbiguity { overflow: true } => write!(f, "Overflow"),
-            super::CodeCycle(ref cycle) => write!(f, "Cycle({:?})", cycle),
+            super::CodeCycle(ref cycle) => write!(f, "Cycle({cycle:?})"),
         }
     }
 }
diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml
index 7826d42dcb2..2c7438ed9db 100644
--- a/compiler/rustc_interface/Cargo.toml
+++ b/compiler/rustc_interface/Cargo.toml
@@ -6,7 +6,6 @@ edition = "2021"
 [lib]
 
 [dependencies]
-atty = "0.2.13"
 libloading = "0.7.1"
 tracing = "0.1"
 rustc-rayon-core = { version = "0.5.0", optional = true }
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs
index 12d33f06309..ad35dbbc8f9 100644
--- a/compiler/rustc_interface/src/util.rs
+++ b/compiler/rustc_interface/src/util.rs
@@ -519,7 +519,8 @@ fn multiple_output_types_to_stdout(
     output_types: &OutputTypes,
     single_output_file_is_stdout: bool,
 ) -> bool {
-    if atty::is(atty::Stream::Stdout) {
+    use std::io::IsTerminal;
+    if std::io::stdout().is_terminal() {
         // If stdout is a tty, check if multiple text output types are
         // specified by `--emit foo=- --emit bar=-` or `-o - --emit foo,bar`
         let named_text_types = output_types
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index 252177932e4..16e17fc9d6a 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -155,8 +155,6 @@ lint_builtin_unused_doc_comment = unused doc comment
 lint_builtin_while_true = denote infinite loops with `loop {"{"} ... {"}"}`
     .suggestion = use `loop`
 
-lint_cast_ref_to_mut = casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-
 lint_check_name_deprecated = lint name `{$lint_name}` is deprecated and does not have an effect anymore. Use: {$new_name}
 
 lint_check_name_unknown = unknown lint: `{$lint_name}`
@@ -320,6 +318,8 @@ lint_invalid_nan_comparisons_eq_ne = incorrect NaN comparison, NaN cannot be dir
 
 lint_invalid_nan_comparisons_lt_le_gt_ge = incorrect NaN comparison, NaN is not orderable
 
+lint_invalid_reference_casting = casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
+
 lint_lintpass_by_hand = implementing `LintPass` by hand
     .help = try using `declare_lint_pass!` or `impl_lint_pass!` instead
 
@@ -410,8 +410,8 @@ lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name
     .label = should have an UPPER_CASE name
 
 lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing
-    .label = unnecessary method call
-    .note = the type `{$receiver_ty}` which `{$method}` is being called on is the same as the type returned from `{$method}`, so the method call does not do anything and can be removed
+    .suggestion = remove this redundant call
+    .note = the type `{$orig_ty}` does not implement `{$trait_}`, so calling `{$method}` on `&{$orig_ty}` copies the reference, which does not do anything and can be removed
 
 lint_only_cast_u8_to_char = only `u8` can be cast into `char`
     .suggestion = use a `char` literal instead
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 84aca80b0de..e6917f4b2d3 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -1458,15 +1458,20 @@ impl TypeAliasBounds {
 
 impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
     fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
-        let hir::ItemKind::TyAlias(ty, type_alias_generics) = &item.kind else { return };
-        if cx.tcx.type_of(item.owner_id.def_id).skip_binder().has_opaque_types() {
-            // Bounds are respected for `type X = impl Trait` and `type X = (impl Trait, Y);`
+        let hir::ItemKind::TyAlias(hir_ty, type_alias_generics) = &item.kind else { return };
+
+        if cx.tcx.features().lazy_type_alias {
+            // Bounds of lazy type aliases are respected.
             return;
         }
-        if cx.tcx.type_of(item.owner_id).skip_binder().has_inherent_projections() {
-            // Bounds are respected for `type X = … Type::Inherent …`
+
+        let ty = cx.tcx.type_of(item.owner_id).skip_binder();
+        if ty.has_opaque_types() || ty.has_inherent_projections() {
+            // Bounds of type aliases that contain opaque types or inherent projections are respected.
+            // E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`, `type X = Type::Inherent;`.
             return;
         }
+
         // There must not be a where clause
         if type_alias_generics.predicates.is_empty() {
             return;
@@ -1491,7 +1496,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
         if !where_spans.is_empty() {
             let sub = (!suggested_changing_assoc_types).then(|| {
                 suggested_changing_assoc_types = true;
-                SuggestChangingAssocTypes { ty }
+                SuggestChangingAssocTypes { ty: hir_ty }
             });
             cx.emit_spanned_lint(
                 TYPE_ALIAS_BOUNDS,
@@ -1507,7 +1512,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
             let suggestion = BuiltinTypeAliasGenericBoundsSuggestion { suggestions: inline_sugg };
             let sub = (!suggested_changing_assoc_types).then(|| {
                 suggested_changing_assoc_types = true;
-                SuggestChangingAssocTypes { ty }
+                SuggestChangingAssocTypes { ty: hir_ty }
             });
             cx.emit_spanned_lint(
                 TYPE_ALIAS_BOUNDS,
@@ -1529,9 +1534,10 @@ declare_lint_pass!(
 impl<'tcx> LateLintPass<'tcx> for UnusedBrokenConst {
     fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
         match it.kind {
-            hir::ItemKind::Const(_, body_id) => {
+            hir::ItemKind::Const(_, _, body_id) => {
                 let def_id = cx.tcx.hir().body_owner_def_id(body_id).to_def_id();
                 // trigger the query once for all constants since that will already report the errors
+                // FIXME(generic_const_items): Does this work properly with generic const items?
                 cx.tcx.ensure().const_eval_poly(def_id);
             }
             hir::ItemKind::Static(_, _, body_id) => {
@@ -1716,7 +1722,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
                 let end = expr_to_string(&end);
                 let replace = match start {
                     Some(start) => format!("&({}..={})", expr_to_string(&start), end),
-                    None => format!("&(..={})", end),
+                    None => format!("&(..={end})"),
                 };
                 if join.edition() >= Edition::Edition2021 {
                     cx.sess().emit_err(BuiltinEllipsisInclusiveRangePatterns {
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs
index 7c701fd4fe1..f7e56b30553 100644
--- a/compiler/rustc_lint/src/context.rs
+++ b/compiler/rustc_lint/src/context.rs
@@ -411,7 +411,7 @@ impl LintStore {
         }
 
         let complete_name = if let Some(tool_name) = tool_name {
-            format!("{}::{}", tool_name, lint_name)
+            format!("{tool_name}::{lint_name}")
         } else {
             lint_name.to_string()
         };
@@ -424,7 +424,7 @@ impl LintStore {
                         // 1. The tool is currently running, so this lint really doesn't exist.
                         // FIXME: should this handle tools that never register a lint, like rustfmt?
                         debug!("lints={:?}", self.by_name.keys().collect::<Vec<_>>());
-                        let tool_prefix = format!("{}::", tool_name);
+                        let tool_prefix = format!("{tool_name}::");
                         return if self.by_name.keys().any(|lint| lint.starts_with(&tool_prefix)) {
                             self.no_lint_suggestion(&complete_name)
                         } else {
@@ -445,11 +445,11 @@ impl LintStore {
         }
         match self.by_name.get(&complete_name) {
             Some(Renamed(new_name, _)) => CheckLintNameResult::Warning(
-                format!("lint `{}` has been renamed to `{}`", complete_name, new_name),
+                format!("lint `{complete_name}` has been renamed to `{new_name}`"),
                 Some(new_name.to_owned()),
             ),
             Some(Removed(reason)) => CheckLintNameResult::Warning(
-                format!("lint `{}` has been removed: {}", complete_name, reason),
+                format!("lint `{complete_name}` has been removed: {reason}"),
                 None,
             ),
             None => match self.lint_groups.get(&*complete_name) {
@@ -503,7 +503,7 @@ impl LintStore {
         lint_name: &str,
         tool_name: &str,
     ) -> CheckLintNameResult<'_> {
-        let complete_name = format!("{}::{}", tool_name, lint_name);
+        let complete_name = format!("{tool_name}::{lint_name}");
         match self.by_name.get(&complete_name) {
             None => match self.lint_groups.get(&*complete_name) {
                 // Now we are sure, that this lint exists nowhere
@@ -618,12 +618,10 @@ pub trait LintContext: Sized {
                         _ => ("", "s"),
                     };
                     db.span_label(span, format!(
-                        "this comment contains {}invisible unicode text flow control codepoint{}",
-                        an,
-                        s,
+                        "this comment contains {an}invisible unicode text flow control codepoint{s}",
                     ));
                     for (c, span) in &spans {
-                        db.span_label(*span, format!("{:?}", c));
+                        db.span_label(*span, format!("{c:?}"));
                     }
                     db.note(
                         "these kind of unicode codepoints change the way text flows on \
@@ -648,7 +646,7 @@ pub trait LintContext: Sized {
                             let opt_colon =
                                 if s.trim_start().starts_with("::") { "" } else { "::" };
 
-                            (format!("crate{}{}", opt_colon, s), Applicability::MachineApplicable)
+                            (format!("crate{opt_colon}{s}"), Applicability::MachineApplicable)
                         }
                         Err(_) => ("crate::<path>".to_string(), Applicability::HasPlaceholders),
                     };
@@ -704,7 +702,7 @@ pub trait LintContext: Sized {
                         let introduced = if is_imported { "imported" } else { "defined" };
                         db.span_label(
                             span,
-                            format!("the item `{}` is already {} here", ident, introduced),
+                            format!("the item `{ident}` is already {introduced} here"),
                         );
                     }
                 }
@@ -908,7 +906,7 @@ pub trait LintContext: Sized {
                 BuiltinLintDiagnostics::NamedArgumentUsedPositionally{ position_sp_to_replace, position_sp_for_msg, named_arg_sp, named_arg_name, is_formatting_arg} => {
                     db.span_label(named_arg_sp, "this named argument is referred to by position in formatting string");
                     if let Some(positional_arg_for_msg) = position_sp_for_msg {
-                        let msg = format!("this formatting argument uses named argument `{}` by position", named_arg_name);
+                        let msg = format!("this formatting argument uses named argument `{named_arg_name}` by position");
                         db.span_label(positional_arg_for_msg, msg);
                     }
 
@@ -948,12 +946,15 @@ pub trait LintContext: Sized {
                         Applicability::MachineApplicable,
                     );
                 }
+                BuiltinLintDiagnostics::AmbiguousGlobImports { diag } => {
+                    rustc_errors::report_ambiguity_error(db, diag);
+                }
                 BuiltinLintDiagnostics::AmbiguousGlobReexports { name, namespace, first_reexport_span, duplicate_reexport_span } => {
-                    db.span_label(first_reexport_span, format!("the name `{}` in the {} namespace is first re-exported here", name, namespace));
-                    db.span_label(duplicate_reexport_span, format!("but the name `{}` in the {} namespace is also re-exported here", name, namespace));
+                    db.span_label(first_reexport_span, format!("the name `{name}` in the {namespace} namespace is first re-exported here"));
+                    db.span_label(duplicate_reexport_span, format!("but the name `{name}` in the {namespace} namespace is also re-exported here"));
                 }
                 BuiltinLintDiagnostics::HiddenGlobReexports { name, namespace, glob_reexport_span, private_item_span } => {
-                    db.span_note(glob_reexport_span, format!("the name `{}` in the {} namespace is supposed to be publicly re-exported here", name, namespace));
+                    db.span_note(glob_reexport_span, format!("the name `{name}` in the {namespace} namespace is supposed to be publicly re-exported here"));
                     db.span_note(private_item_span, "but the private item here shadows it".to_owned());
                 }
                 BuiltinLintDiagnostics::UnusedQualifications { removal_span } => {
@@ -1281,8 +1282,8 @@ impl<'tcx> LateContext<'tcx> {
                 // This shouldn't ever be needed, but just in case:
                 with_no_trimmed_paths!({
                     Ok(vec![match trait_ref {
-                        Some(trait_ref) => Symbol::intern(&format!("{:?}", trait_ref)),
-                        None => Symbol::intern(&format!("<{}>", self_ty)),
+                        Some(trait_ref) => Symbol::intern(&format!("{trait_ref:?}")),
+                        None => Symbol::intern(&format!("<{self_ty}>")),
                     }])
                 })
             }
@@ -1306,7 +1307,7 @@ impl<'tcx> LateContext<'tcx> {
                         )))
                     }
                     None => {
-                        with_no_trimmed_paths!(Symbol::intern(&format!("<impl {}>", self_ty)))
+                        with_no_trimmed_paths!(Symbol::intern(&format!("<impl {self_ty}>")))
                     }
                 });
 
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index 0c80141a756..fb407be1f02 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -945,7 +945,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
                             );
                         }
                     } else {
-                        panic!("renamed lint does not exist: {}", new_name);
+                        panic!("renamed lint does not exist: {new_name}");
                     }
                 }
             }
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs
index beb38dbb94c..53089294fe2 100644
--- a/compiler/rustc_lint/src/lib.rs
+++ b/compiler/rustc_lint/src/lib.rs
@@ -50,7 +50,6 @@ extern crate tracing;
 
 mod array_into_iter;
 pub mod builtin;
-mod cast_ref_to_mut;
 mod context;
 mod deref_into_dyn_supertrait;
 mod drop_forget_useless;
@@ -78,6 +77,7 @@ mod opaque_hidden_inferred_bound;
 mod pass_by_value;
 mod passes;
 mod redundant_semicolon;
+mod reference_casting;
 mod traits;
 mod types;
 mod unused;
@@ -99,7 +99,6 @@ use rustc_span::Span;
 
 use array_into_iter::ArrayIntoIter;
 use builtin::*;
-use cast_ref_to_mut::*;
 use deref_into_dyn_supertrait::*;
 use drop_forget_useless::*;
 use enum_intrinsics_non_enums::EnumIntrinsicsNonEnums;
@@ -119,6 +118,7 @@ use noop_method_call::*;
 use opaque_hidden_inferred_bound::*;
 use pass_by_value::*;
 use redundant_semicolon::*;
+use reference_casting::*;
 use traits::*;
 use types::*;
 use unused::*;
@@ -218,7 +218,7 @@ late_lint_methods!(
             BoxPointers: BoxPointers,
             PathStatements: PathStatements,
             LetUnderscore: LetUnderscore,
-            CastRefToMut: CastRefToMut,
+            InvalidReferenceCasting: InvalidReferenceCasting,
             // Depends on referenced function signatures in expressions
             UnusedResults: UnusedResults,
             NonUpperCaseGlobals: NonUpperCaseGlobals,
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index 1dea758bb29..968172693a9 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -743,10 +743,10 @@ pub enum InvalidFromUtf8Diag {
     },
 }
 
-// cast_ref_to_mut.rs
+// reference_casting.rs
 #[derive(LintDiagnostic)]
-#[diag(lint_cast_ref_to_mut)]
-pub struct CastRefToMutDiag;
+#[diag(lint_invalid_reference_casting)]
+pub struct InvalidReferenceCastingDiag;
 
 // hidden_unicode_codepoints.rs
 #[derive(LintDiagnostic)]
@@ -776,7 +776,7 @@ impl AddToDiagnostic for HiddenUnicodeCodepointsDiagLabels {
         ) -> rustc_errors::SubdiagnosticMessage,
     {
         for (c, span) in self.spans {
-            diag.span_label(span, format!("{:?}", c));
+            diag.span_label(span, format!("{c:?}"));
         }
     }
 }
@@ -808,7 +808,7 @@ impl AddToDiagnostic for HiddenUnicodeCodepointsDiagSub {
                     spans
                         .into_iter()
                         .map(|(c, span)| {
-                            let c = format!("{:?}", c);
+                            let c = format!("{c:?}");
                             (span, c[1..c.len() - 1].to_string())
                         })
                         .collect(),
@@ -823,7 +823,7 @@ impl AddToDiagnostic for HiddenUnicodeCodepointsDiagSub {
                     "escaped",
                     spans
                         .into_iter()
-                        .map(|(c, _)| format!("{:?}", c))
+                        .map(|(c, _)| format!("{c:?}"))
                         .collect::<Vec<String>>()
                         .join(", "),
                 );
@@ -1231,8 +1231,9 @@ pub enum NonUpperCaseGlobalSub {
 #[note]
 pub struct NoopMethodCallDiag<'a> {
     pub method: Symbol,
-    pub receiver_ty: Ty<'a>,
-    #[label]
+    pub orig_ty: Ty<'a>,
+    pub trait_: Symbol,
+    #[suggestion(code = "", applicability = "machine-applicable")]
     pub label: Span,
 }
 
diff --git a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
index 53fe0ceb234..84558ee1f02 100644
--- a/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
+++ b/compiler/rustc_lint/src/multiple_supertrait_upcastable.rs
@@ -10,6 +10,7 @@ declare_lint! {
     /// ### Example
     ///
     /// ```rust
+    /// #![feature(multiple_supertrait_upcastable)]
     /// trait A {}
     /// trait B {}
     ///
diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs
index 13f650c2008..bc0b9d6d818 100644
--- a/compiler/rustc_lint/src/noop_method_call.rs
+++ b/compiler/rustc_lint/src/noop_method_call.rs
@@ -18,7 +18,6 @@ declare_lint! {
     ///
     /// ```rust
     /// # #![allow(unused)]
-    /// #![warn(noop_method_call)]
     /// struct Foo;
     /// let foo = &Foo;
     /// let clone: &Foo = foo.clone();
@@ -34,7 +33,7 @@ declare_lint! {
     /// calling `clone` on a `&T` where `T` does not implement clone, actually doesn't do anything
     /// as references are copy. This lint detects these calls and warns the user about them.
     pub NOOP_METHOD_CALL,
-    Allow,
+    Warn,
     "detects the use of well-known noop methods"
 }
 
@@ -86,10 +85,9 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
 
         let Some(trait_id) = cx.tcx.trait_of_item(did) else { return };
 
-        if !matches!(
-            cx.tcx.get_diagnostic_name(trait_id),
-            Some(sym::Borrow | sym::Clone | sym::Deref)
-        ) {
+        let Some(trait_) = cx.tcx.get_diagnostic_name(trait_id) else { return };
+
+        if !matches!(trait_, sym::Borrow | sym::Clone | sym::Deref) {
             return;
         };
 
@@ -114,11 +112,13 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
         let expr_span = expr.span;
         let span = expr_span.with_lo(receiver.span.hi());
 
+        let orig_ty = expr_ty.peel_refs();
+
         if receiver_ty == expr_ty {
             cx.emit_spanned_lint(
                 NOOP_METHOD_CALL,
                 span,
-                NoopMethodCallDiag { method: call.ident.name, receiver_ty, label: span },
+                NoopMethodCallDiag { method: call.ident.name, orig_ty, trait_, label: span },
             );
         } else {
             match name {
diff --git a/compiler/rustc_lint/src/cast_ref_to_mut.rs b/compiler/rustc_lint/src/reference_casting.rs
index 82bb70bc9e7..d343aaf35d5 100644
--- a/compiler/rustc_lint/src/cast_ref_to_mut.rs
+++ b/compiler/rustc_lint/src/reference_casting.rs
@@ -3,15 +3,16 @@ use rustc_hir::{Expr, ExprKind, MutTy, TyKind, UnOp};
 use rustc_middle::ty;
 use rustc_span::sym;
 
-use crate::{lints::CastRefToMutDiag, LateContext, LateLintPass, LintContext};
+use crate::{lints::InvalidReferenceCastingDiag, LateContext, LateLintPass, LintContext};
 
 declare_lint! {
-    /// The `cast_ref_to_mut` lint checks for casts of `&T` to `&mut T`
+    /// The `invalid_reference_casting` lint checks for casts of `&T` to `&mut T`
     /// without using interior mutability.
     ///
     /// ### Example
     ///
     /// ```rust,compile_fail
+    /// # #![deny(invalid_reference_casting)]
     /// fn x(r: &i32) {
     ///     unsafe {
     ///         *(r as *const i32 as *mut i32) += 1;
@@ -28,14 +29,14 @@ declare_lint! {
     ///
     /// `UnsafeCell` is the only way to obtain aliasable data that is considered
     /// mutable.
-    CAST_REF_TO_MUT,
-    Deny,
+    INVALID_REFERENCE_CASTING,
+    Allow,
     "casts of `&T` to `&mut T` without interior mutability"
 }
 
-declare_lint_pass!(CastRefToMut => [CAST_REF_TO_MUT]);
+declare_lint_pass!(InvalidReferenceCasting => [INVALID_REFERENCE_CASTING]);
 
-impl<'tcx> LateLintPass<'tcx> for CastRefToMut {
+impl<'tcx> LateLintPass<'tcx> for InvalidReferenceCasting {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
         let ExprKind::Unary(UnOp::Deref, e) = &expr.kind else {
             return;
@@ -68,7 +69,7 @@ impl<'tcx> LateLintPass<'tcx> for CastRefToMut {
 
         let e = e.peel_blocks();
         if let ty::Ref(..) = cx.typeck_results().node_type(e.hir_id).kind() {
-            cx.emit_spanned_lint(CAST_REF_TO_MUT, expr.span, CastRefToMutDiag);
+            cx.emit_spanned_lint(INVALID_REFERENCE_CASTING, expr.span, InvalidReferenceCastingDiag);
         }
     }
 }
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs
index f78da284a3a..a3c5ca4cda1 100644
--- a/compiler/rustc_lint/src/unused.rs
+++ b/compiler/rustc_lint/src/unused.rs
@@ -414,7 +414,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
             match path {
                 MustUsePath::Suppressed => {}
                 MustUsePath::Boxed(path) => {
-                    let descr_pre = &format!("{}boxed ", descr_pre);
+                    let descr_pre = &format!("{descr_pre}boxed ");
                     emit_must_use_untranslated(
                         cx,
                         path,
@@ -426,7 +426,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
                     );
                 }
                 MustUsePath::Opaque(path) => {
-                    let descr_pre = &format!("{}implementer{} of ", descr_pre, plural_suffix);
+                    let descr_pre = &format!("{descr_pre}implementer{plural_suffix} of ");
                     emit_must_use_untranslated(
                         cx,
                         path,
@@ -438,7 +438,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
                     );
                 }
                 MustUsePath::TraitObject(path) => {
-                    let descr_post = &format!(" trait object{}{}", plural_suffix, descr_post);
+                    let descr_post = &format!(" trait object{plural_suffix}{descr_post}");
                     emit_must_use_untranslated(
                         cx,
                         path,
@@ -451,7 +451,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
                 }
                 MustUsePath::TupleElement(elems) => {
                     for (index, path) in elems {
-                        let descr_post = &format!(" in tuple element {}", index);
+                        let descr_post = &format!(" in tuple element {index}");
                         emit_must_use_untranslated(
                             cx,
                             path,
@@ -464,7 +464,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
                     }
                 }
                 MustUsePath::Array(path, len) => {
-                    let descr_pre = &format!("{}array{} of ", descr_pre, plural_suffix);
+                    let descr_pre = &format!("{descr_pre}array{plural_suffix} of ");
                     emit_must_use_untranslated(
                         cx,
                         path,
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index a0f2e9aed81..7e3b6e9e218 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -3316,6 +3316,7 @@ declare_lint_pass! {
         // tidy-alphabetical-start
         ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
         AMBIGUOUS_ASSOCIATED_ITEMS,
+        AMBIGUOUS_GLOB_IMPORTS,
         AMBIGUOUS_GLOB_REEXPORTS,
         ARITHMETIC_OVERFLOW,
         ASM_SUB_REGISTER,
@@ -3400,6 +3401,7 @@ declare_lint_pass! {
         UNFULFILLED_LINT_EXPECTATIONS,
         UNINHABITED_STATIC,
         UNKNOWN_CRATE_TYPES,
+        UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
         UNKNOWN_LINTS,
         UNNAMEABLE_TYPES,
         UNREACHABLE_CODE,
@@ -4052,12 +4054,12 @@ declare_lint! {
     ///
     /// The compiler disables the automatic implementation if an explicit one
     /// exists for given type constructor. The exact rules governing this
-    /// are currently unsound, quite subtle, and will be modified in the future.
-    /// This change will cause the automatic implementation to be disabled in more
+    /// were previously unsound, quite subtle, and have been recently modified.
+    /// This change caused the automatic implementation to be disabled in more
     /// cases, potentially breaking some code.
     pub SUSPICIOUS_AUTO_TRAIT_IMPLS,
     Warn,
-    "the rules governing auto traits will change in the future",
+    "the rules governing auto traits have recently changed resulting in potential breakage",
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseSemanticsChange,
         reference: "issue #93367 <https://github.com/rust-lang/rust/issues/93367>",
@@ -4380,3 +4382,70 @@ declare_lint! {
     "effective visibility of a type is larger than the area in which it can be named",
     @feature_gate = sym::type_privacy_lints;
 }
+
+declare_lint! {
+    /// The `unknown_diagnostic_attributes` lint detects unrecognized diagnostic attributes.
+    ///
+    /// ### Example
+    ///
+    /// ```rust
+    /// #![feature(diagnostic_namespace)]
+    /// #[diagnostic::does_not_exist]
+    /// struct Foo;
+    /// ```
+    ///
+    /// {{produces}}
+    ///
+    /// ### Explanation
+    ///
+    /// It is usually a mistake to specify a diagnostic attribute that does not exist. Check
+    /// the spelling, and check the diagnostic attribute listing for the correct name. Also
+    /// consider if you are using an old version of the compiler, and the attribute
+    /// is only available in a newer version.
+    pub UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
+    Warn,
+    "unrecognized diagnostic attribute"
+}
+
+declare_lint! {
+    /// The `ambiguous_glob_imports` lint detects glob imports that should report ambiguity
+    /// errors, but previously didn't do that due to rustc bugs.
+    ///
+    /// ### Example
+    ///
+    /// ```rust,compile_fail
+    ///
+    /// #![deny(ambiguous_glob_imports)]
+    /// pub fn foo() -> u32 {
+    ///     use sub::*;
+    ///     C
+    /// }
+    ///
+    /// mod sub {
+    ///     mod mod1 { pub const C: u32 = 1; }
+    ///     mod mod2 { pub const C: u32 = 2; }
+    ///
+    ///     pub use mod1::*;
+    ///     pub use mod2::*;
+    /// }
+    /// ```
+    ///
+    /// {{produces}}
+    ///
+    /// ### Explanation
+    ///
+    /// Previous versions of Rust compile it successfully because it
+    /// had lost the ambiguity error when resolve `use sub::mod2::*`.
+    ///
+    /// This is a [future-incompatible] lint to transition this to a
+    /// hard error in the future.
+    ///
+    /// [future-incompatible]: ../index.md#future-incompatible-lints
+    pub AMBIGUOUS_GLOB_IMPORTS,
+    Warn,
+    "detects certain glob imports that require reporting an ambiguity error",
+    @future_incompatible = FutureIncompatibleInfo {
+        reason: FutureIncompatibilityReason::FutureReleaseError,
+        reference: "issue #114095 <https://github.com/rust-lang/rust/issues/114095>",
+    };
+}
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index 10ebe29dfce..f350957f72f 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -467,6 +467,21 @@ impl<HCX> ToStableHashKey<HCX> for LintId {
     }
 }
 
+#[derive(Debug)]
+pub struct AmbiguityErrorDiag {
+    pub msg: String,
+    pub span: Span,
+    pub label_span: Span,
+    pub label_msg: String,
+    pub note_msg: String,
+    pub b1_span: Span,
+    pub b1_note_msg: String,
+    pub b1_help_msgs: Vec<String>,
+    pub b2_span: Span,
+    pub b2_note_msg: String,
+    pub b2_help_msgs: Vec<String>,
+}
+
 // This could be a closure, but then implementing derive trait
 // becomes hacky (and it gets allocated).
 #[derive(Debug)]
@@ -530,6 +545,9 @@ pub enum BuiltinLintDiagnostics {
         vis_span: Span,
         ident_span: Span,
     },
+    AmbiguousGlobImports {
+        diag: AmbiguityErrorDiag,
+    },
     AmbiguousGlobReexports {
         /// The name for which collision(s) have occurred.
         name: String,
diff --git a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
index af6f4d5eaf9..ea045462845 100644
--- a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
+++ b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
@@ -92,10 +92,8 @@ enum LLVMRustAttribute {
   NoCfCheck = 35,
   ShadowCallStack = 36,
   AllocSize = 37,
-#if LLVM_VERSION_GE(15, 0)
   AllocatedPointer = 38,
   AllocAlign = 39,
-#endif
   SanitizeSafeStack = 40,
 };
 
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index 71df17c9ce7..ebf8a50ae8b 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -801,9 +801,6 @@ LLVMRustOptimize(
       OptimizerLastEPCallbacks.push_back(
         [SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
           auto CompileKernel = SanitizerOptions->SanitizeKernelAddress;
-#if LLVM_VERSION_LT(15, 0)
-          MPM.addPass(RequireAnalysisPass<ASanGlobalsMetadataAnalysis, Module>());
-#endif
           AddressSanitizerOptions opts = AddressSanitizerOptions{
             CompileKernel,
             SanitizerOptions->SanitizeAddressRecover
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index 870a2e02cba..f509e2911f3 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -277,12 +277,10 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
     return Attribute::ShadowCallStack;
   case AllocSize:
     return Attribute::AllocSize;
-#if LLVM_VERSION_GE(15, 0)
   case AllocatedPointer:
     return Attribute::AllocatedPointer;
   case AllocAlign:
     return Attribute::AllocAlign;
-#endif
   case SanitizeSafeStack:
     return Attribute::SafeStack;
   }
@@ -340,20 +338,12 @@ extern "C" LLVMAttributeRef LLVMRustCreateStructRetAttr(LLVMContextRef C, LLVMTy
 }
 
 extern "C" LLVMAttributeRef LLVMRustCreateElementTypeAttr(LLVMContextRef C, LLVMTypeRef Ty) {
-#if LLVM_VERSION_GE(15, 0)
   return wrap(Attribute::get(*unwrap(C), Attribute::ElementType, unwrap(Ty)));
-#else
-  report_fatal_error("Should not be needed on LLVM < 15");
-#endif
 }
 
 extern "C" LLVMAttributeRef LLVMRustCreateUWTableAttr(LLVMContextRef C, bool Async) {
-#if LLVM_VERSION_LT(15, 0)
-  return wrap(Attribute::get(*unwrap(C), Attribute::UWTable));
-#else
   return wrap(Attribute::getWithUWTableKind(
       *unwrap(C), Async ? UWTableKind::Async : UWTableKind::Sync));
-#endif
 }
 
 extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32_t ElementSizeArg) {
@@ -366,8 +356,6 @@ extern "C" LLVMAttributeRef LLVMRustCreateAllocSizeAttr(LLVMContextRef C, uint32
                                               ));
 }
 
-#if LLVM_VERSION_GE(15, 0)
-
 // These values **must** match ffi::AllocKindFlags.
 // It _happens_ to match the LLVM values of llvm::AllocFnKind,
 // but that's happenstance and we do explicit conversions before
@@ -411,16 +399,10 @@ static llvm::AllocFnKind allocKindFromRust(LLVMRustAllocKindFlags F) {
   }
   return AFK;
 }
-#endif
 
 extern "C" LLVMAttributeRef LLVMRustCreateAllocKindAttr(LLVMContextRef C, uint64_t AllocKindArg) {
-#if LLVM_VERSION_GE(15, 0)
   return wrap(Attribute::get(*unwrap(C), Attribute::AllocKind,
       static_cast<uint64_t>(allocKindFromRust(static_cast<LLVMRustAllocKindFlags>(AllocKindArg)))));
-#else
-  report_fatal_error(
-      "allockind attributes are new in LLVM 15 and should not be used on older LLVMs");
-#endif
 }
 
 // Simplified representation of `MemoryEffects` across the FFI boundary.
@@ -517,14 +499,9 @@ LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
 
 extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints,
                                         size_t ConstraintsLen) {
-#if LLVM_VERSION_LT(15, 0)
-  return InlineAsm::Verify(unwrap<FunctionType>(Ty),
-                           StringRef(Constraints, ConstraintsLen));
-#else
   // llvm::Error converts to true if it is an error.
   return !llvm::errorToBool(InlineAsm::verify(
       unwrap<FunctionType>(Ty), StringRef(Constraints, ConstraintsLen)));
-#endif
 }
 
 typedef DIBuilder *LLVMRustDIBuilderRef;
@@ -1649,19 +1626,11 @@ extern "C" bool LLVMRustConstInt128Get(LLVMValueRef CV, bool sext, uint64_t *hig
     auto C = unwrap<llvm::ConstantInt>(CV);
     if (C->getBitWidth() > 128) { return false; }
     APInt AP;
-#if LLVM_VERSION_GE(15, 0)
     if (sext) {
         AP = C->getValue().sext(128);
     } else {
         AP = C->getValue().zext(128);
     }
-#else
-    if (sext) {
-        AP = C->getValue().sextOrSelf(128);
-    } else {
-        AP = C->getValue().zextOrSelf(128);
-    }
-#endif
     *low = AP.getLoBits(64).getZExtValue();
     *high = AP.getHiBits(64).getZExtValue();
     return true;
@@ -2037,16 +2006,7 @@ extern "C" void LLVMRustGetMangledName(LLVMValueRef V, RustStringRef Str) {
   Mangler().getNameWithPrefix(OS, GV, true);
 }
 
-// LLVMGetAggregateElement was added in LLVM 15. For earlier LLVM versions just
-// use its implementation.
-#if LLVM_VERSION_LT(15, 0)
-extern "C" LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx) {
-    return wrap(unwrap<Constant>(C)->getAggregateElement(Idx));
-}
-#endif
-
 extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
-#if LLVM_VERSION_GE(15, 0)
     auto *CB = unwrap<CallBase>(CallSite);
     switch (CB->getIntrinsicID()) {
         case Intrinsic::arm_ldrex:
@@ -2054,7 +2014,6 @@ extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
         case Intrinsic::arm_strex:
             return 1;
     }
-#endif
     return -1;
 }
 
diff --git a/compiler/rustc_log/src/lib.rs b/compiler/rustc_log/src/lib.rs
index 3cbb2c21e28..e7b80c64184 100644
--- a/compiler/rustc_log/src/lib.rs
+++ b/compiler/rustc_log/src/lib.rs
@@ -123,7 +123,7 @@ where
             return Ok(());
         }
         let backtrace = std::backtrace::Backtrace::capture();
-        writeln!(writer, "stack backtrace: \n{:?}", backtrace)
+        writeln!(writer, "stack backtrace: \n{backtrace:?}")
     }
 }
 
diff --git a/compiler/rustc_macros/Cargo.toml b/compiler/rustc_macros/Cargo.toml
index 16c4a850012..17651ce9598 100644
--- a/compiler/rustc_macros/Cargo.toml
+++ b/compiler/rustc_macros/Cargo.toml
@@ -8,7 +8,6 @@ proc-macro = true
 
 [dependencies]
 synstructure = "0.13.0"
-# FIXME(Nilstrieb): Updating this causes changes in the diagnostics output.
-syn = { version = "=2.0.8", features = ["full"] }
+syn = { version = "2.0.9", features = ["full"] }
 proc-macro2 = "1"
 quote = "1"
diff --git a/compiler/rustc_macros/src/serialize.rs b/compiler/rustc_macros/src/serialize.rs
index 8d017d149f6..f1e7b8eb6c7 100644
--- a/compiler/rustc_macros/src/serialize.rs
+++ b/compiler/rustc_macros/src/serialize.rs
@@ -43,7 +43,7 @@ fn decodable_body(
     let ty_name = s.ast().ident.to_string();
     let decode_body = match s.variants() {
         [] => {
-            let message = format!("`{}` has no variants to decode", ty_name);
+            let message = format!("`{ty_name}` has no variants to decode");
             quote! {
                 panic!(#message)
             }
diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs
index 44195996762..fb9dd660d2f 100644
--- a/compiler/rustc_metadata/src/locator.rs
+++ b/compiler/rustc_metadata/src/locator.rs
@@ -908,7 +908,7 @@ pub fn list_file_metadata(
     let flavor = get_flavor_from_path(path);
     match get_metadata_section(target, flavor, path, metadata_loader) {
         Ok(metadata) => metadata.list_crate_metadata(out),
-        Err(msg) => write!(out, "{}\n", msg),
+        Err(msg) => write!(out, "{msg}\n"),
     }
 }
 
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
index a8815ee0908..7dbfe0e0cb0 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
@@ -246,6 +246,7 @@ provide! { tcx, def_id, other, cdata,
         debug_assert_eq!(tcx.def_kind(def_id), DefKind::OpaqueTy);
         cdata.root.tables.is_type_alias_impl_trait.get(cdata, def_id.index)
     }
+    assumed_wf_types_for_rpitit => { table }
     collect_return_position_impl_trait_in_trait_tys => {
         Ok(cdata
             .root
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs
index 8f065dd6b58..d72053ca985 100644
--- a/compiler/rustc_metadata/src/rmeta/encoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/encoder.rs
@@ -1144,13 +1144,7 @@ fn should_encode_type(tcx: TyCtxt<'_>, def_id: LocalDefId, def_kind: DefKind) ->
             let assoc_item = tcx.associated_item(def_id);
             match assoc_item.container {
                 ty::AssocItemContainer::ImplContainer => true,
-                // Always encode RPITITs, since we need to be able to project
-                // from an RPITIT associated item to an opaque when installing
-                // the default projection predicates in default trait methods
-                // with RPITITs.
-                ty::AssocItemContainer::TraitContainer => {
-                    assoc_item.defaultness(tcx).has_value() || assoc_item.is_impl_trait_in_trait()
-                }
+                ty::AssocItemContainer::TraitContainer => assoc_item.defaultness(tcx).has_value(),
             }
         }
         DefKind::TyParam => {
@@ -1560,6 +1554,12 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
         }
         if let Some(rpitit_info) = item.opt_rpitit_info {
             record!(self.tables.opt_rpitit_info[def_id] <- rpitit_info);
+            if matches!(rpitit_info, ty::ImplTraitInTraitData::Trait { .. }) {
+                record_array!(
+                    self.tables.assumed_wf_types_for_rpitit[def_id]
+                        <- self.tcx.assumed_wf_types_for_rpitit(def_id)
+                );
+            }
         }
     }
 
diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs
index 0bc16fc64ff..a89e235ff28 100644
--- a/compiler/rustc_metadata/src/rmeta/mod.rs
+++ b/compiler/rustc_metadata/src/rmeta/mod.rs
@@ -51,7 +51,7 @@ mod encoder;
 mod table;
 
 pub(crate) fn rustc_version(cfg_version: &'static str) -> String {
-    format!("rustc {}", cfg_version)
+    format!("rustc {cfg_version}")
 }
 
 /// Metadata encoding version.
@@ -457,6 +457,7 @@ define_tables! {
     trait_impl_trait_tys: Table<DefIndex, LazyValue<FxHashMap<DefId, ty::EarlyBinder<Ty<'static>>>>>,
     doc_link_resolutions: Table<DefIndex, LazyValue<DocLinkResMap>>,
     doc_link_traits_in_scope: Table<DefIndex, LazyArray<DefId>>,
+    assumed_wf_types_for_rpitit: Table<DefIndex, LazyArray<(Ty<'static>, Span)>>,
 }
 
 #[derive(TyEncodable, TyDecodable)]
diff --git a/compiler/rustc_middle/Cargo.toml b/compiler/rustc_middle/Cargo.toml
index 4c238308fe8..bb8e774cea3 100644
--- a/compiler/rustc_middle/Cargo.toml
+++ b/compiler/rustc_middle/Cargo.toml
@@ -13,7 +13,7 @@ gsgdt = "0.1.2"
 field-offset = "0.3.5"
 measureme = "10.0.0"
 polonius-engine = "0.13.0"
-rustc_apfloat = { path = "../rustc_apfloat" }
+rustc_apfloat = "0.2.0"
 rustc_arena = { path = "../rustc_arena" }
 rustc_ast = { path = "../rustc_ast" }
 rustc_attr = { path = "../rustc_attr" }
diff --git a/compiler/rustc_middle/messages.ftl b/compiler/rustc_middle/messages.ftl
index bb7147ac80f..108a10b506b 100644
--- a/compiler/rustc_middle/messages.ftl
+++ b/compiler/rustc_middle/messages.ftl
@@ -52,6 +52,9 @@ middle_drop_check_overflow =
     overflow while adding drop-check rules for {$ty}
     .note = overflowed on {$overflow_ty}
 
+middle_layout_references_error =
+    the type has an unknown layout
+
 middle_limit_invalid =
     `limit` must be a non-negative integer
     .label = {$error_str}
diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs
index 2dc5b896993..4e242c684e3 100644
--- a/compiler/rustc_middle/src/dep_graph/dep_node.rs
+++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs
@@ -380,7 +380,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for HirId {
             let local_id = local_id
                 .as_u64()
                 .try_into()
-                .unwrap_or_else(|_| panic!("local id should be u32, found {:?}", local_id));
+                .unwrap_or_else(|_| panic!("local id should be u32, found {local_id:?}"));
             Some(HirId { owner: OwnerId { def_id }, local_id: ItemLocalId::from_u32(local_id) })
         } else {
             None
diff --git a/compiler/rustc_middle/src/dep_graph/mod.rs b/compiler/rustc_middle/src/dep_graph/mod.rs
index 0ddbe7d1c29..3ad9b0d79e7 100644
--- a/compiler/rustc_middle/src/dep_graph/mod.rs
+++ b/compiler/rustc_middle/src/dep_graph/mod.rs
@@ -35,7 +35,7 @@ impl rustc_query_system::dep_graph::DepKind for DepKind {
                 if let Some(def_id) = node.extract_def_id(tcx) {
                     write!(f, "{}", tcx.def_path_debug_str(def_id))?;
                 } else if let Some(ref s) = tcx.dep_graph.dep_node_debug_str(*node) {
-                    write!(f, "{}", s)?;
+                    write!(f, "{s}")?;
                 } else {
                     write!(f, "{}", node.hash)?;
                 }
diff --git a/compiler/rustc_middle/src/error.rs b/compiler/rustc_middle/src/error.rs
index 57b2de84b47..b346cd45391 100644
--- a/compiler/rustc_middle/src/error.rs
+++ b/compiler/rustc_middle/src/error.rs
@@ -132,6 +132,9 @@ pub enum LayoutError<'tcx> {
 
     #[diag(middle_cycle)]
     Cycle,
+
+    #[diag(middle_layout_references_error)]
+    ReferencesError,
 }
 
 #[derive(Diagnostic)]
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs
index 1fd68dc5cb2..0256e09e4b5 100644
--- a/compiler/rustc_middle/src/hir/map/mod.rs
+++ b/compiler/rustc_middle/src/hir/map/mod.rs
@@ -24,7 +24,7 @@ pub fn associated_body(node: Node<'_>) -> Option<(LocalDefId, BodyId)> {
     match node {
         Node::Item(Item {
             owner_id,
-            kind: ItemKind::Const(_, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body),
+            kind: ItemKind::Const(_, _, body) | ItemKind::Static(.., body) | ItemKind::Fn(.., body),
             ..
         })
         | Node::TraitItem(TraitItem {
@@ -534,7 +534,7 @@ impl<'hir> Map<'hir> {
                 (m, span, hir_id)
             }
             Some(OwnerNode::Crate(item)) => (item, item.spans.inner_span, hir_id),
-            node => panic!("not a module: {:?}", node),
+            node => panic!("not a module: {node:?}"),
         }
     }
 
diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs
index 6ce1ad8f43e..9ecc7580f5c 100644
--- a/compiler/rustc_middle/src/lint.rs
+++ b/compiler/rustc_middle/src/lint.rs
@@ -218,14 +218,12 @@ pub fn explain_lint_level_source(
             let hyphen_case_lint_name = name.replace('_', "-");
             if lint_flag_val.as_str() == name {
                 err.note_once(format!(
-                    "requested on the command line with `{} {}`",
-                    flag, hyphen_case_lint_name
+                    "requested on the command line with `{flag} {hyphen_case_lint_name}`"
                 ));
             } else {
                 let hyphen_case_flag_val = lint_flag_val.as_str().replace('_', "-");
                 err.note_once(format!(
-                    "`{} {}` implied by `{} {}`",
-                    flag, hyphen_case_lint_name, flag, hyphen_case_flag_val
+                    "`{flag} {hyphen_case_lint_name}` implied by `{flag} {hyphen_case_flag_val}`"
                 ));
             }
         }
@@ -237,8 +235,7 @@ pub fn explain_lint_level_source(
             if lint_attr_name.as_str() != name {
                 let level_str = level.as_str();
                 err.note_once(format!(
-                    "`#[{}({})]` implied by `#[{}({})]`",
-                    level_str, name, level_str, lint_attr_name
+                    "`#[{level_str}({name})]` implied by `#[{level_str}({lint_attr_name})]`"
                 ));
             }
         }
@@ -416,12 +413,11 @@ pub fn struct_lint_level(
                 FutureIncompatibilityReason::EditionError(edition) => {
                     let current_edition = sess.edition();
                     format!(
-                        "this is accepted in the current edition (Rust {}) but is a hard error in Rust {}!",
-                        current_edition, edition
+                        "this is accepted in the current edition (Rust {current_edition}) but is a hard error in Rust {edition}!"
                     )
                 }
                 FutureIncompatibilityReason::EditionSemanticsChange(edition) => {
-                    format!("this changes meaning in Rust {}", edition)
+                    format!("this changes meaning in Rust {edition}")
                 }
                 FutureIncompatibilityReason::Custom(reason) => reason.to_owned(),
             };
diff --git a/compiler/rustc_middle/src/middle/privacy.rs b/compiler/rustc_middle/src/middle/privacy.rs
index 5baeb1ee0cf..1913421f54c 100644
--- a/compiler/rustc_middle/src/middle/privacy.rs
+++ b/compiler/rustc_middle/src/middle/privacy.rs
@@ -178,7 +178,12 @@ impl EffectiveVisibilities {
             // All effective visibilities except `reachable_through_impl_trait` are limited to
             // nominal visibility. For some items nominal visibility doesn't make sense so we
             // don't check this condition for them.
-            if !matches!(tcx.def_kind(def_id), DefKind::Impl { .. }) {
+            let is_impl = matches!(tcx.def_kind(def_id), DefKind::Impl { .. });
+            let is_associated_item_in_trait_impl = tcx
+                .impl_of_method(def_id.to_def_id())
+                .and_then(|impl_id| tcx.trait_id_of_impl(impl_id))
+                .is_some();
+            if !is_impl && !is_associated_item_in_trait_impl {
                 let nominal_vis = tcx.visibility(def_id);
                 if !nominal_vis.is_at_least(ev.reachable, tcx) {
                     span_bug!(
@@ -186,7 +191,7 @@ impl EffectiveVisibilities {
                         "{:?}: reachable {:?} > nominal {:?}",
                         def_id,
                         ev.reachable,
-                        nominal_vis
+                        nominal_vis,
                     );
                 }
             }
diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs
index 60844c17e47..908ab8b613e 100644
--- a/compiler/rustc_middle/src/middle/stability.rs
+++ b/compiler/rustc_middle/src/middle/stability.rs
@@ -107,7 +107,7 @@ pub fn report_unstable(
     soft_handler: impl FnOnce(&'static Lint, Span, String),
 ) {
     let msg = match reason {
-        Some(r) => format!("use of unstable library feature '{}': {}", feature, r),
+        Some(r) => format!("use of unstable library feature '{feature}': {r}"),
         None => format!("use of unstable library feature '{}'", &feature),
     };
 
@@ -170,7 +170,7 @@ pub fn deprecation_suggestion(
     if let Some(suggestion) = suggestion {
         diag.span_suggestion_verbose(
             span,
-            format!("replace the use of the deprecated {}", kind),
+            format!("replace the use of the deprecated {kind}"),
             suggestion,
             Applicability::MachineApplicable,
         );
@@ -189,12 +189,12 @@ fn deprecation_message(
     path: &str,
 ) -> String {
     let message = if is_in_effect {
-        format!("use of deprecated {} `{}`", kind, path)
+        format!("use of deprecated {kind} `{path}`")
     } else {
         let since = since.as_ref().map(Symbol::as_str);
 
         if since == Some("TBD") {
-            format!("use of {} `{}` that will be deprecated in a future Rust version", kind, path)
+            format!("use of {kind} `{path}` that will be deprecated in a future Rust version")
         } else {
             format!(
                 "use of {} `{}` that will be deprecated in future version {}",
@@ -206,7 +206,7 @@ fn deprecation_message(
     };
 
     match note {
-        Some(reason) => format!("{}: {}", message, reason),
+        Some(reason) => format!("{message}: {reason}"),
         None => message,
     }
 }
@@ -312,7 +312,7 @@ fn suggestion_for_allocator_api(
                     return Some((
                         inner_types,
                         "consider wrapping the inner types in tuple".to_string(),
-                        format!("({})", snippet),
+                        format!("({snippet})"),
                         Applicability::MaybeIncorrect,
                     ));
                 }
@@ -599,7 +599,7 @@ impl<'tcx> TyCtxt<'tcx> {
             |span, def_id| {
                 // The API could be uncallable for other reasons, for example when a private module
                 // was referenced.
-                self.sess.delay_span_bug(span, format!("encountered unmarked API: {:?}", def_id));
+                self.sess.delay_span_bug(span, format!("encountered unmarked API: {def_id:?}"));
             },
         )
     }
diff --git a/compiler/rustc_middle/src/mir/generic_graph.rs b/compiler/rustc_middle/src/mir/generic_graph.rs
index d1f3561c02c..d1753427e74 100644
--- a/compiler/rustc_middle/src/mir/generic_graph.rs
+++ b/compiler/rustc_middle/src/mir/generic_graph.rs
@@ -7,7 +7,7 @@ use rustc_middle::ty::TyCtxt;
 pub fn mir_fn_to_generic_graph<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'_>) -> Graph {
     let def_id = body.source.def_id();
     let def_name = graphviz_safe_def_name(def_id);
-    let graph_name = format!("Mir_{}", def_name);
+    let graph_name = format!("Mir_{def_name}");
     let dark_mode = tcx.sess.opts.unstable_opts.graphviz_dark_mode;
 
     // Nodes
@@ -48,7 +48,7 @@ fn bb_to_graph_node(block: BasicBlock, body: &Body<'_>, dark_mode: bool) -> Node
     };
 
     let style = NodeStyle { title_bg: Some(bgcolor.to_owned()), ..Default::default() };
-    let mut stmts: Vec<String> = data.statements.iter().map(|x| format!("{:?}", x)).collect();
+    let mut stmts: Vec<String> = data.statements.iter().map(|x| format!("{x:?}")).collect();
 
     // add the terminator to the stmts, gsgdt can print it out separately
     let mut terminator_head = String::new();
diff --git a/compiler/rustc_middle/src/mir/generic_graphviz.rs b/compiler/rustc_middle/src/mir/generic_graphviz.rs
index ccae7e159b1..299b50525cb 100644
--- a/compiler/rustc_middle/src/mir/generic_graphviz.rs
+++ b/compiler/rustc_middle/src/mir/generic_graphviz.rs
@@ -70,8 +70,8 @@ impl<
 
         writeln!(w, r#"    graph [{}];"#, graph_attrs.join(" "))?;
         let content_attrs_str = content_attrs.join(" ");
-        writeln!(w, r#"    node [{}];"#, content_attrs_str)?;
-        writeln!(w, r#"    edge [{}];"#, content_attrs_str)?;
+        writeln!(w, r#"    node [{content_attrs_str}];"#)?;
+        writeln!(w, r#"    edge [{content_attrs_str}];"#)?;
 
         // Graph label
         if let Some(graph_label) = &self.graph_label {
@@ -112,7 +112,7 @@ impl<
         //     (format!("{:?}", node), color)
         // };
         let color = if dark_mode { "dimgray" } else { "gray" };
-        let (blk, bgcolor) = (format!("{:?}", node), color);
+        let (blk, bgcolor) = (format!("{node:?}"), color);
         write!(
             w,
             r#"<tr><td bgcolor="{bgcolor}" {attrs} colspan="{colspan}">{blk}</td></tr>"#,
@@ -151,7 +151,7 @@ impl<
             } else {
                 "".to_owned()
             };
-            writeln!(w, r#"    {} -> {} [label=<{}>];"#, src, trg, escaped_edge_label)?;
+            writeln!(w, r#"    {src} -> {trg} [label=<{escaped_edge_label}>];"#)?;
         }
         Ok(())
     }
@@ -163,7 +163,7 @@ impl<
         W: Write,
     {
         let escaped_label = dot::escape_html(label);
-        writeln!(w, r#"    label=<<br/><br/>{}<br align="left"/><br/><br/><br/>>;"#, escaped_label)
+        writeln!(w, r#"    label=<<br/><br/>{escaped_label}<br align="left"/><br/><br/><br/>>;"#)
     }
 
     fn node(&self, node: G::Node) -> String {
diff --git a/compiler/rustc_middle/src/mir/graphviz.rs b/compiler/rustc_middle/src/mir/graphviz.rs
index 2de73db3a3c..5c7de864430 100644
--- a/compiler/rustc_middle/src/mir/graphviz.rs
+++ b/compiler/rustc_middle/src/mir/graphviz.rs
@@ -127,5 +127,5 @@ fn write_graph_label<'tcx, W: std::fmt::Write>(
 }
 
 fn escape<T: Debug>(t: &T) -> String {
-    dot::escape_html(&format!("{:?}", t))
+    dot::escape_html(&format!("{t:?}"))
 }
diff --git a/compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs b/compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs
index d4dd56a42c1..2c6bb908f39 100644
--- a/compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs
+++ b/compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs
@@ -542,11 +542,7 @@ impl InitMaskMaterialized {
         debug_assert_eq!(
             result,
             find_bit_slow(self, start, end, is_init),
-            "optimized implementation of find_bit is wrong for start={:?} end={:?} is_init={} init_mask={:#?}",
-            start,
-            end,
-            is_init,
-            self
+            "optimized implementation of find_bit is wrong for start={start:?} end={end:?} is_init={is_init} init_mask={self:#?}"
         );
 
         result
diff --git a/compiler/rustc_middle/src/mir/interpret/error.rs b/compiler/rustc_middle/src/mir/interpret/error.rs
index 6161b16fc46..d44dfa2172a 100644
--- a/compiler/rustc_middle/src/mir/interpret/error.rs
+++ b/compiler/rustc_middle/src/mir/interpret/error.rs
@@ -155,7 +155,7 @@ impl<'tcx> InterpErrorInfo<'tcx> {
 }
 
 fn print_backtrace(backtrace: &Backtrace) {
-    eprintln!("\n\nAn error occurred in miri:\n{}", backtrace);
+    eprintln!("\n\nAn error occurred in miri:\n{backtrace}");
 }
 
 impl From<ErrorGuaranteed> for InterpErrorInfo<'_> {
diff --git a/compiler/rustc_middle/src/mir/interpret/mod.rs b/compiler/rustc_middle/src/mir/interpret/mod.rs
index 69c15e9cc06..8b5a8d17301 100644
--- a/compiler/rustc_middle/src/mir/interpret/mod.rs
+++ b/compiler/rustc_middle/src/mir/interpret/mod.rs
@@ -176,7 +176,7 @@ impl<'tcx> GlobalId<'tcx> {
     pub fn display(self, tcx: TyCtxt<'tcx>) -> String {
         let instance_name = with_no_trimmed_paths!(tcx.def_path_str(self.instance.def.def_id()));
         if let Some(promoted) = self.promoted {
-            format!("{}::{:?}", instance_name, promoted)
+            format!("{instance_name}::{promoted:?}")
         } else {
             instance_name
         }
diff --git a/compiler/rustc_middle/src/mir/interpret/queries.rs b/compiler/rustc_middle/src/mir/interpret/queries.rs
index c9db0e7c11d..fc659ce18a4 100644
--- a/compiler/rustc_middle/src/mir/interpret/queries.rs
+++ b/compiler/rustc_middle/src/mir/interpret/queries.rs
@@ -139,7 +139,6 @@ impl<'tcx> TyCtxt<'tcx> {
         cid: GlobalId<'tcx>,
         span: Option<Span>,
     ) -> EvalToConstValueResult<'tcx> {
-        let param_env = param_env.with_const();
         // Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
         // improve caching of queries.
         let inputs = self.erase_regions(param_env.and(cid));
@@ -158,8 +157,6 @@ impl<'tcx> TyCtxt<'tcx> {
         cid: GlobalId<'tcx>,
         span: Option<Span>,
     ) -> EvalToValTreeResult<'tcx> {
-        let param_env = param_env.with_const();
-        debug!(?param_env);
         // Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
         // improve caching of queries.
         let inputs = self.erase_regions(param_env.and(cid));
@@ -204,7 +201,6 @@ impl<'tcx> TyCtxtAt<'tcx> {
         gid: GlobalId<'tcx>,
         param_env: ty::ParamEnv<'tcx>,
     ) -> Result<mir::ConstAllocation<'tcx>, ErrorHandled> {
-        let param_env = param_env.with_const();
         trace!("eval_to_allocation: Need to compute {:?}", gid);
         let raw_const = self.eval_to_allocation_raw(param_env.and(gid))?;
         Ok(self.global_alloc(raw_const.alloc_id).unwrap_memory())
@@ -224,8 +220,7 @@ impl<'tcx> TyCtxtEnsure<'tcx> {
         let args = GenericArgs::identity_for_item(self.tcx, def_id);
         let instance = ty::Instance::new(def_id, args);
         let cid = GlobalId { instance, promoted: None };
-        let param_env =
-            self.tcx.param_env(def_id).with_reveal_all_normalized(self.tcx).with_const();
+        let param_env = self.tcx.param_env(def_id).with_reveal_all_normalized(self.tcx);
         // Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
         // improve caching of queries.
         let inputs = self.tcx.erase_regions(param_env.and(cid));
@@ -238,7 +233,7 @@ impl<'tcx> TyCtxtEnsure<'tcx> {
         assert!(self.tcx.is_static(def_id));
         let instance = ty::Instance::mono(self.tcx, def_id);
         let gid = GlobalId { instance, promoted: None };
-        let param_env = ty::ParamEnv::reveal_all().with_const();
+        let param_env = ty::ParamEnv::reveal_all();
         trace!("eval_to_allocation: Need to compute {:?}", gid);
         self.eval_to_allocation_raw(param_env.and(gid))
     }
diff --git a/compiler/rustc_middle/src/mir/interpret/value.rs b/compiler/rustc_middle/src/mir/interpret/value.rs
index 47421d0f037..20861d5ffa4 100644
--- a/compiler/rustc_middle/src/mir/interpret/value.rs
+++ b/compiler/rustc_middle/src/mir/interpret/value.rs
@@ -135,8 +135,8 @@ static_assert_size!(Scalar, 24);
 impl<Prov: Provenance> fmt::Debug for Scalar<Prov> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            Scalar::Ptr(ptr, _size) => write!(f, "{:?}", ptr),
-            Scalar::Int(int) => write!(f, "{:?}", int),
+            Scalar::Ptr(ptr, _size) => write!(f, "{ptr:?}"),
+            Scalar::Int(int) => write!(f, "{int:?}"),
         }
     }
 }
@@ -144,8 +144,8 @@ impl<Prov: Provenance> fmt::Debug for Scalar<Prov> {
 impl<Prov: Provenance> fmt::Display for Scalar<Prov> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            Scalar::Ptr(ptr, _size) => write!(f, "pointer to {:?}", ptr),
-            Scalar::Int(int) => write!(f, "{}", int),
+            Scalar::Ptr(ptr, _size) => write!(f, "pointer to {ptr:?}"),
+            Scalar::Int(int) => write!(f, "{int}"),
         }
     }
 }
@@ -153,8 +153,8 @@ impl<Prov: Provenance> fmt::Display for Scalar<Prov> {
 impl<Prov: Provenance> fmt::LowerHex for Scalar<Prov> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            Scalar::Ptr(ptr, _size) => write!(f, "pointer to {:?}", ptr),
-            Scalar::Int(int) => write!(f, "{:#x}", int),
+            Scalar::Ptr(ptr, _size) => write!(f, "pointer to {ptr:?}"),
+            Scalar::Int(int) => write!(f, "{int:#x}"),
         }
     }
 }
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 3a958548515..c1f87d79b83 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -619,7 +619,7 @@ impl<D: TyDecoder, T: Decodable<D>> Decodable<D> for ClearCrossCrate<T> {
                 let val = T::decode(d);
                 ClearCrossCrate::Set(val)
             }
-            tag => panic!("Invalid tag for ClearCrossCrate: {:?}", tag),
+            tag => panic!("Invalid tag for ClearCrossCrate: {tag:?}"),
         }
     }
 }
@@ -1046,12 +1046,12 @@ pub enum VarDebugInfoContents<'tcx> {
 impl<'tcx> Debug for VarDebugInfoContents<'tcx> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         match self {
-            VarDebugInfoContents::Const(c) => write!(fmt, "{}", c),
-            VarDebugInfoContents::Place(p) => write!(fmt, "{:?}", p),
+            VarDebugInfoContents::Const(c) => write!(fmt, "{c}"),
+            VarDebugInfoContents::Place(p) => write!(fmt, "{p:?}"),
             VarDebugInfoContents::Composite { ty, fragments } => {
-                write!(fmt, "{:?}{{ ", ty)?;
+                write!(fmt, "{ty:?}{{ ")?;
                 for f in fragments.iter() {
-                    write!(fmt, "{:?}, ", f)?;
+                    write!(fmt, "{f:?}, ")?;
                 }
                 write!(fmt, "}}")
             }
@@ -1315,55 +1315,47 @@ impl<O> AssertKind<O> {
         match self {
             BoundsCheck { ref len, ref index } => write!(
                 f,
-                "\"index out of bounds: the length is {{}} but the index is {{}}\", {:?}, {:?}",
-                len, index
+                "\"index out of bounds: the length is {{}} but the index is {{}}\", {len:?}, {index:?}"
             ),
 
             OverflowNeg(op) => {
-                write!(f, "\"attempt to negate `{{}}`, which would overflow\", {:?}", op)
+                write!(f, "\"attempt to negate `{{}}`, which would overflow\", {op:?}")
             }
-            DivisionByZero(op) => write!(f, "\"attempt to divide `{{}}` by zero\", {:?}", op),
+            DivisionByZero(op) => write!(f, "\"attempt to divide `{{}}` by zero\", {op:?}"),
             RemainderByZero(op) => write!(
                 f,
-                "\"attempt to calculate the remainder of `{{}}` with a divisor of zero\", {:?}",
-                op
+                "\"attempt to calculate the remainder of `{{}}` with a divisor of zero\", {op:?}"
             ),
             Overflow(BinOp::Add, l, r) => write!(
                 f,
-                "\"attempt to compute `{{}} + {{}}`, which would overflow\", {:?}, {:?}",
-                l, r
+                "\"attempt to compute `{{}} + {{}}`, which would overflow\", {l:?}, {r:?}"
             ),
             Overflow(BinOp::Sub, l, r) => write!(
                 f,
-                "\"attempt to compute `{{}} - {{}}`, which would overflow\", {:?}, {:?}",
-                l, r
+                "\"attempt to compute `{{}} - {{}}`, which would overflow\", {l:?}, {r:?}"
             ),
             Overflow(BinOp::Mul, l, r) => write!(
                 f,
-                "\"attempt to compute `{{}} * {{}}`, which would overflow\", {:?}, {:?}",
-                l, r
+                "\"attempt to compute `{{}} * {{}}`, which would overflow\", {l:?}, {r:?}"
             ),
             Overflow(BinOp::Div, l, r) => write!(
                 f,
-                "\"attempt to compute `{{}} / {{}}`, which would overflow\", {:?}, {:?}",
-                l, r
+                "\"attempt to compute `{{}} / {{}}`, which would overflow\", {l:?}, {r:?}"
             ),
             Overflow(BinOp::Rem, l, r) => write!(
                 f,
-                "\"attempt to compute the remainder of `{{}} % {{}}`, which would overflow\", {:?}, {:?}",
-                l, r
+                "\"attempt to compute the remainder of `{{}} % {{}}`, which would overflow\", {l:?}, {r:?}"
             ),
             Overflow(BinOp::Shr, _, r) => {
-                write!(f, "\"attempt to shift right by `{{}}`, which would overflow\", {:?}", r)
+                write!(f, "\"attempt to shift right by `{{}}`, which would overflow\", {r:?}")
             }
             Overflow(BinOp::Shl, _, r) => {
-                write!(f, "\"attempt to shift left by `{{}}`, which would overflow\", {:?}", r)
+                write!(f, "\"attempt to shift left by `{{}}`, which would overflow\", {r:?}")
             }
             MisalignedPointerDereference { required, found } => {
                 write!(
                     f,
-                    "\"misaligned pointer dereference: address must be a multiple of {{}} but is {{}}\", {:?}, {:?}",
-                    required, found
+                    "\"misaligned pointer dereference: address must be a multiple of {{}} but is {{}}\", {required:?}, {found:?}"
                 )
             }
             _ => write!(f, "\"{}\"", self.description()),
@@ -1459,9 +1451,9 @@ impl Debug for Statement<'_> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::StatementKind::*;
         match self.kind {
-            Assign(box (ref place, ref rv)) => write!(fmt, "{:?} = {:?}", place, rv),
+            Assign(box (ref place, ref rv)) => write!(fmt, "{place:?} = {rv:?}"),
             FakeRead(box (ref cause, ref place)) => {
-                write!(fmt, "FakeRead({:?}, {:?})", cause, place)
+                write!(fmt, "FakeRead({cause:?}, {place:?})")
             }
             Retag(ref kind, ref place) => write!(
                 fmt,
@@ -1474,20 +1466,20 @@ impl Debug for Statement<'_> {
                 },
                 place,
             ),
-            StorageLive(ref place) => write!(fmt, "StorageLive({:?})", place),
-            StorageDead(ref place) => write!(fmt, "StorageDead({:?})", place),
+            StorageLive(ref place) => write!(fmt, "StorageLive({place:?})"),
+            StorageDead(ref place) => write!(fmt, "StorageDead({place:?})"),
             SetDiscriminant { ref place, variant_index } => {
-                write!(fmt, "discriminant({:?}) = {:?}", place, variant_index)
+                write!(fmt, "discriminant({place:?}) = {variant_index:?}")
             }
-            Deinit(ref place) => write!(fmt, "Deinit({:?})", place),
+            Deinit(ref place) => write!(fmt, "Deinit({place:?})"),
             PlaceMention(ref place) => {
-                write!(fmt, "PlaceMention({:?})", place)
+                write!(fmt, "PlaceMention({place:?})")
             }
             AscribeUserType(box (ref place, ref c_ty), ref variance) => {
-                write!(fmt, "AscribeUserType({:?}, {:?}, {:?})", place, variance, c_ty)
+                write!(fmt, "AscribeUserType({place:?}, {variance:?}, {c_ty:?})")
             }
             Coverage(box self::Coverage { ref kind, code_region: Some(ref rgn) }) => {
-                write!(fmt, "Coverage::{:?} for {:?}", kind, rgn)
+                write!(fmt, "Coverage::{kind:?} for {rgn:?}")
             }
             Coverage(box ref coverage) => write!(fmt, "Coverage::{:?}", coverage.kind),
             Intrinsic(box ref intrinsic) => write!(fmt, "{intrinsic}"),
@@ -1767,13 +1759,13 @@ impl Debug for Place<'_> {
         for elem in self.projection.iter() {
             match elem {
                 ProjectionElem::OpaqueCast(ty) => {
-                    write!(fmt, " as {})", ty)?;
+                    write!(fmt, " as {ty})")?;
                 }
                 ProjectionElem::Downcast(Some(name), _index) => {
-                    write!(fmt, " as {})", name)?;
+                    write!(fmt, " as {name})")?;
                 }
                 ProjectionElem::Downcast(None, index) => {
-                    write!(fmt, " as variant#{:?})", index)?;
+                    write!(fmt, " as variant#{index:?})")?;
                 }
                 ProjectionElem::Deref => {
                     write!(fmt, ")")?;
@@ -1782,25 +1774,25 @@ impl Debug for Place<'_> {
                     write!(fmt, ".{:?}: {:?})", field.index(), ty)?;
                 }
                 ProjectionElem::Index(ref index) => {
-                    write!(fmt, "[{:?}]", index)?;
+                    write!(fmt, "[{index:?}]")?;
                 }
                 ProjectionElem::ConstantIndex { offset, min_length, from_end: false } => {
-                    write!(fmt, "[{:?} of {:?}]", offset, min_length)?;
+                    write!(fmt, "[{offset:?} of {min_length:?}]")?;
                 }
                 ProjectionElem::ConstantIndex { offset, min_length, from_end: true } => {
-                    write!(fmt, "[-{:?} of {:?}]", offset, min_length)?;
+                    write!(fmt, "[-{offset:?} of {min_length:?}]")?;
                 }
                 ProjectionElem::Subslice { from, to, from_end: true } if to == 0 => {
-                    write!(fmt, "[{:?}:]", from)?;
+                    write!(fmt, "[{from:?}:]")?;
                 }
                 ProjectionElem::Subslice { from, to, from_end: true } if from == 0 => {
-                    write!(fmt, "[:-{:?}]", to)?;
+                    write!(fmt, "[:-{to:?}]")?;
                 }
                 ProjectionElem::Subslice { from, to, from_end: true } => {
-                    write!(fmt, "[{:?}:-{:?}]", from, to)?;
+                    write!(fmt, "[{from:?}:-{to:?}]")?;
                 }
                 ProjectionElem::Subslice { from, to, from_end: false } => {
-                    write!(fmt, "[{:?}..{:?}]", from, to)?;
+                    write!(fmt, "[{from:?}..{to:?}]")?;
                 }
             }
         }
@@ -1894,9 +1886,9 @@ impl<'tcx> Debug for Operand<'tcx> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Operand::*;
         match *self {
-            Constant(ref a) => write!(fmt, "{:?}", a),
-            Copy(ref place) => write!(fmt, "{:?}", place),
-            Move(ref place) => write!(fmt, "move {:?}", place),
+            Constant(ref a) => write!(fmt, "{a:?}"),
+            Copy(ref place) => write!(fmt, "{place:?}"),
+            Move(ref place) => write!(fmt, "move {place:?}"),
         }
     }
 }
@@ -1935,11 +1927,11 @@ impl<'tcx> Operand<'tcx> {
             let param_env_and_ty = ty::ParamEnv::empty().and(ty);
             let type_size = tcx
                 .layout_of(param_env_and_ty)
-                .unwrap_or_else(|e| panic!("could not compute layout for {:?}: {:?}", ty, e))
+                .unwrap_or_else(|e| panic!("could not compute layout for {ty:?}: {e:?}"))
                 .size;
             let scalar_size = match val {
                 Scalar::Int(int) => int.size(),
-                _ => panic!("Invalid scalar type {:?}", val),
+                _ => panic!("Invalid scalar type {val:?}"),
             };
             scalar_size == type_size
         });
@@ -2055,26 +2047,26 @@ impl<'tcx> Debug for Rvalue<'tcx> {
         use self::Rvalue::*;
 
         match *self {
-            Use(ref place) => write!(fmt, "{:?}", place),
+            Use(ref place) => write!(fmt, "{place:?}"),
             Repeat(ref a, b) => {
-                write!(fmt, "[{:?}; ", a)?;
+                write!(fmt, "[{a:?}; ")?;
                 pretty_print_const(b, fmt, false)?;
                 write!(fmt, "]")
             }
-            Len(ref a) => write!(fmt, "Len({:?})", a),
+            Len(ref a) => write!(fmt, "Len({a:?})"),
             Cast(ref kind, ref place, ref ty) => {
-                write!(fmt, "{:?} as {:?} ({:?})", place, ty, kind)
+                write!(fmt, "{place:?} as {ty:?} ({kind:?})")
             }
-            BinaryOp(ref op, box (ref a, ref b)) => write!(fmt, "{:?}({:?}, {:?})", op, a, b),
+            BinaryOp(ref op, box (ref a, ref b)) => write!(fmt, "{op:?}({a:?}, {b:?})"),
             CheckedBinaryOp(ref op, box (ref a, ref b)) => {
-                write!(fmt, "Checked{:?}({:?}, {:?})", op, a, b)
+                write!(fmt, "Checked{op:?}({a:?}, {b:?})")
             }
-            UnaryOp(ref op, ref a) => write!(fmt, "{:?}({:?})", op, a),
-            Discriminant(ref place) => write!(fmt, "discriminant({:?})", place),
+            UnaryOp(ref op, ref a) => write!(fmt, "{op:?}({a:?})"),
+            Discriminant(ref place) => write!(fmt, "discriminant({place:?})"),
             NullaryOp(ref op, ref t) => match op {
-                NullOp::SizeOf => write!(fmt, "SizeOf({:?})", t),
-                NullOp::AlignOf => write!(fmt, "AlignOf({:?})", t),
-                NullOp::OffsetOf(fields) => write!(fmt, "OffsetOf({:?}, {:?})", t, fields),
+                NullOp::SizeOf => write!(fmt, "SizeOf({t:?})"),
+                NullOp::AlignOf => write!(fmt, "AlignOf({t:?})"),
+                NullOp::OffsetOf(fields) => write!(fmt, "OffsetOf({t:?}, {fields:?})"),
             },
             ThreadLocalRef(did) => ty::tls::with(|tcx| {
                 let muta = tcx.static_mutability(did).unwrap().prefix_str();
@@ -2101,10 +2093,10 @@ impl<'tcx> Debug for Rvalue<'tcx> {
                     // Do not even print 'static
                     String::new()
                 };
-                write!(fmt, "&{}{}{:?}", region, kind_str, place)
+                write!(fmt, "&{region}{kind_str}{place:?}")
             }
 
-            CopyForDeref(ref place) => write!(fmt, "deref_copy {:#?}", place),
+            CopyForDeref(ref place) => write!(fmt, "deref_copy {place:#?}"),
 
             AddressOf(mutability, ref place) => {
                 let kind_str = match mutability {
@@ -2112,7 +2104,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
                     Mutability::Not => "const",
                 };
 
-                write!(fmt, "&raw {} {:?}", kind_str, place)
+                write!(fmt, "&raw {kind_str} {place:?}")
             }
 
             Aggregate(ref kind, ref places) => {
@@ -2125,7 +2117,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
                 };
 
                 match **kind {
-                    AggregateKind::Array(_) => write!(fmt, "{:?}", places),
+                    AggregateKind::Array(_) => write!(fmt, "{places:?}"),
 
                     AggregateKind::Tuple => {
                         if places.is_empty() {
@@ -2211,7 +2203,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
             }
 
             ShallowInitBox(ref place, ref ty) => {
-                write!(fmt, "ShallowInitBox({:?}, {:?})", place, ty)
+                write!(fmt, "ShallowInitBox({place:?}, {ty:?})")
             }
         }
     }
@@ -2755,7 +2747,7 @@ rustc_index::newtype_index! {
 
 impl<'tcx> Debug for Constant<'tcx> {
     fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
-        write!(fmt, "{}", self)
+        write!(fmt, "{self}")
     }
 }
 
@@ -2831,7 +2823,7 @@ fn pretty_print_const_value<'tcx>(
         let ty = tcx.lift(ty).unwrap();
 
         if tcx.sess.verbose() {
-            fmt.write_str(&format!("ConstValue({:?}: {})", ct, ty))?;
+            fmt.write_str(&format!("ConstValue({ct:?}: {ty})"))?;
             return Ok(());
         }
 
@@ -2901,7 +2893,7 @@ fn pretty_print_const_value<'tcx>(
                             fmt.write_str(")")?;
                         }
                         ty::Adt(def, _) if def.variants().is_empty() => {
-                            fmt.write_str(&format!("{{unreachable(): {}}}", ty))?;
+                            fmt.write_str(&format!("{{unreachable(): {ty}}}"))?;
                         }
                         ty::Adt(def, args) => {
                             let variant_idx = contents
diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs
index f4133dfbc95..ddb6cc15bc1 100644
--- a/compiler/rustc_middle/src/mir/mono.rs
+++ b/compiler/rustc_middle/src/mir/mono.rs
@@ -223,7 +223,7 @@ impl<'tcx> MonoItem<'tcx> {
 impl<'tcx> fmt::Display for MonoItem<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            MonoItem::Fn(instance) => write!(f, "fn {}", instance),
+            MonoItem::Fn(instance) => write!(f, "fn {instance}"),
             MonoItem::Static(def_id) => {
                 write!(f, "static {}", Instance::new(def_id, GenericArgs::empty()))
             }
@@ -534,17 +534,17 @@ impl<'tcx> CodegenUnitNameBuilder<'tcx> {
             format!("{}.{:08x}{}", tcx.crate_name(cnum), stable_crate_id, local_crate_id)
         });
 
-        write!(cgu_name, "{}", crate_prefix).unwrap();
+        write!(cgu_name, "{crate_prefix}").unwrap();
 
         // Add the components
         for component in components {
-            write!(cgu_name, "-{}", component).unwrap();
+            write!(cgu_name, "-{component}").unwrap();
         }
 
         if let Some(special_suffix) = special_suffix {
             // We add a dot in here so it cannot clash with anything in a regular
             // Rust identifier
-            write!(cgu_name, ".{}", special_suffix).unwrap();
+            write!(cgu_name, ".{special_suffix}").unwrap();
         }
 
         Symbol::intern(&cgu_name)
diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs
index 8cbab31451b..27e39137092 100644
--- a/compiler/rustc_middle/src/mir/pretty.rs
+++ b/compiler/rustc_middle/src/mir/pretty.rs
@@ -124,14 +124,14 @@ fn dump_matched_mir_node<'tcx, F>(
         let def_path =
             ty::print::with_forced_impl_filename_line!(tcx.def_path_str(body.source.def_id()));
         // ignore-tidy-odd-backticks the literal below is fine
-        write!(file, "// MIR for `{}", def_path)?;
+        write!(file, "// MIR for `{def_path}")?;
         match body.source.promoted {
             None => write!(file, "`")?,
-            Some(promoted) => write!(file, "::{:?}`", promoted)?,
+            Some(promoted) => write!(file, "::{promoted:?}`")?,
         }
-        writeln!(file, " {} {}", disambiguator, pass_name)?;
+        writeln!(file, " {disambiguator} {pass_name}")?;
         if let Some(ref layout) = body.generator_layout() {
-            writeln!(file, "/* generator_layout = {:#?} */", layout)?;
+            writeln!(file, "/* generator_layout = {layout:#?} */")?;
         }
         writeln!(file)?;
         extra_data(PassWhere::BeforeCFG, &mut file)?;
@@ -169,7 +169,7 @@ fn dump_file_basename<'tcx>(
 ) -> String {
     let source = body.source;
     let promotion_id = match source.promoted {
-        Some(id) => format!("-{:?}", id),
+        Some(id) => format!("-{id:?}"),
         None => String::new(),
     };
 
@@ -203,8 +203,7 @@ fn dump_file_basename<'tcx>(
     };
 
     format!(
-        "{}.{}{}{}{}.{}.{}",
-        crate_name, item_name, shim_disambiguator, promotion_id, pass_num, pass_name, disambiguator,
+        "{crate_name}.{item_name}{shim_disambiguator}{promotion_id}{pass_num}.{pass_name}.{disambiguator}",
     )
 }
 
@@ -215,7 +214,7 @@ fn dump_path(tcx: TyCtxt<'_>, basename: &str, extension: &str) -> PathBuf {
     let mut file_path = PathBuf::new();
     file_path.push(Path::new(&tcx.sess.opts.unstable_opts.dump_mir_dir));
 
-    let file_name = format!("{}.{}", basename, extension,);
+    let file_name = format!("{basename}.{extension}",);
 
     file_path.push(&file_name);
 
@@ -233,12 +232,12 @@ fn create_dump_file_with_basename(
         fs::create_dir_all(parent).map_err(|e| {
             io::Error::new(
                 e.kind(),
-                format!("IO error creating MIR dump directory: {:?}; {}", parent, e),
+                format!("IO error creating MIR dump directory: {parent:?}; {e}"),
             )
         })?;
     }
     Ok(io::BufWriter::new(fs::File::create(&file_path).map_err(|e| {
-        io::Error::new(e.kind(), format!("IO error creating MIR dump file: {:?}; {}", file_path, e))
+        io::Error::new(e.kind(), format!("IO error creating MIR dump file: {file_path:?}; {e}"))
     })?))
 }
 
@@ -346,28 +345,24 @@ where
 
     // Basic block label at the top.
     let cleanup_text = if data.is_cleanup { " (cleanup)" } else { "" };
-    writeln!(w, "{}{:?}{}: {{", INDENT, block, cleanup_text)?;
+    writeln!(w, "{INDENT}{block:?}{cleanup_text}: {{")?;
 
     // List of statements in the middle.
     let mut current_location = Location { block, statement_index: 0 };
     for statement in &data.statements {
         extra_data(PassWhere::BeforeLocation(current_location), w)?;
-        let indented_body = format!("{0}{0}{1:?};", INDENT, statement);
+        let indented_body = format!("{INDENT}{INDENT}{statement:?};");
         if tcx.sess.opts.unstable_opts.mir_include_spans {
             writeln!(
                 w,
                 "{:A$} // {}{}",
                 indented_body,
-                if tcx.sess.verbose() {
-                    format!("{:?}: ", current_location)
-                } else {
-                    String::new()
-                },
+                if tcx.sess.verbose() { format!("{current_location:?}: ") } else { String::new() },
                 comment(tcx, statement.source_info),
                 A = ALIGN,
             )?;
         } else {
-            writeln!(w, "{}", indented_body)?;
+            writeln!(w, "{indented_body}")?;
         }
 
         write_extra(tcx, w, |visitor| {
@@ -387,12 +382,12 @@ where
             w,
             "{:A$} // {}{}",
             indented_terminator,
-            if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
+            if tcx.sess.verbose() { format!("{current_location:?}: ") } else { String::new() },
             comment(tcx, data.terminator().source_info),
             A = ALIGN,
         )?;
     } else {
-        writeln!(w, "{}", indented_terminator)?;
+        writeln!(w, "{indented_terminator}")?;
     }
 
     write_extra(tcx, w, |visitor| {
@@ -402,7 +397,7 @@ where
     extra_data(PassWhere::AfterLocation(current_location), w)?;
     extra_data(PassWhere::AfterTerminator(block), w)?;
 
-    writeln!(w, "{}}}", INDENT)
+    writeln!(w, "{INDENT}}}")
 }
 
 /// After we print the main statement, we sometimes dump extra
@@ -457,25 +452,25 @@ impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
                 self.tcx.sess.source_map().span_to_embeddable_string(*span)
             ));
             if let Some(user_ty) = user_ty {
-                self.push(&format!("+ user_ty: {:?}", user_ty));
+                self.push(&format!("+ user_ty: {user_ty:?}"));
             }
 
             // FIXME: this is a poor version of `pretty_print_const_value`.
             let fmt_val = |val: &ConstValue<'tcx>| match val {
                 ConstValue::ZeroSized => "<ZST>".to_string(),
-                ConstValue::Scalar(s) => format!("Scalar({:?})", s),
+                ConstValue::Scalar(s) => format!("Scalar({s:?})"),
                 ConstValue::Slice { .. } => "Slice(..)".to_string(),
                 ConstValue::ByRef { .. } => "ByRef(..)".to_string(),
             };
 
             let fmt_valtree = |valtree: &ty::ValTree<'tcx>| match valtree {
-                ty::ValTree::Leaf(leaf) => format!("ValTree::Leaf({:?})", leaf),
+                ty::ValTree::Leaf(leaf) => format!("ValTree::Leaf({leaf:?})"),
                 ty::ValTree::Branch(_) => "ValTree::Branch(..)".to_string(),
             };
 
             let val = match literal {
                 ConstantKind::Ty(ct) => match ct.kind() {
-                    ty::ConstKind::Param(p) => format!("Param({})", p),
+                    ty::ConstKind::Param(p) => format!("Param({p})"),
                     ty::ConstKind::Unevaluated(uv) => {
                         format!("Unevaluated({}, {:?})", self.tcx.def_path_str(uv.def), uv.args,)
                     }
@@ -514,20 +509,20 @@ impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
             match **kind {
                 AggregateKind::Closure(def_id, args) => {
                     self.push("closure");
-                    self.push(&format!("+ def_id: {:?}", def_id));
-                    self.push(&format!("+ args: {:#?}", args));
+                    self.push(&format!("+ def_id: {def_id:?}"));
+                    self.push(&format!("+ args: {args:#?}"));
                 }
 
                 AggregateKind::Generator(def_id, args, movability) => {
                     self.push("generator");
-                    self.push(&format!("+ def_id: {:?}", def_id));
-                    self.push(&format!("+ args: {:#?}", args));
-                    self.push(&format!("+ movability: {:?}", movability));
+                    self.push(&format!("+ def_id: {def_id:?}"));
+                    self.push(&format!("+ args: {args:#?}"));
+                    self.push(&format!("+ movability: {movability:?}"));
                 }
 
                 AggregateKind::Adt(_, _, _, Some(user_ty), _) => {
                     self.push("adt");
-                    self.push(&format!("+ user_ty: {:?}", user_ty));
+                    self.push(&format!("+ user_ty: {user_ty:?}"));
                 }
 
                 _ => {}
@@ -578,7 +573,7 @@ fn write_scope_tree(
                 comment(tcx, var_debug_info.source_info),
             )?;
         } else {
-            writeln!(w, "{}", indented_debug_info)?;
+            writeln!(w, "{indented_debug_info}")?;
         }
     }
 
@@ -600,7 +595,7 @@ fn write_scope_tree(
             format!("{0:1$}let {2}{3:?}: {4:?}", INDENT, indent, mut_str, local, local_decl.ty);
         if let Some(user_ty) = &local_decl.user_ty {
             for user_ty in user_ty.projections() {
-                write!(indented_decl, " as {:?}", user_ty).unwrap();
+                write!(indented_decl, " as {user_ty:?}").unwrap();
             }
         }
         indented_decl.push(';');
@@ -617,7 +612,7 @@ fn write_scope_tree(
                 comment(tcx, local_decl.source_info),
             )?;
         } else {
-            writeln!(w, "{}", indented_decl,)?;
+            writeln!(w, "{indented_decl}",)?;
         }
     }
 
@@ -654,10 +649,10 @@ fn write_scope_tree(
                     tcx.sess.source_map().span_to_embeddable_string(span),
                 )?;
             } else {
-                writeln!(w, "{}", indented_header)?;
+                writeln!(w, "{indented_header}")?;
             }
         } else {
-            writeln!(w, "{}", indented_header)?;
+            writeln!(w, "{indented_header}")?;
         }
 
         write_scope_tree(tcx, body, scope_tree, w, child, depth + 1)?;
@@ -844,7 +839,7 @@ fn write_allocation_endline(w: &mut dyn std::fmt::Write, ascii: &str) -> std::fm
     for _ in 0..(BYTES_PER_LINE - ascii.chars().count()) {
         write!(w, "   ")?;
     }
-    writeln!(w, " │ {}", ascii)
+    writeln!(w, " │ {ascii}")
 }
 
 /// Number of bytes to print per allocation hex dump line.
@@ -880,7 +875,7 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
     if num_lines > 0 {
         write!(w, "{}0x{:02$x} │ ", prefix, 0, pos_width)?;
     } else {
-        write!(w, "{}", prefix)?;
+        write!(w, "{prefix}")?;
     }
 
     let mut i = Size::ZERO;
@@ -913,10 +908,10 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
             let offset = Size::from_bytes(offset);
             let provenance_width = |bytes| bytes * 3;
             let ptr = Pointer::new(prov, offset);
-            let mut target = format!("{:?}", ptr);
+            let mut target = format!("{ptr:?}");
             if target.len() > provenance_width(ptr_size.bytes_usize() - 1) {
                 // This is too long, try to save some space.
-                target = format!("{:#?}", ptr);
+                target = format!("{ptr:#?}");
             }
             if ((i - line_start) + ptr_size).bytes_usize() > BYTES_PER_LINE {
                 // This branch handles the situation where a provenance starts in the current line
@@ -935,10 +930,10 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
                     line_start =
                         write_allocation_newline(w, line_start, &ascii, pos_width, prefix)?;
                     ascii.clear();
-                    write!(w, "{0:─^1$}╼", target, overflow_width)?;
+                    write!(w, "{target:─^overflow_width$}╼")?;
                 } else {
                     oversized_ptr(&mut target, remainder_width);
-                    write!(w, "╾{0:─^1$}", target, remainder_width)?;
+                    write!(w, "╾{target:─^remainder_width$}")?;
                     line_start =
                         write_allocation_newline(w, line_start, &ascii, pos_width, prefix)?;
                     write!(w, "{0:─^1$}╼", "", overflow_width)?;
@@ -955,7 +950,7 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
                 let provenance_width = provenance_width(ptr_size.bytes_usize() - 1);
                 oversized_ptr(&mut target, provenance_width);
                 ascii.push('╾');
-                write!(w, "╾{0:─^1$}╼", target, provenance_width)?;
+                write!(w, "╾{target:─^provenance_width$}╼")?;
                 for _ in 0..ptr_size.bytes() - 2 {
                     ascii.push('─');
                 }
@@ -972,7 +967,7 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
             // Format is similar to "oversized" above.
             let j = i.bytes_usize();
             let c = alloc.inspect_with_uninit_and_ptr_outside_interpreter(j..j + 1)[0];
-            write!(w, "╾{:02x}{:#?} (1 ptr byte)╼", c, prov)?;
+            write!(w, "╾{c:02x}{prov:#?} (1 ptr byte)╼")?;
             i += Size::from_bytes(1);
         } else if alloc
             .init_mask()
@@ -984,7 +979,7 @@ pub fn write_allocation_bytes<'tcx, Prov: Provenance, Extra, Bytes: AllocBytes>(
             // Checked definedness (and thus range) and provenance. This access also doesn't
             // influence interpreter execution but is only for debugging.
             let c = alloc.inspect_with_uninit_and_ptr_outside_interpreter(j..j + 1)[0];
-            write!(w, "{:02x}", c)?;
+            write!(w, "{c:02x}")?;
             if c.is_ascii_control() || c >= 0x80 {
                 ascii.push('.');
             } else {
@@ -1018,7 +1013,7 @@ fn write_mir_sig(tcx: TyCtxt<'_>, body: &Body<'_>, w: &mut dyn Write) -> io::Res
         _ => tcx.is_closure(def_id),
     };
     match (kind, body.source.promoted) {
-        (_, Some(i)) => write!(w, "{:?} in ", i)?,
+        (_, Some(i)) => write!(w, "{i:?} in ")?,
         (DefKind::Const | DefKind::AssocConst, _) => write!(w, "const ")?,
         (DefKind::Static(hir::Mutability::Not), _) => write!(w, "static ")?,
         (DefKind::Static(hir::Mutability::Mut), _) => write!(w, "static mut ")?,
@@ -1051,7 +1046,7 @@ fn write_mir_sig(tcx: TyCtxt<'_>, body: &Body<'_>, w: &mut dyn Write) -> io::Res
 
     if let Some(yield_ty) = body.yield_ty() {
         writeln!(w)?;
-        writeln!(w, "yields {}", yield_ty)?;
+        writeln!(w, "yields {yield_ty}")?;
     }
 
     write!(w, " ")?;
diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs
index e8cb9860ee5..71bec49af93 100644
--- a/compiler/rustc_middle/src/mir/query.rs
+++ b/compiler/rustc_middle/src/mir/query.rs
@@ -198,7 +198,7 @@ impl Debug for GeneratorLayout<'_> {
                 if fmt.alternate() {
                     write!(fmt, "{:9}({:?})", variant_name, self.0)
                 } else {
-                    write!(fmt, "{}", variant_name)
+                    write!(fmt, "{variant_name}")
                 }
             }
         }
diff --git a/compiler/rustc_middle/src/mir/spanview.rs b/compiler/rustc_middle/src/mir/spanview.rs
index 730c551576a..20a9e6889e4 100644
--- a/compiler/rustc_middle/src/mir/spanview.rs
+++ b/compiler/rustc_middle/src/mir/spanview.rs
@@ -159,10 +159,10 @@ where
         indent_to_initial_start_col,
         source_map.span_to_snippet(spanview_span).expect("function should have printable source")
     );
-    writeln!(w, "{}", HEADER)?;
-    writeln!(w, "<title>{}</title>", title)?;
-    writeln!(w, "{}", STYLE_SECTION)?;
-    writeln!(w, "{}", START_BODY)?;
+    writeln!(w, "{HEADER}")?;
+    writeln!(w, "<title>{title}</title>")?;
+    writeln!(w, "{STYLE_SECTION}")?;
+    writeln!(w, "{START_BODY}")?;
     write!(
         w,
         r#"<div class="code" style="counter-reset: line {}"><span class="line">{}"#,
@@ -226,7 +226,7 @@ where
         write_coverage_gap(tcx, from_pos, end_pos, w)?;
     }
     writeln!(w, r#"</span></div>"#)?;
-    writeln!(w, "{}", FOOTER)?;
+    writeln!(w, "{FOOTER}")?;
     Ok(())
 }
 
@@ -561,17 +561,16 @@ where
     }
     for (i, line) in html_snippet.lines().enumerate() {
         if i > 0 {
-            write!(w, "{}", NEW_LINE_SPAN)?;
+            write!(w, "{NEW_LINE_SPAN}")?;
         }
         write!(
             w,
-            r#"<span class="code{}" style="--layer: {}"{}>{}</span>"#,
-            maybe_alt_class, layer, maybe_title_attr, line
+            r#"<span class="code{maybe_alt_class}" style="--layer: {layer}"{maybe_title_attr}>{line}</span>"#
         )?;
     }
     // Check for and translate trailing newlines, because `str::lines()` ignores them
     if html_snippet.ends_with('\n') {
-        write!(w, "{}", NEW_LINE_SPAN)?;
+        write!(w, "{NEW_LINE_SPAN}")?;
     }
     if layer == 1 {
         write!(w, "</span>")?;
diff --git a/compiler/rustc_middle/src/mir/terminator.rs b/compiler/rustc_middle/src/mir/terminator.rs
index 1b9c1438f40..6de84351595 100644
--- a/compiler/rustc_middle/src/mir/terminator.rs
+++ b/compiler/rustc_middle/src/mir/terminator.rs
@@ -280,7 +280,7 @@ impl<'tcx> Debug for TerminatorKind<'tcx> {
 
         match (successor_count, unwind) {
             (0, None) => Ok(()),
-            (0, Some(unwind)) => write!(fmt, " -> {}", unwind),
+            (0, Some(unwind)) => write!(fmt, " -> {unwind}"),
             (1, None) => write!(fmt, " -> {:?}", self.successors().next().unwrap()),
             _ => {
                 write!(fmt, " -> [")?;
@@ -307,22 +307,22 @@ impl<'tcx> TerminatorKind<'tcx> {
         use self::TerminatorKind::*;
         match self {
             Goto { .. } => write!(fmt, "goto"),
-            SwitchInt { discr, .. } => write!(fmt, "switchInt({:?})", discr),
+            SwitchInt { discr, .. } => write!(fmt, "switchInt({discr:?})"),
             Return => write!(fmt, "return"),
             GeneratorDrop => write!(fmt, "generator_drop"),
             Resume => write!(fmt, "resume"),
             Terminate => write!(fmt, "abort"),
-            Yield { value, resume_arg, .. } => write!(fmt, "{:?} = yield({:?})", resume_arg, value),
+            Yield { value, resume_arg, .. } => write!(fmt, "{resume_arg:?} = yield({value:?})"),
             Unreachable => write!(fmt, "unreachable"),
-            Drop { place, .. } => write!(fmt, "drop({:?})", place),
+            Drop { place, .. } => write!(fmt, "drop({place:?})"),
             Call { func, args, destination, .. } => {
-                write!(fmt, "{:?} = ", destination)?;
-                write!(fmt, "{:?}(", func)?;
+                write!(fmt, "{destination:?} = ")?;
+                write!(fmt, "{func:?}(")?;
                 for (index, arg) in args.iter().enumerate() {
                     if index > 0 {
                         write!(fmt, ", ")?;
                     }
-                    write!(fmt, "{:?}", arg)?;
+                    write!(fmt, "{arg:?}")?;
                 }
                 write!(fmt, ")")
             }
@@ -331,7 +331,7 @@ impl<'tcx> TerminatorKind<'tcx> {
                 if !expected {
                     write!(fmt, "!")?;
                 }
-                write!(fmt, "{:?}, ", cond)?;
+                write!(fmt, "{cond:?}, ")?;
                 msg.fmt_assert_args(fmt)?;
                 write!(fmt, ")")
             }
@@ -344,7 +344,7 @@ impl<'tcx> TerminatorKind<'tcx> {
                     let print_late = |&late| if late { "late" } else { "" };
                     match op {
                         InlineAsmOperand::In { reg, value } => {
-                            write!(fmt, "in({}) {:?}", reg, value)?;
+                            write!(fmt, "in({reg}) {value:?}")?;
                         }
                         InlineAsmOperand::Out { reg, late, place: Some(place) } => {
                             write!(fmt, "{}out({}) {:?}", print_late(late), reg, place)?;
@@ -371,17 +371,17 @@ impl<'tcx> TerminatorKind<'tcx> {
                             write!(fmt, "in{}out({}) {:?} => _", print_late(late), reg, in_value)?;
                         }
                         InlineAsmOperand::Const { value } => {
-                            write!(fmt, "const {:?}", value)?;
+                            write!(fmt, "const {value:?}")?;
                         }
                         InlineAsmOperand::SymFn { value } => {
-                            write!(fmt, "sym_fn {:?}", value)?;
+                            write!(fmt, "sym_fn {value:?}")?;
                         }
                         InlineAsmOperand::SymStatic { def_id } => {
-                            write!(fmt, "sym_static {:?}", def_id)?;
+                            write!(fmt, "sym_static {def_id:?}")?;
                         }
                     }
                 }
-                write!(fmt, ", options({:?}))", options)
+                write!(fmt, ", options({options:?}))")
             }
         }
     }
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index fb796587352..63df2830e0a 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -885,6 +885,13 @@ rustc_queries! {
         desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
     }
 
+    /// We need to store the assumed_wf_types for an RPITIT so that impls of foreign
+    /// traits with return-position impl trait in traits can inherit the right wf types.
+    query assumed_wf_types_for_rpitit(key: DefId) -> &'tcx [(Ty<'tcx>, Span)] {
+        desc { |tcx| "computing the implied bounds of `{}`", tcx.def_path_str(key) }
+        separate_provide_extern
+    }
+
     /// Computes the signature of the function.
     query fn_sig(key: DefId) -> ty::EarlyBinder<ty::PolyFnSig<'tcx>> {
         desc { |tcx| "computing function signature of `{}`", tcx.def_path_str(key) }
@@ -1277,7 +1284,7 @@ rustc_queries! {
     query vtable_allocation(key: (Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>)) -> mir::interpret::AllocId {
         desc { |tcx| "vtable const allocation for <{} as {}>",
             key.0,
-            key.1.map(|trait_ref| format!("{}", trait_ref)).unwrap_or("_".to_owned())
+            key.1.map(|trait_ref| format!("{trait_ref}")).unwrap_or("_".to_owned())
         }
     }
 
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs
index e070b054720..8e2e71fd879 100644
--- a/compiler/rustc_middle/src/thir.rs
+++ b/compiler/rustc_middle/src/thir.rs
@@ -659,7 +659,7 @@ impl<'tcx> Pat<'tcx> {
 
 impl<'tcx> IntoDiagnosticArg for Pat<'tcx> {
     fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
-        format!("{}", self).into_diagnostic_arg()
+        format!("{self}").into_diagnostic_arg()
     }
 }
 
@@ -789,7 +789,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
 
         match self.kind {
             PatKind::Wild => write!(f, "_"),
-            PatKind::AscribeUserType { ref subpattern, .. } => write!(f, "{}: _", subpattern),
+            PatKind::AscribeUserType { ref subpattern, .. } => write!(f, "{subpattern}: _"),
             PatKind::Binding { mutability, name, mode, ref subpattern, .. } => {
                 let is_mut = match mode {
                     BindingMode::ByValue => mutability == Mutability::Mut,
@@ -801,9 +801,9 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
                 if is_mut {
                     write!(f, "mut ")?;
                 }
-                write!(f, "{}", name)?;
+                write!(f, "{name}")?;
                 if let Some(ref subpattern) = *subpattern {
-                    write!(f, " @ {}", subpattern)?;
+                    write!(f, " @ {subpattern}")?;
                 }
                 Ok(())
             }
@@ -833,7 +833,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
                 };
 
                 if let Some((variant, name)) = &variant_and_name {
-                    write!(f, "{}", name)?;
+                    write!(f, "{name}")?;
 
                     // Only for Adt we can have `S {...}`,
                     // which we handle separately here.
@@ -893,13 +893,13 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
                     }
                     _ => bug!("{} is a bad Deref pattern type", self.ty),
                 }
-                write!(f, "{}", subpattern)
+                write!(f, "{subpattern}")
             }
-            PatKind::Constant { value } => write!(f, "{}", value),
+            PatKind::Constant { value } => write!(f, "{value}"),
             PatKind::Range(box PatRange { lo, hi, end }) => {
-                write!(f, "{}", lo)?;
-                write!(f, "{}", end)?;
-                write!(f, "{}", hi)
+                write!(f, "{lo}")?;
+                write!(f, "{end}")?;
+                write!(f, "{hi}")
             }
             PatKind::Slice { ref prefix, ref slice, ref suffix }
             | PatKind::Array { ref prefix, ref slice, ref suffix } => {
@@ -911,7 +911,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
                     write!(f, "{}", start_or_comma())?;
                     match slice.kind {
                         PatKind::Wild => {}
-                        _ => write!(f, "{}", slice)?,
+                        _ => write!(f, "{slice}")?,
                     }
                     write!(f, "..")?;
                 }
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index a2b33bb2737..85116555fc0 100644
--- a/compiler/rustc_middle/src/traits/mod.rs
+++ b/compiler/rustc_middle/src/traits/mod.rs
@@ -777,49 +777,48 @@ impl ObjectSafetyViolation {
                 "where clause cannot reference non-lifetime `for<...>` variables".into()
             }
             ObjectSafetyViolation::Method(name, MethodViolationCode::StaticMethod(_), _) => {
-                format!("associated function `{}` has no `self` parameter", name).into()
+                format!("associated function `{name}` has no `self` parameter").into()
             }
             ObjectSafetyViolation::Method(
                 name,
                 MethodViolationCode::ReferencesSelfInput(_),
                 DUMMY_SP,
-            ) => format!("method `{}` references the `Self` type in its parameters", name).into(),
+            ) => format!("method `{name}` references the `Self` type in its parameters").into(),
             ObjectSafetyViolation::Method(name, MethodViolationCode::ReferencesSelfInput(_), _) => {
-                format!("method `{}` references the `Self` type in this parameter", name).into()
+                format!("method `{name}` references the `Self` type in this parameter").into()
             }
             ObjectSafetyViolation::Method(name, MethodViolationCode::ReferencesSelfOutput, _) => {
-                format!("method `{}` references the `Self` type in its return type", name).into()
+                format!("method `{name}` references the `Self` type in its return type").into()
             }
             ObjectSafetyViolation::Method(
                 name,
                 MethodViolationCode::ReferencesImplTraitInTrait(_),
                 _,
-            ) => format!("method `{}` references an `impl Trait` type in its return type", name)
-                .into(),
+            ) => {
+                format!("method `{name}` references an `impl Trait` type in its return type").into()
+            }
             ObjectSafetyViolation::Method(name, MethodViolationCode::AsyncFn, _) => {
-                format!("method `{}` is `async`", name).into()
+                format!("method `{name}` is `async`").into()
             }
             ObjectSafetyViolation::Method(
                 name,
                 MethodViolationCode::WhereClauseReferencesSelf,
                 _,
-            ) => {
-                format!("method `{}` references the `Self` type in its `where` clause", name).into()
-            }
+            ) => format!("method `{name}` references the `Self` type in its `where` clause").into(),
             ObjectSafetyViolation::Method(name, MethodViolationCode::Generic, _) => {
-                format!("method `{}` has generic type parameters", name).into()
+                format!("method `{name}` has generic type parameters").into()
             }
             ObjectSafetyViolation::Method(
                 name,
                 MethodViolationCode::UndispatchableReceiver(_),
                 _,
-            ) => format!("method `{}`'s `self` parameter cannot be dispatched on", name).into(),
+            ) => format!("method `{name}`'s `self` parameter cannot be dispatched on").into(),
             ObjectSafetyViolation::AssocConst(name, DUMMY_SP) => {
-                format!("it contains associated `const` `{}`", name).into()
+                format!("it contains associated `const` `{name}`").into()
             }
             ObjectSafetyViolation::AssocConst(..) => "it contains this associated `const`".into(),
             ObjectSafetyViolation::GAT(name, _) => {
-                format!("it contains the generic associated type `{}`", name).into()
+                format!("it contains the generic associated type `{name}`").into()
             }
         }
     }
@@ -837,8 +836,7 @@ impl ObjectSafetyViolation {
                 err.span_suggestion(
                     add_self_sugg.1,
                     format!(
-                        "consider turning `{}` into a method by giving it a `&self` argument",
-                        name
+                        "consider turning `{name}` into a method by giving it a `&self` argument"
                     ),
                     add_self_sugg.0.to_string(),
                     Applicability::MaybeIncorrect,
@@ -846,9 +844,8 @@ impl ObjectSafetyViolation {
                 err.span_suggestion(
                     make_sized_sugg.1,
                     format!(
-                        "alternatively, consider constraining `{}` so it does not apply to \
-                             trait objects",
-                        name
+                        "alternatively, consider constraining `{name}` so it does not apply to \
+                             trait objects"
                     ),
                     make_sized_sugg.0.to_string(),
                     Applicability::MaybeIncorrect,
@@ -861,7 +858,7 @@ impl ObjectSafetyViolation {
             ) => {
                 err.span_suggestion(
                     *span,
-                    format!("consider changing method `{}`'s `self` parameter to be `&self`", name),
+                    format!("consider changing method `{name}`'s `self` parameter to be `&self`"),
                     "&Self",
                     Applicability::MachineApplicable,
                 );
@@ -869,7 +866,7 @@ impl ObjectSafetyViolation {
             ObjectSafetyViolation::AssocConst(name, _)
             | ObjectSafetyViolation::GAT(name, _)
             | ObjectSafetyViolation::Method(name, ..) => {
-                err.help(format!("consider moving `{}` to another trait", name));
+                err.help(format!("consider moving `{name}` to another trait"));
             }
         }
     }
diff --git a/compiler/rustc_middle/src/traits/solve.rs b/compiler/rustc_middle/src/traits/solve.rs
index 73b332fd8ec..b21a00e4122 100644
--- a/compiler/rustc_middle/src/traits/solve.rs
+++ b/compiler/rustc_middle/src/traits/solve.rs
@@ -57,6 +57,7 @@ pub enum Certainty {
 
 impl Certainty {
     pub const AMBIGUOUS: Certainty = Certainty::Maybe(MaybeCause::Ambiguity);
+    pub const OVERFLOW: Certainty = Certainty::Maybe(MaybeCause::Overflow);
 
     /// Use this function to merge the certainty of multiple nested subgoals.
     ///
@@ -66,7 +67,7 @@ impl Certainty {
     /// success, we merge these two responses. This results in ambiguity.
     ///
     /// If we unify ambiguity with overflow, we return overflow. This doesn't matter
-    /// inside of the solver as we distinguish ambiguity from overflow. It does
+    /// inside of the solver as we do not distinguish ambiguity from overflow. It does
     /// however matter for diagnostics. If `T: Foo` resulted in overflow and `T: Bar`
     /// in ambiguity without changing the inference state, we still want to tell the
     /// user that `T: Baz` results in overflow.
diff --git a/compiler/rustc_middle/src/traits/solve/inspect/format.rs b/compiler/rustc_middle/src/traits/solve/inspect/format.rs
index 39f84279259..f1e567e9bf8 100644
--- a/compiler/rustc_middle/src/traits/solve/inspect/format.rs
+++ b/compiler/rustc_middle/src/traits/solve/inspect/format.rs
@@ -68,7 +68,7 @@ impl<'a, 'b> ProofTreeFormatter<'a, 'b> {
             writeln!(self.f, "NESTED GOALS ADDED TO CALLER: [")?;
             self.nested(|this| {
                 for goal in goal.returned_goals.iter() {
-                    writeln!(this.f, "ADDED GOAL: {:?},", goal)?;
+                    writeln!(this.f, "ADDED GOAL: {goal:?},")?;
                 }
                 Ok(())
             })?;
@@ -104,7 +104,7 @@ impl<'a, 'b> ProofTreeFormatter<'a, 'b> {
                 writeln!(self.f, "ASSEMBLING CANDIDATES FOR DYN UPCASTING:")
             }
             CandidateKind::Candidate { name, result } => {
-                writeln!(self.f, "CANDIDATE {}: {:?}", name, result)
+                writeln!(self.f, "CANDIDATE {name}: {result:?}")
             }
         }?;
 
diff --git a/compiler/rustc_middle/src/traits/specialization_graph.rs b/compiler/rustc_middle/src/traits/specialization_graph.rs
index 18a57b6181a..e48b46d12c4 100644
--- a/compiler/rustc_middle/src/traits/specialization_graph.rs
+++ b/compiler/rustc_middle/src/traits/specialization_graph.rs
@@ -43,7 +43,7 @@ impl Graph {
     /// The parent of a given impl, which is the `DefId` of the trait when the
     /// impl is a "specialization root".
     pub fn parent(&self, child: DefId) -> DefId {
-        *self.parent.get(&child).unwrap_or_else(|| panic!("Failed to get parent for {:?}", child))
+        *self.parent.get(&child).unwrap_or_else(|| panic!("Failed to get parent for {child:?}"))
     }
 }
 
diff --git a/compiler/rustc_middle/src/traits/structural_impls.rs b/compiler/rustc_middle/src/traits/structural_impls.rs
index 530d1ec5d35..d7dc429f53b 100644
--- a/compiler/rustc_middle/src/traits/structural_impls.rs
+++ b/compiler/rustc_middle/src/traits/structural_impls.rs
@@ -7,14 +7,14 @@ use std::fmt;
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::ImplSource<'tcx, N> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            super::ImplSource::UserDefined(v) => write!(f, "{:?}", v),
+            super::ImplSource::UserDefined(v) => write!(f, "{v:?}"),
 
             super::ImplSource::Builtin(source, d) => {
                 write!(f, "Builtin({source:?}, {d:?})")
             }
 
             super::ImplSource::Param(ct, n) => {
-                write!(f, "ImplSourceParamData({:?}, {:?})", n, ct)
+                write!(f, "ImplSourceParamData({n:?}, {ct:?})")
             }
         }
     }
diff --git a/compiler/rustc_middle/src/ty/closure.rs b/compiler/rustc_middle/src/ty/closure.rs
index 91eefa2c125..42f22604975 100644
--- a/compiler/rustc_middle/src/ty/closure.rs
+++ b/compiler/rustc_middle/src/ty/closure.rs
@@ -348,7 +348,7 @@ pub fn place_to_string_for_capture<'tcx>(tcx: TyCtxt<'tcx>, place: &HirPlace<'tc
     for (i, proj) in place.projections.iter().enumerate() {
         match proj.kind {
             HirProjectionKind::Deref => {
-                curr_string = format!("*{}", curr_string);
+                curr_string = format!("*{curr_string}");
             }
             HirProjectionKind::Field(idx, variant) => match place.ty_before_projection(i).kind() {
                 ty::Adt(def, ..) => {
diff --git a/compiler/rustc_middle/src/ty/codec.rs b/compiler/rustc_middle/src/ty/codec.rs
index b4f4f9bef8e..7c05deae90a 100644
--- a/compiler/rustc_middle/src/ty/codec.rs
+++ b/compiler/rustc_middle/src/ty/codec.rs
@@ -168,7 +168,6 @@ impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<E> for ty::ParamEnv<'tcx> {
     fn encode(&self, e: &mut E) {
         self.caller_bounds().encode(e);
         self.reveal().encode(e);
-        self.constness().encode(e);
     }
 }
 
@@ -306,8 +305,7 @@ impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for ty::ParamEnv<'tcx> {
     fn decode(d: &mut D) -> Self {
         let caller_bounds = Decodable::decode(d);
         let reveal = Decodable::decode(d);
-        let constness = Decodable::decode(d);
-        ty::ParamEnv::new(caller_bounds, reveal, constness)
+        ty::ParamEnv::new(caller_bounds, reveal)
     }
 }
 
diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs
index 4ef70107f19..cce10417e1b 100644
--- a/compiler/rustc_middle/src/ty/consts.rs
+++ b/compiler/rustc_middle/src/ty/consts.rs
@@ -212,7 +212,7 @@ impl<'tcx> Const<'tcx> {
                 Err(e) => {
                     tcx.sess.delay_span_bug(
                         expr.span,
-                        format!("Const::from_anon_const: couldn't lit_to_const {:?}", e),
+                        format!("Const::from_anon_const: couldn't lit_to_const {e:?}"),
                     );
                 }
             }
@@ -267,7 +267,7 @@ impl<'tcx> Const<'tcx> {
     pub fn from_bits(tcx: TyCtxt<'tcx>, bits: u128, ty: ParamEnvAnd<'tcx, Ty<'tcx>>) -> Self {
         let size = tcx
             .layout_of(ty)
-            .unwrap_or_else(|e| panic!("could not compute layout for {:?}: {:?}", ty, e))
+            .unwrap_or_else(|e| panic!("could not compute layout for {ty:?}: {e:?}"))
             .size;
         ty::Const::new_value(
             tcx,
diff --git a/compiler/rustc_middle/src/ty/consts/int.rs b/compiler/rustc_middle/src/ty/consts/int.rs
index 624195cfb28..b16163edf14 100644
--- a/compiler/rustc_middle/src/ty/consts/int.rs
+++ b/compiler/rustc_middle/src/ty/consts/int.rs
@@ -463,7 +463,7 @@ impl TryFrom<ScalarInt> for Double {
 impl fmt::Debug for ScalarInt {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         // Dispatch to LowerHex below.
-        write!(f, "0x{:x}", self)
+        write!(f, "0x{self:x}")
     }
 }
 
diff --git a/compiler/rustc_middle/src/ty/consts/kind.rs b/compiler/rustc_middle/src/ty/consts/kind.rs
index 6c76075c214..db4a15fbee5 100644
--- a/compiler/rustc_middle/src/ty/consts/kind.rs
+++ b/compiler/rustc_middle/src/ty/consts/kind.rs
@@ -17,7 +17,7 @@ pub struct UnevaluatedConst<'tcx> {
 
 impl rustc_errors::IntoDiagnosticArg for UnevaluatedConst<'_> {
     fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> {
-        format!("{:?}", self).into_diagnostic_arg()
+        format!("{self:?}").into_diagnostic_arg()
     }
 }
 
diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs
index 905e855896e..8570f83dcc6 100644
--- a/compiler/rustc_middle/src/ty/diagnostics.rs
+++ b/compiler/rustc_middle/src/ty/diagnostics.rs
@@ -126,7 +126,7 @@ pub fn suggest_arbitrary_trait_bound<'tcx>(
         if constraint.ends_with('>') {
             constraint = format!("{}, {} = {}>", &constraint[..constraint.len() - 1], name, term);
         } else {
-            constraint.push_str(&format!("<{} = {}>", name, term));
+            constraint.push_str(&format!("<{name} = {term}>"));
         }
     }
 
@@ -274,9 +274,9 @@ pub fn suggest_constraining_type_params<'a>(
                 if span_to_replace.is_some() {
                     constraint.clone()
                 } else if bound_list_non_empty {
-                    format!(" + {}", constraint)
+                    format!(" + {constraint}")
                 } else {
-                    format!(" {}", constraint)
+                    format!(" {constraint}")
                 },
                 SuggestChangingConstraintsMessage::RestrictBoundFurther,
             ))
@@ -337,7 +337,7 @@ pub fn suggest_constraining_type_params<'a>(
                 generics.tail_span_for_predicate_suggestion(),
                 constraints
                     .iter()
-                    .map(|&(constraint, _)| format!(", {}: {}", param_name, constraint))
+                    .map(|&(constraint, _)| format!(", {param_name}: {constraint}"))
                     .collect::<String>(),
                 SuggestChangingConstraintsMessage::RestrictTypeFurther { ty: param_name },
             ));
@@ -358,7 +358,7 @@ pub fn suggest_constraining_type_params<'a>(
             // default (`<T=Foo>`), so we suggest adding `where T: Bar`.
             suggestions.push((
                 generics.tail_span_for_predicate_suggestion(),
-                format!(" where {}: {}", param_name, constraint),
+                format!(" where {param_name}: {constraint}"),
                 SuggestChangingConstraintsMessage::RestrictTypeFurther { ty: param_name },
             ));
             continue;
@@ -371,7 +371,7 @@ pub fn suggest_constraining_type_params<'a>(
         if let Some(colon_span) = param.colon_span {
             suggestions.push((
                 colon_span.shrink_to_hi(),
-                format!(" {}", constraint),
+                format!(" {constraint}"),
                 SuggestChangingConstraintsMessage::RestrictType { ty: param_name },
             ));
             continue;
@@ -383,7 +383,7 @@ pub fn suggest_constraining_type_params<'a>(
         //          - help: consider restricting this type parameter with `T: Foo`
         suggestions.push((
             param.span.shrink_to_hi(),
-            format!(": {}", constraint),
+            format!(": {constraint}"),
             SuggestChangingConstraintsMessage::RestrictType { ty: param_name },
         ));
     }
@@ -401,10 +401,10 @@ pub fn suggest_constraining_type_params<'a>(
                 Cow::from("consider further restricting this bound")
             }
             SuggestChangingConstraintsMessage::RestrictType { ty } => {
-                Cow::from(format!("consider restricting type parameter `{}`", ty))
+                Cow::from(format!("consider restricting type parameter `{ty}`"))
             }
             SuggestChangingConstraintsMessage::RestrictTypeFurther { ty } => {
-                Cow::from(format!("consider further restricting type parameter `{}`", ty))
+                Cow::from(format!("consider further restricting type parameter `{ty}`"))
             }
             SuggestChangingConstraintsMessage::RemoveMaybeUnsized => {
                 Cow::from("consider removing the `?Sized` bound to make the type parameter `Sized`")
diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs
index 3fdbaf5e947..bf6f082c21c 100644
--- a/compiler/rustc_middle/src/ty/error.rs
+++ b/compiler/rustc_middle/src/ty/error.rs
@@ -90,9 +90,9 @@ impl<'tcx> TypeError<'tcx> {
             // A naive approach to making sure that we're not reporting silly errors such as:
             // (expected closure, found closure).
             if expected == found {
-                format!("expected {}, found a different {}", expected, found)
+                format!("expected {expected}, found a different {found}")
             } else {
-                format!("expected {}, found {}", expected, found)
+                format!("expected {expected}, found {found}")
             }
         }
 
@@ -131,7 +131,7 @@ impl<'tcx> TypeError<'tcx> {
             )
             .into(),
             ArgCount => "incorrect number of function parameters".into(),
-            FieldMisMatch(adt, field) => format!("field type mismatch: {}.{}", adt, field).into(),
+            FieldMisMatch(adt, field) => format!("field type mismatch: {adt}.{field}").into(),
             RegionsDoesNotOutlive(..) => "lifetime mismatch".into(),
             // Actually naming the region here is a bit confusing because context is lacking
             RegionsInsufficientlyPolymorphic(..) => {
@@ -164,7 +164,7 @@ impl<'tcx> TypeError<'tcx> {
                     ty::IntVarValue::IntType(ty) => ty.name_str(),
                     ty::IntVarValue::UintType(ty) => ty.name_str(),
                 };
-                format!("expected `{}`, found `{}`", expected, found).into()
+                format!("expected `{expected}`, found `{found}`").into()
             }
             FloatMismatch(ref values) => format!(
                 "expected `{}`, found `{}`",
diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs
index 48e88daa890..8913bf76d34 100644
--- a/compiler/rustc_middle/src/ty/instance.rs
+++ b/compiler/rustc_middle/src/ty/instance.rs
@@ -308,13 +308,13 @@ fn fmt_instance(
         InstanceDef::ReifyShim(_) => write!(f, " - shim(reify)"),
         InstanceDef::ThreadLocalShim(_) => write!(f, " - shim(tls)"),
         InstanceDef::Intrinsic(_) => write!(f, " - intrinsic"),
-        InstanceDef::Virtual(_, num) => write!(f, " - virtual#{}", num),
-        InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({})", ty),
+        InstanceDef::Virtual(_, num) => write!(f, " - virtual#{num}"),
+        InstanceDef::FnPtrShim(_, ty) => write!(f, " - shim({ty})"),
         InstanceDef::ClosureOnceShim { .. } => write!(f, " - shim"),
         InstanceDef::DropGlue(_, None) => write!(f, " - shim(None)"),
-        InstanceDef::DropGlue(_, Some(ty)) => write!(f, " - shim(Some({}))", ty),
-        InstanceDef::CloneShim(_, ty) => write!(f, " - shim({})", ty),
-        InstanceDef::FnPtrAddrShim(_, ty) => write!(f, " - shim({})", ty),
+        InstanceDef::DropGlue(_, Some(ty)) => write!(f, " - shim(Some({ty}))"),
+        InstanceDef::CloneShim(_, ty) => write!(f, " - shim({ty})"),
+        InstanceDef::FnPtrAddrShim(_, ty) => write!(f, " - shim({ty})"),
     }
 }
 
@@ -336,9 +336,7 @@ impl<'tcx> Instance<'tcx> {
     pub fn new(def_id: DefId, args: GenericArgsRef<'tcx>) -> Instance<'tcx> {
         assert!(
             !args.has_escaping_bound_vars(),
-            "args of instance {:?} not normalized for codegen: {:?}",
-            def_id,
-            args
+            "args of instance {def_id:?} not normalized for codegen: {args:?}"
         );
         Instance { def: InstanceDef::Item(def_id), args }
     }
@@ -425,7 +423,7 @@ impl<'tcx> Instance<'tcx> {
     ) -> Option<Instance<'tcx>> {
         debug!("resolve(def_id={:?}, args={:?})", def_id, args);
         // Use either `resolve_closure` or `resolve_for_vtable`
-        assert!(!tcx.is_closure(def_id), "Called `resolve_for_fn_ptr` on closure: {:?}", def_id);
+        assert!(!tcx.is_closure(def_id), "Called `resolve_for_fn_ptr` on closure: {def_id:?}");
         Instance::resolve(tcx, param_env, def_id, args).ok().flatten().map(|mut resolved| {
             match resolved.def {
                 InstanceDef::Item(def) if resolved.def.requires_caller_location(tcx) => {
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
index 81e7dc3728a..0f7bed0845c 100644
--- a/compiler/rustc_middle/src/ty/layout.rs
+++ b/compiler/rustc_middle/src/ty/layout.rs
@@ -10,7 +10,7 @@ use rustc_hir::def_id::DefId;
 use rustc_index::IndexVec;
 use rustc_session::config::OptLevel;
 use rustc_span::symbol::{sym, Symbol};
-use rustc_span::{Span, DUMMY_SP};
+use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
 use rustc_target::abi::call::FnAbi;
 use rustc_target::abi::*;
 use rustc_target::spec::{abi::Abi as SpecAbi, HasTargetSpec, PanicStrategy, Target};
@@ -212,6 +212,7 @@ pub enum LayoutError<'tcx> {
     Unknown(Ty<'tcx>),
     SizeOverflow(Ty<'tcx>),
     NormalizationFailure(Ty<'tcx>, NormalizationError<'tcx>),
+    ReferencesError(ErrorGuaranteed),
     Cycle,
 }
 
@@ -224,6 +225,7 @@ impl<'tcx> LayoutError<'tcx> {
             SizeOverflow(_) => middle_values_too_big,
             NormalizationFailure(_, _) => middle_cannot_be_normalized,
             Cycle => middle_cycle,
+            ReferencesError(_) => middle_layout_references_error,
         }
     }
 
@@ -237,6 +239,7 @@ impl<'tcx> LayoutError<'tcx> {
                 E::NormalizationFailure { ty, failure_ty: e.get_type_for_failure() }
             }
             Cycle => E::Cycle,
+            ReferencesError(_) => E::ReferencesError,
         }
     }
 }
@@ -246,9 +249,9 @@ impl<'tcx> LayoutError<'tcx> {
 impl<'tcx> fmt::Display for LayoutError<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
-            LayoutError::Unknown(ty) => write!(f, "the type `{}` has an unknown layout", ty),
+            LayoutError::Unknown(ty) => write!(f, "the type `{ty}` has an unknown layout"),
             LayoutError::SizeOverflow(ty) => {
-                write!(f, "values of the type `{}` are too big for the current architecture", ty)
+                write!(f, "values of the type `{ty}` are too big for the current architecture")
             }
             LayoutError::NormalizationFailure(t, e) => write!(
                 f,
@@ -257,6 +260,7 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> {
                 e.get_type_for_failure()
             ),
             LayoutError::Cycle => write!(f, "a cycle occurred during layout computation"),
+            LayoutError::ReferencesError(_) => write!(f, "the type has an unknown layout"),
         }
     }
 }
@@ -323,7 +327,8 @@ impl<'tcx> SizeSkeleton<'tcx> {
             Err(
                 e @ LayoutError::Cycle
                 | e @ LayoutError::SizeOverflow(_)
-                | e @ LayoutError::NormalizationFailure(..),
+                | e @ LayoutError::NormalizationFailure(..)
+                | e @ LayoutError::ReferencesError(_),
             ) => return Err(e),
         };
 
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 0411890ab51..2b4c834f766 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -867,20 +867,6 @@ pub struct TraitPredicate<'tcx> {
 pub type PolyTraitPredicate<'tcx> = ty::Binder<'tcx, TraitPredicate<'tcx>>;
 
 impl<'tcx> TraitPredicate<'tcx> {
-    pub fn remap_constness(&mut self, param_env: &mut ParamEnv<'tcx>) {
-        *param_env = param_env.with_constness(self.constness.and(param_env.constness()))
-    }
-
-    /// Remap the constness of this predicate before emitting it for diagnostics.
-    pub fn remap_constness_diag(&mut self, param_env: ParamEnv<'tcx>) {
-        // this is different to `remap_constness` that callees want to print this predicate
-        // in case of selection errors. `T: ~const Drop` bounds cannot end up here when the
-        // param_env is not const because it is always satisfied in non-const contexts.
-        if let hir::Constness::NotConst = param_env.constness() {
-            self.constness = ty::BoundConstness::NotConst;
-        }
-    }
-
     pub fn with_self_ty(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
         Self { trait_ref: self.trait_ref.with_self_ty(tcx, self_ty), ..self }
     }
@@ -922,14 +908,6 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
         self.map_bound(|trait_ref| trait_ref.self_ty())
     }
 
-    /// Remap the constness of this predicate before emitting it for diagnostics.
-    pub fn remap_constness_diag(&mut self, param_env: ParamEnv<'tcx>) {
-        *self = self.map_bound(|mut p| {
-            p.remap_constness_diag(param_env);
-            p
-        });
-    }
-
     #[inline]
     pub fn is_const_if_const(self) -> bool {
         self.skip_binder().is_const_if_const()
@@ -980,9 +958,9 @@ pub struct Term<'tcx> {
 impl Debug for Term<'_> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let data = if let Some(ty) = self.ty() {
-            format!("Term::Ty({:?})", ty)
+            format!("Term::Ty({ty:?})")
         } else if let Some(ct) = self.ct() {
-            format!("Term::Ct({:?})", ct)
+            format!("Term::Ct({ct:?})")
         } else {
             unreachable!()
         };
@@ -1381,12 +1359,24 @@ impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for PolyTraitPredicate<'tcx> {
     }
 }
 
+impl<'tcx> ToPredicate<'tcx> for OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>> {
+    fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
+        ty::Binder::dummy(PredicateKind::Clause(ClauseKind::RegionOutlives(self))).to_predicate(tcx)
+    }
+}
+
 impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
     fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
         self.map_bound(|p| PredicateKind::Clause(ClauseKind::RegionOutlives(p))).to_predicate(tcx)
     }
 }
 
+impl<'tcx> ToPredicate<'tcx> for OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>> {
+    fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
+        ty::Binder::dummy(PredicateKind::Clause(ClauseKind::TypeOutlives(self))).to_predicate(tcx)
+    }
+}
+
 impl<'tcx> ToPredicate<'tcx> for PolyTypeOutlivesPredicate<'tcx> {
     fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
         self.map_bound(|p| PredicateKind::Clause(ClauseKind::TypeOutlives(p))).to_predicate(tcx)
@@ -1700,15 +1690,12 @@ pub struct ParamEnv<'tcx> {
 #[derive(Copy, Clone)]
 struct ParamTag {
     reveal: traits::Reveal,
-    constness: hir::Constness,
 }
 
 impl_tag! {
     impl Tag for ParamTag;
-    ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::NotConst },
-    ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::NotConst },
-    ParamTag { reveal: traits::Reveal::UserFacing, constness: hir::Constness::Const    },
-    ParamTag { reveal: traits::Reveal::All,        constness: hir::Constness::Const    },
+    ParamTag { reveal: traits::Reveal::UserFacing },
+    ParamTag { reveal: traits::Reveal::All },
 }
 
 impl<'tcx> fmt::Debug for ParamEnv<'tcx> {
@@ -1716,7 +1703,6 @@ impl<'tcx> fmt::Debug for ParamEnv<'tcx> {
         f.debug_struct("ParamEnv")
             .field("caller_bounds", &self.caller_bounds())
             .field("reveal", &self.reveal())
-            .field("constness", &self.constness())
             .finish()
     }
 }
@@ -1725,7 +1711,6 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ParamEnv<'tcx> {
     fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
         self.caller_bounds().hash_stable(hcx, hasher);
         self.reveal().hash_stable(hcx, hasher);
-        self.constness().hash_stable(hcx, hasher);
     }
 }
 
@@ -1737,7 +1722,6 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ParamEnv<'tcx> {
         Ok(ParamEnv::new(
             self.caller_bounds().try_fold_with(folder)?,
             self.reveal().try_fold_with(folder)?,
-            self.constness(),
         ))
     }
 }
@@ -1756,7 +1740,7 @@ impl<'tcx> ParamEnv<'tcx> {
     /// type-checking.
     #[inline]
     pub fn empty() -> Self {
-        Self::new(List::empty(), Reveal::UserFacing, hir::Constness::NotConst)
+        Self::new(List::empty(), Reveal::UserFacing)
     }
 
     #[inline]
@@ -1769,16 +1753,6 @@ impl<'tcx> ParamEnv<'tcx> {
         self.packed.tag().reveal
     }
 
-    #[inline]
-    pub fn constness(self) -> hir::Constness {
-        self.packed.tag().constness
-    }
-
-    #[inline]
-    pub fn is_const(self) -> bool {
-        self.packed.tag().constness == hir::Constness::Const
-    }
-
     /// Construct a trait environment with no where-clauses in scope
     /// where the values of all `impl Trait` and other hidden types
     /// are revealed. This is suitable for monomorphized, post-typeck
@@ -1788,17 +1762,13 @@ impl<'tcx> ParamEnv<'tcx> {
     /// or invoke `param_env.with_reveal_all()`.
     #[inline]
     pub fn reveal_all() -> Self {
-        Self::new(List::empty(), Reveal::All, hir::Constness::NotConst)
+        Self::new(List::empty(), Reveal::All)
     }
 
     /// Construct a trait environment with the given set of predicates.
     #[inline]
-    pub fn new(
-        caller_bounds: &'tcx List<Clause<'tcx>>,
-        reveal: Reveal,
-        constness: hir::Constness,
-    ) -> Self {
-        ty::ParamEnv { packed: CopyTaggedPtr::new(caller_bounds, ParamTag { reveal, constness }) }
+    pub fn new(caller_bounds: &'tcx List<Clause<'tcx>>, reveal: Reveal) -> Self {
+        ty::ParamEnv { packed: CopyTaggedPtr::new(caller_bounds, ParamTag { reveal }) }
     }
 
     pub fn with_user_facing(mut self) -> Self {
@@ -1806,29 +1776,6 @@ impl<'tcx> ParamEnv<'tcx> {
         self
     }
 
-    #[inline]
-    pub fn with_constness(mut self, constness: hir::Constness) -> Self {
-        self.packed.set_tag(ParamTag { constness, ..self.packed.tag() });
-        self
-    }
-
-    #[inline]
-    pub fn with_const(mut self) -> Self {
-        self.packed.set_tag(ParamTag { constness: hir::Constness::Const, ..self.packed.tag() });
-        self
-    }
-
-    #[inline]
-    pub fn without_const(mut self) -> Self {
-        self.packed.set_tag(ParamTag { constness: hir::Constness::NotConst, ..self.packed.tag() });
-        self
-    }
-
-    #[inline]
-    pub fn remap_constness_with(&mut self, mut constness: ty::BoundConstness) {
-        *self = self.with_constness(constness.and(self.constness()))
-    }
-
     /// Returns a new parameter environment with the same clauses, but
     /// which "reveals" the true results of projections in all cases
     /// (even for associated types that are specializable). This is
@@ -1843,17 +1790,13 @@ impl<'tcx> ParamEnv<'tcx> {
             return self;
         }
 
-        ParamEnv::new(
-            tcx.reveal_opaque_types_in_bounds(self.caller_bounds()),
-            Reveal::All,
-            self.constness(),
-        )
+        ParamEnv::new(tcx.reveal_opaque_types_in_bounds(self.caller_bounds()), Reveal::All)
     }
 
     /// Returns this same environment but with no caller bounds.
     #[inline]
     pub fn without_caller_bounds(self) -> Self {
-        Self::new(List::empty(), self.reveal(), self.constness())
+        Self::new(List::empty(), self.reveal())
     }
 
     /// Creates a suitable environment in which to perform trait
@@ -2682,19 +2625,6 @@ impl<'tcx> TyCtxt<'tcx> {
         matches!(self.trait_of_item(def_id), Some(trait_id) if self.has_attr(trait_id, sym::const_trait))
     }
 
-    pub fn impl_trait_in_trait_parent_fn(self, mut def_id: DefId) -> DefId {
-        match self.opt_rpitit_info(def_id) {
-            Some(ImplTraitInTraitData::Trait { fn_def_id, .. })
-            | Some(ImplTraitInTraitData::Impl { fn_def_id, .. }) => fn_def_id,
-            None => {
-                while let def_kind = self.def_kind(def_id) && def_kind != DefKind::AssocFn {
-                    def_id = self.parent(def_id);
-                }
-                def_id
-            }
-        }
-    }
-
     /// Returns the `DefId` of the item within which the `impl Trait` is declared.
     /// For type-alias-impl-trait this is the `type` alias.
     /// For impl-trait-in-assoc-type this is the assoc type.
diff --git a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
index 3c2c4483c73..2415d50b278 100644
--- a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
+++ b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
@@ -20,8 +20,8 @@ pub enum NormalizationError<'tcx> {
 impl<'tcx> NormalizationError<'tcx> {
     pub fn get_type_for_failure(&self) -> String {
         match self {
-            NormalizationError::Type(t) => format!("{}", t),
-            NormalizationError::Const(c) => format!("{}", c),
+            NormalizationError::Type(t) => format!("{t}"),
+            NormalizationError::Const(c) => format!("{c}"),
         }
     }
 }
diff --git a/compiler/rustc_middle/src/ty/opaque_types.rs b/compiler/rustc_middle/src/ty/opaque_types.rs
index 7ae8be2dab3..0ff5ac90304 100644
--- a/compiler/rustc_middle/src/ty/opaque_types.rs
+++ b/compiler/rustc_middle/src/ty/opaque_types.rs
@@ -124,7 +124,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
 
         match self.map.get(&r.into()).map(|k| k.unpack()) {
             Some(GenericArgKind::Lifetime(r1)) => r1,
-            Some(u) => panic!("region mapped to unexpected kind: {:?}", u),
+            Some(u) => panic!("region mapped to unexpected kind: {u:?}"),
             None if self.do_not_error => self.tcx.lifetimes.re_static,
             None => {
                 let e = self
@@ -134,9 +134,8 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
                     .span_label(
                         self.span,
                         format!(
-                            "lifetime `{}` is part of concrete type but not used in \
-                             parameter list of the `impl Trait` type alias",
-                            r
+                            "lifetime `{r}` is part of concrete type but not used in \
+                             parameter list of the `impl Trait` type alias"
                         ),
                     )
                     .emit();
@@ -169,7 +168,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
                     // Found it in the substitution list; replace with the parameter from the
                     // opaque type.
                     Some(GenericArgKind::Type(t1)) => t1,
-                    Some(u) => panic!("type mapped to unexpected kind: {:?}", u),
+                    Some(u) => panic!("type mapped to unexpected kind: {u:?}"),
                     None => {
                         debug!(?param, ?self.map);
                         if !self.ignore_errors {
@@ -178,9 +177,8 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
                                 .struct_span_err(
                                     self.span,
                                     format!(
-                                        "type parameter `{}` is part of concrete type but not \
-                                          used in parameter list for the `impl Trait` type alias",
-                                        ty
+                                        "type parameter `{ty}` is part of concrete type but not \
+                                          used in parameter list for the `impl Trait` type alias"
                                     ),
                                 )
                                 .emit();
@@ -205,7 +203,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseMapper<'tcx> {
                     // Found it in the substitution list, replace with the parameter from the
                     // opaque type.
                     Some(GenericArgKind::Const(c1)) => c1,
-                    Some(u) => panic!("const mapped to unexpected kind: {:?}", u),
+                    Some(u) => panic!("const mapped to unexpected kind: {u:?}"),
                     None => {
                         let guar = self
                             .tcx
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index e5633223464..f146f8aa8b4 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -17,6 +17,7 @@ use rustc_hir::LangItem;
 use rustc_session::config::TrimmedDefPaths;
 use rustc_session::cstore::{ExternCrate, ExternCrateSource};
 use rustc_session::Limit;
+use rustc_span::sym;
 use rustc_span::symbol::{kw, Ident, Symbol};
 use rustc_span::FileNameDisplayPreference;
 use rustc_target::abi::Size;
@@ -1497,7 +1498,7 @@ pub trait PrettyPrinter<'tcx>:
                 let data = int.assert_bits(self.tcx().data_layout.pointer_size);
                 self = self.typed_value(
                     |mut this| {
-                        write!(this, "0x{:x}", data)?;
+                        write!(this, "0x{data:x}")?;
                         Ok(this)
                     },
                     |this| this.print_type(ty),
@@ -1510,7 +1511,7 @@ pub trait PrettyPrinter<'tcx>:
                     if int.size() == Size::ZERO {
                         write!(this, "transmute(())")?;
                     } else {
-                        write!(this, "transmute(0x{:x})", int)?;
+                        write!(this, "transmute(0x{int:x})")?;
                     }
                     Ok(this)
                 };
@@ -2017,11 +2018,37 @@ impl<'tcx> Printer<'tcx> for FmtPrinter<'_, 'tcx> {
     ) -> Result<Self::Path, Self::Error> {
         self = print_prefix(self)?;
 
-        if args.first().is_some() {
+        let tcx = self.tcx;
+
+        let args = args.iter().copied();
+
+        let args: Vec<_> = if !tcx.sess.verbose() {
+            // skip host param as those are printed as `~const`
+            args.filter(|arg| match arg.unpack() {
+                // FIXME(effects) there should be a better way than just matching the name
+                GenericArgKind::Const(c)
+                    if tcx.features().effects
+                        && matches!(
+                            c.kind(),
+                            ty::ConstKind::Param(ty::ParamConst { name: sym::host, .. })
+                        ) =>
+                {
+                    false
+                }
+                _ => true,
+            })
+            .collect()
+        } else {
+            // If -Zverbose is passed, we should print the host parameter instead
+            // of eating it.
+            args.collect()
+        };
+
+        if !args.is_empty() {
             if self.in_value {
                 write!(self, "::")?;
             }
-            self.generic_delimiters(|cx| cx.comma_sep(args.iter().cloned()))
+            self.generic_delimiters(|cx| cx.comma_sep(args.into_iter()))
         } else {
             Ok(self)
         }
@@ -2348,10 +2375,10 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
             } else {
                 cont
             };
-            let _ = write!(cx, "{}", w);
+            let _ = write!(cx, "{w}");
         };
         let do_continue = |cx: &mut Self, cont: Symbol| {
-            let _ = write!(cx, "{}", cont);
+            let _ = write!(cx, "{cont}");
         };
 
         define_scoped_cx!(self);
@@ -2387,7 +2414,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
         let (new_value, map) = if self.should_print_verbose() {
             for var in value.bound_vars().iter() {
                 start_or_continue(&mut self, "for<", ", ");
-                write!(self, "{:?}", var)?;
+                write!(self, "{var:?}")?;
             }
             start_or_continue(&mut self, "", "> ");
             (value.clone().skip_binder(), BTreeMap::default())
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs
index 9d380a58d9f..2a6044cad37 100644
--- a/compiler/rustc_middle/src/ty/structural_impls.rs
+++ b/compiler/rustc_middle/src/ty/structural_impls.rs
@@ -73,9 +73,9 @@ impl fmt::Debug for ty::BoundRegionKind {
             ty::BrAnon(span) => write!(f, "BrAnon({span:?})"),
             ty::BrNamed(did, name) => {
                 if did.is_crate_root() {
-                    write!(f, "BrNamed({})", name)
+                    write!(f, "BrNamed({name})")
                 } else {
-                    write!(f, "BrNamed({:?}, {})", did, name)
+                    write!(f, "BrNamed({did:?}, {name})")
                 }
             }
             ty::BrEnv => write!(f, "BrEnv"),
@@ -205,7 +205,7 @@ impl<'tcx> fmt::Debug for ty::ClauseKind<'tcx> {
             ty::ClauseKind::RegionOutlives(ref pair) => pair.fmt(f),
             ty::ClauseKind::TypeOutlives(ref pair) => pair.fmt(f),
             ty::ClauseKind::Projection(ref pair) => pair.fmt(f),
-            ty::ClauseKind::WellFormed(ref data) => write!(f, "WellFormed({:?})", data),
+            ty::ClauseKind::WellFormed(ref data) => write!(f, "WellFormed({data:?})"),
             ty::ClauseKind::ConstEvaluatable(ct) => {
                 write!(f, "ConstEvaluatable({ct:?})")
             }
@@ -220,12 +220,12 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
             ty::PredicateKind::Subtype(ref pair) => pair.fmt(f),
             ty::PredicateKind::Coerce(ref pair) => pair.fmt(f),
             ty::PredicateKind::ObjectSafe(trait_def_id) => {
-                write!(f, "ObjectSafe({:?})", trait_def_id)
+                write!(f, "ObjectSafe({trait_def_id:?})")
             }
             ty::PredicateKind::ClosureKind(closure_def_id, closure_args, kind) => {
-                write!(f, "ClosureKind({:?}, {:?}, {:?})", closure_def_id, closure_args, kind)
+                write!(f, "ClosureKind({closure_def_id:?}, {closure_args:?}, {kind:?})")
             }
-            ty::PredicateKind::ConstEquate(c1, c2) => write!(f, "ConstEquate({:?}, {:?})", c1, c2),
+            ty::PredicateKind::ConstEquate(c1, c2) => write!(f, "ConstEquate({c1:?}, {c2:?})"),
             ty::PredicateKind::Ambiguous => write!(f, "Ambiguous"),
             ty::PredicateKind::AliasRelate(t1, t2, dir) => {
                 write!(f, "AliasRelate({t1:?}, {dir:?}, {t2:?})")
@@ -602,7 +602,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ParamEnv<'a> {
     type Lifted = ty::ParamEnv<'tcx>;
     fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
         tcx.lift(self.caller_bounds())
-            .map(|caller_bounds| ty::ParamEnv::new(caller_bounds, self.reveal(), self.constness()))
+            .map(|caller_bounds| ty::ParamEnv::new(caller_bounds, self.reveal()))
     }
 }
 
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs
index 553b76cad4e..90ecc8aa857 100644
--- a/compiler/rustc_middle/src/ty/util.rs
+++ b/compiler/rustc_middle/src/ty/util.rs
@@ -57,7 +57,7 @@ impl<'tcx> fmt::Display for Discr<'tcx> {
                 let x = self.val;
                 // sign extend the raw representation to be an i128
                 let x = size.sign_extend(x) as i128;
-                write!(fmt, "{}", x)
+                write!(fmt, "{x}")
             }
             _ => write!(fmt, "{}", self.val),
         }
diff --git a/compiler/rustc_middle/src/ty/vtable.rs b/compiler/rustc_middle/src/ty/vtable.rs
index 443791d0af4..97402caa001 100644
--- a/compiler/rustc_middle/src/ty/vtable.rs
+++ b/compiler/rustc_middle/src/ty/vtable.rs
@@ -29,8 +29,8 @@ impl<'tcx> fmt::Debug for VtblEntry<'tcx> {
             VtblEntry::MetadataSize => write!(f, "MetadataSize"),
             VtblEntry::MetadataAlign => write!(f, "MetadataAlign"),
             VtblEntry::Vacant => write!(f, "Vacant"),
-            VtblEntry::Method(instance) => write!(f, "Method({})", instance),
-            VtblEntry::TraitVPtr(trait_ref) => write!(f, "TraitVPtr({})", trait_ref),
+            VtblEntry::Method(instance) => write!(f, "Method({instance})"),
+            VtblEntry::TraitVPtr(trait_ref) => write!(f, "TraitVPtr({trait_ref})"),
         }
     }
 }
diff --git a/compiler/rustc_middle/src/util/bug.rs b/compiler/rustc_middle/src/util/bug.rs
index 43ee0343f5a..634ed5ec54b 100644
--- a/compiler/rustc_middle/src/util/bug.rs
+++ b/compiler/rustc_middle/src/util/bug.rs
@@ -29,7 +29,7 @@ fn opt_span_bug_fmt<S: Into<MultiSpan>>(
     location: &Location<'_>,
 ) -> ! {
     tls::with_opt(move |tcx| {
-        let msg = format!("{}: {}", location, args);
+        let msg = format!("{location}: {args}");
         match (tcx, span) {
             (Some(tcx), Some(span)) => tcx.sess.diagnostic().span_bug(span, msg),
             (Some(tcx), None) => tcx.sess.diagnostic().bug(msg),
diff --git a/compiler/rustc_middle/src/util/common.rs b/compiler/rustc_middle/src/util/common.rs
index 08977049db0..df101a2f6e4 100644
--- a/compiler/rustc_middle/src/util/common.rs
+++ b/compiler/rustc_middle/src/util/common.rs
@@ -17,7 +17,7 @@ pub fn to_readable_str(mut val: usize) -> String {
             groups.push(group.to_string());
             break;
         } else {
-            groups.push(format!("{:03}", group));
+            groups.push(format!("{group:03}"));
         }
     }
 
diff --git a/compiler/rustc_mir_build/Cargo.toml b/compiler/rustc_mir_build/Cargo.toml
index 58449ee9eb4..c7e2c625ce5 100644
--- a/compiler/rustc_mir_build/Cargo.toml
+++ b/compiler/rustc_mir_build/Cargo.toml
@@ -10,7 +10,7 @@ rustc_arena = { path = "../rustc_arena" }
 tracing = "0.1"
 either = "1"
 rustc_middle = { path = "../rustc_middle" }
-rustc_apfloat = { path = "../rustc_apfloat" }
+rustc_apfloat = "0.2.0"
 rustc_data_structures = { path = "../rustc_data_structures" }
 rustc_index = { path = "../rustc_index" }
 rustc_errors = { path = "../rustc_errors" }
diff --git a/compiler/rustc_mir_build/src/build/custom/parse.rs b/compiler/rustc_mir_build/src/build/custom/parse.rs
index c494929cbff..60c4a041696 100644
--- a/compiler/rustc_mir_build/src/build/custom/parse.rs
+++ b/compiler/rustc_mir_build/src/build/custom/parse.rs
@@ -74,7 +74,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
             kind @ StmtKind::Let { pattern, .. } => {
                 return Err(ParseError {
                     span: pattern.span,
-                    item_description: format!("{:?}", kind),
+                    item_description: format!("{kind:?}"),
                     expected: "expression".to_string(),
                 });
             }
diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
index 7817c3d0d80..3220a184d49 100644
--- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
+++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
@@ -774,8 +774,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                         // Not in a closure
                         debug_assert!(
                             local == ty::CAPTURE_STRUCT_LOCAL,
-                            "Expected local to be Local(1), found {:?}",
-                            local
+                            "Expected local to be Local(1), found {local:?}"
                         );
                         // Not in a closure
                         debug_assert!(
diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs
index 6f14891cb78..ed3ac7cb3ec 100644
--- a/compiler/rustc_mir_build/src/build/matches/mod.rs
+++ b/compiler/rustc_mir_build/src/build/matches/mod.rs
@@ -1627,9 +1627,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         // at least the first candidate ought to be tested
         assert!(
             total_candidate_count > candidates.len(),
-            "{}, {:#?}",
-            total_candidate_count,
-            candidates
+            "{total_candidate_count}, {candidates:#?}"
         );
         debug!("tested_candidates: {}", total_candidate_count - candidates.len());
         debug!("untested_candidates: {}", candidates.len());
diff --git a/compiler/rustc_mir_build/src/build/matches/test.rs b/compiler/rustc_mir_build/src/build/matches/test.rs
index 275878a3919..484e8490919 100644
--- a/compiler/rustc_mir_build/src/build/matches/test.rs
+++ b/compiler/rustc_mir_build/src/build/matches/test.rs
@@ -175,16 +175,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                             debug_assert_ne!(
                                 target_blocks[idx.index()],
                                 otherwise_block,
-                                "no candidates for tested discriminant: {:?}",
-                                discr,
+                                "no candidates for tested discriminant: {discr:?}",
                             );
                             Some((discr.val, target_blocks[idx.index()]))
                         } else {
                             debug_assert_eq!(
                                 target_blocks[idx.index()],
                                 otherwise_block,
-                                "found candidates for untested discriminant: {:?}",
-                                discr,
+                                "found candidates for untested discriminant: {discr:?}",
                             );
                             None
                         }
diff --git a/compiler/rustc_mir_build/src/build/mod.rs b/compiler/rustc_mir_build/src/build/mod.rs
index 17295fe1d34..c66eba5520e 100644
--- a/compiler/rustc_mir_build/src/build/mod.rs
+++ b/compiler/rustc_mir_build/src/build/mod.rs
@@ -94,8 +94,7 @@ fn mir_build(tcx: TyCtxt<'_>, def: LocalDefId) -> Body<'_> {
             || body.basic_blocks.has_free_regions()
             || body.var_debug_info.has_free_regions()
             || body.yield_ty().has_free_regions()),
-        "Unexpected free regions in MIR: {:?}",
-        body,
+        "Unexpected free regions in MIR: {body:?}",
     );
 
     body
@@ -571,7 +570,7 @@ fn construct_const<'a, 'tcx>(
     // Figure out what primary body this item has.
     let (span, const_ty_span) = match tcx.hir().get(hir_id) {
         Node::Item(hir::Item {
-            kind: hir::ItemKind::Static(ty, _, _) | hir::ItemKind::Const(ty, _),
+            kind: hir::ItemKind::Static(ty, _, _) | hir::ItemKind::Const(ty, _, _),
             span,
             ..
         })
@@ -977,9 +976,9 @@ pub(crate) fn parse_float_into_scalar(
     match float_ty {
         ty::FloatTy::F32 => {
             let Ok(rust_f) = num.parse::<f32>() else { return None };
-            let mut f = num.parse::<Single>().unwrap_or_else(|e| {
-                panic!("apfloat::ieee::Single failed to parse `{}`: {:?}", num, e)
-            });
+            let mut f = num
+                .parse::<Single>()
+                .unwrap_or_else(|e| panic!("apfloat::ieee::Single failed to parse `{num}`: {e:?}"));
 
             assert!(
                 u128::from(rust_f.to_bits()) == f.to_bits(),
@@ -1000,9 +999,9 @@ pub(crate) fn parse_float_into_scalar(
         }
         ty::FloatTy::F64 => {
             let Ok(rust_f) = num.parse::<f64>() else { return None };
-            let mut f = num.parse::<Double>().unwrap_or_else(|e| {
-                panic!("apfloat::ieee::Double failed to parse `{}`: {:?}", num, e)
-            });
+            let mut f = num
+                .parse::<Double>()
+                .unwrap_or_else(|e| panic!("apfloat::ieee::Double failed to parse `{num}`: {e:?}"));
 
             assert!(
                 u128::from(rust_f.to_bits()) == f.to_bits(),
diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs
index 820ab93851e..3ff3387a781 100644
--- a/compiler/rustc_mir_build/src/errors.rs
+++ b/compiler/rustc_mir_build/src/errors.rs
@@ -454,17 +454,13 @@ impl<'a> IntoDiagnostic<'a> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> {
         if self.span.eq_ctxt(self.expr_span) {
             // Get the span for the empty match body `{}`.
             let (indentation, more) = if let Some(snippet) = sm.indentation_before(self.span) {
-                (format!("\n{}", snippet), "    ")
+                (format!("\n{snippet}"), "    ")
             } else {
                 (" ".to_string(), "")
             };
             suggestion = Some((
                 self.span.shrink_to_hi().with_hi(self.expr_span.hi()),
-                format!(
-                    " {{{indentation}{more}_ => todo!(),{indentation}}}",
-                    indentation = indentation,
-                    more = more,
-                ),
+                format!(" {{{indentation}{more}_ => todo!(),{indentation}}}",),
             ));
         }
 
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
index 711a9126c04..ff4620948fa 100644
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
@@ -229,9 +229,7 @@ impl<'tcx> Cx<'tcx> {
             let param_env_ty = self.param_env.and(discr_ty);
             let size = tcx
                 .layout_of(param_env_ty)
-                .unwrap_or_else(|e| {
-                    panic!("could not compute layout for {:?}: {:?}", param_env_ty, e)
-                })
+                .unwrap_or_else(|e| panic!("could not compute layout for {param_env_ty:?}: {e:?}"))
                 .size;
 
             let lit = ScalarInt::try_from_uint(discr_offset as u128, size).unwrap();
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
index 38c866c50a2..a786e659664 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
@@ -691,7 +691,7 @@ fn non_exhaustive_match<'p, 'tcx>(
         err = create_e0004(
             cx.tcx.sess,
             sp,
-            format!("non-exhaustive patterns: {} not covered", joined_patterns),
+            format!("non-exhaustive patterns: {joined_patterns} not covered"),
         );
         err.span_label(sp, pattern_not_covered_label(&witnesses, &joined_patterns));
         patterns_len = witnesses.len();
@@ -721,15 +721,13 @@ fn non_exhaustive_match<'p, 'tcx>(
         && matches!(witnesses[0].ctor(), Constructor::NonExhaustive)
     {
         err.note(format!(
-            "`{}` does not have a fixed maximum value, so a wildcard `_` is necessary to match \
+            "`{scrut_ty}` does not have a fixed maximum value, so a wildcard `_` is necessary to match \
              exhaustively",
-            scrut_ty,
         ));
         if cx.tcx.sess.is_nightly_build() {
             err.help(format!(
                 "add `#![feature(precise_pointer_size_matching)]` to the crate attributes to \
-                 enable precise `{}` matching",
-                scrut_ty,
+                 enable precise `{scrut_ty}` matching",
             ));
         }
     }
@@ -745,18 +743,13 @@ fn non_exhaustive_match<'p, 'tcx>(
         [] if sp.eq_ctxt(expr_span) => {
             // Get the span for the empty match body `{}`.
             let (indentation, more) = if let Some(snippet) = sm.indentation_before(sp) {
-                (format!("\n{}", snippet), "    ")
+                (format!("\n{snippet}"), "    ")
             } else {
                 (" ".to_string(), "")
             };
             suggestion = Some((
                 sp.shrink_to_hi().with_hi(expr_span.hi()),
-                format!(
-                    " {{{indentation}{more}{pattern} => todo!(),{indentation}}}",
-                    indentation = indentation,
-                    more = more,
-                    pattern = pattern,
-                ),
+                format!(" {{{indentation}{more}{pattern} => todo!(),{indentation}}}",),
             ));
         }
         [only] => {
@@ -765,7 +758,7 @@ fn non_exhaustive_match<'p, 'tcx>(
                 && let Ok(with_trailing) = sm.span_extend_while(only.span, |c| c.is_whitespace() || c == ',')
                 && sm.is_multiline(with_trailing)
             {
-                (format!("\n{}", snippet), true)
+                (format!("\n{snippet}"), true)
             } else {
                 (" ".to_string(), false)
             };
@@ -780,7 +773,7 @@ fn non_exhaustive_match<'p, 'tcx>(
             };
             suggestion = Some((
                 only.span.shrink_to_hi(),
-                format!("{}{}{} => todo!()", comma, pre_indentation, pattern),
+                format!("{comma}{pre_indentation}{pattern} => todo!()"),
             ));
         }
         [.., prev, last] => {
@@ -803,7 +796,7 @@ fn non_exhaustive_match<'p, 'tcx>(
                 if let Some(spacing) = spacing {
                     suggestion = Some((
                         last.span.shrink_to_hi(),
-                        format!("{}{}{} => todo!()", comma, spacing, pattern),
+                        format!("{comma}{spacing}{pattern} => todo!()"),
                     ));
                 }
             }
@@ -900,7 +893,7 @@ fn adt_defined_here<'p, 'tcx>(
         for pat in spans {
             span.push_span_label(pat, "not covered");
         }
-        err.span_note(span, format!("`{}` defined here", ty));
+        err.span_note(span, format!("`{ty}` defined here"));
     }
 }
 
diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
index 4228597cdc9..bee1c4e4614 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
@@ -306,9 +306,9 @@ impl fmt::Debug for IntRange {
         let (lo, hi) = self.boundaries();
         let bias = self.bias;
         let (lo, hi) = (lo ^ bias, hi ^ bias);
-        write!(f, "{}", lo)?;
+        write!(f, "{lo}")?;
         write!(f, "{}", RangeEnd::Included)?;
-        write!(f, "{}", hi)
+        write!(f, "{hi}")
     }
 }
 
@@ -1619,7 +1619,7 @@ impl<'p, 'tcx> fmt::Debug for DeconstructedPat<'p, 'tcx> {
                     // of `std`). So this branch is only reachable when the feature is enabled and
                     // the pattern is a box pattern.
                     let subpattern = self.iter_fields().next().unwrap();
-                    write!(f, "box {:?}", subpattern)
+                    write!(f, "box {subpattern:?}")
                 }
                 ty::Adt(..) | ty::Tuple(..) => {
                     let variant = match self.ty.kind() {
@@ -1638,7 +1638,7 @@ impl<'p, 'tcx> fmt::Debug for DeconstructedPat<'p, 'tcx> {
                     write!(f, "(")?;
                     for p in self.iter_fields() {
                         write!(f, "{}", start_or_comma())?;
-                        write!(f, "{:?}", p)?;
+                        write!(f, "{p:?}")?;
                     }
                     write!(f, ")")
                 }
@@ -1674,11 +1674,11 @@ impl<'p, 'tcx> fmt::Debug for DeconstructedPat<'p, 'tcx> {
                 write!(f, "]")
             }
             &FloatRange(lo, hi, end) => {
-                write!(f, "{}", lo)?;
-                write!(f, "{}", end)?;
-                write!(f, "{}", hi)
+                write!(f, "{lo}")?;
+                write!(f, "{end}")?;
+                write!(f, "{hi}")
             }
-            IntRange(range) => write!(f, "{:?}", range), // Best-effort, will render e.g. `false` as `0..=0`
+            IntRange(range) => write!(f, "{range:?}"), // Best-effort, will render e.g. `false` as `0..=0`
             Wildcard | Missing { .. } | NonExhaustive => write!(f, "_ : {:?}", self.ty),
             Or => {
                 for pat in self.iter_fields() {
@@ -1686,7 +1686,7 @@ impl<'p, 'tcx> fmt::Debug for DeconstructedPat<'p, 'tcx> {
                 }
                 Ok(())
             }
-            Str(value) => write!(f, "{}", value),
+            Str(value) => write!(f, "{value}"),
             Opaque => write!(f, "<constant pattern>"),
         }
     }
diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
index e5b63506906..08cfe98bb68 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs
@@ -459,7 +459,7 @@ impl<'p, 'tcx> fmt::Debug for PatStack<'p, 'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "+")?;
         for pat in self.iter() {
-            write!(f, " {:?} +", pat)?;
+            write!(f, " {pat:?} +")?;
         }
         Ok(())
     }
@@ -530,7 +530,7 @@ impl<'p, 'tcx> fmt::Debug for Matrix<'p, 'tcx> {
 
         let Matrix { patterns: m, .. } = self;
         let pretty_printed_matrix: Vec<Vec<String>> =
-            m.iter().map(|row| row.iter().map(|pat| format!("{:?}", pat)).collect()).collect();
+            m.iter().map(|row| row.iter().map(|pat| format!("{pat:?}")).collect()).collect();
 
         let column_count = m.iter().map(|row| row.len()).next().unwrap_or(0);
         assert!(m.iter().all(|row| row.len() == column_count));
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index fd6b1dc5c07..8d78ec04821 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -1099,10 +1099,10 @@ fn debug_with_context_rec<V: Debug + Eq>(
         let info_elem = map.places[child].proj_elem.unwrap();
         let child_place_str = match info_elem {
             TrackElem::Discriminant => {
-                format!("discriminant({})", place_str)
+                format!("discriminant({place_str})")
             }
             TrackElem::Variant(idx) => {
-                format!("({} as {:?})", place_str, idx)
+                format!("({place_str} as {idx:?})")
             }
             TrackElem::Field(field) => {
                 if place_str.starts_with('*') {
diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs
index 658e01d9310..e9c5f856d35 100644
--- a/compiler/rustc_mir_transform/src/coverage/counters.rs
+++ b/compiler/rustc_mir_transform/src/coverage/counters.rs
@@ -282,7 +282,7 @@ impl<'a> BcbCounters<'a> {
             branching_counter_operand,
             Op::Subtract,
             sumup_counter_operand,
-            || Some(format!("{:?}", expression_branch)),
+            || Some(format!("{expression_branch:?}")),
         );
         debug!("{:?} gets an expression: {}", expression_branch, self.format_counter(&expression));
         let bcb = expression_branch.target_bcb;
@@ -324,7 +324,7 @@ impl<'a> BcbCounters<'a> {
         // program results in a tight infinite loop, but it should still compile.
         let one_path_to_target = self.bcb_has_one_path_to_target(bcb);
         if one_path_to_target || self.bcb_predecessors(bcb).contains(&bcb) {
-            let counter_kind = self.coverage_counters.make_counter(|| Some(format!("{:?}", bcb)));
+            let counter_kind = self.coverage_counters.make_counter(|| Some(format!("{bcb:?}")));
             if one_path_to_target {
                 debug!(
                     "{}{:?} gets a new counter: {}",
@@ -392,7 +392,7 @@ impl<'a> BcbCounters<'a> {
             first_edge_counter_operand,
             Op::Add,
             some_sumup_edge_counter_operand.unwrap(),
-            || Some(format!("{:?}", bcb)),
+            || Some(format!("{bcb:?}")),
         );
         debug!(
             "{}{:?} gets a new counter (sum of predecessor counters): {}",
@@ -449,7 +449,7 @@ impl<'a> BcbCounters<'a> {
 
         // Make a new counter to count this edge.
         let counter_kind =
-            self.coverage_counters.make_counter(|| Some(format!("{:?}->{:?}", from_bcb, to_bcb)));
+            self.coverage_counters.make_counter(|| Some(format!("{from_bcb:?}->{to_bcb:?}")));
         debug!(
             "{}Edge {:?}->{:?} gets a new counter: {}",
             NESTED_INDENT.repeat(debug_indent_level),
diff --git a/compiler/rustc_mir_transform/src/coverage/debug.rs b/compiler/rustc_mir_transform/src/coverage/debug.rs
index 7ad98144159..c9914eb9f82 100644
--- a/compiler/rustc_mir_transform/src/coverage/debug.rs
+++ b/compiler/rustc_mir_transform/src/coverage/debug.rs
@@ -630,7 +630,7 @@ pub(super) fn dump_coverage_spanview<'tcx>(
         .expect("Unexpected error creating MIR spanview HTML file");
     let crate_name = tcx.crate_name(def_id.krate);
     let item_name = tcx.def_path(def_id).to_filename_friendly_no_crate();
-    let title = format!("{}.{} - Coverage Spans", crate_name, item_name);
+    let title = format!("{crate_name}.{item_name} - Coverage Spans");
     spanview::write_document(tcx, body_span, span_viewables, &title, &mut file)
         .expect("Unexpected IO error dumping coverage spans as HTML");
 }
@@ -779,7 +779,7 @@ fn bcb_to_string_sections<'tcx>(
         ));
     }
     if let Some(counter_kind) = &bcb_data.counter_kind {
-        sections.push(format!("{:?}", counter_kind));
+        sections.push(format!("{counter_kind:?}"));
     }
     let non_term_blocks = bcb_data.basic_blocks[0..len - 1]
         .iter()
diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs
index d2a854b2675..5d843f4ade0 100644
--- a/compiler/rustc_mir_transform/src/coverage/graph.rs
+++ b/compiler/rustc_mir_transform/src/coverage/graph.rs
@@ -360,8 +360,7 @@ impl BasicCoverageBlockData {
         if let Some(replaced) = self.counter_kind.replace(counter_kind) {
             Error::from_string(format!(
                 "attempt to set a BasicCoverageBlock coverage counter more than once; \
-                {:?} already had counter {:?}",
-                self, replaced,
+                {self:?} already had counter {replaced:?}",
             ))
         } else {
             Ok(operand)
@@ -389,9 +388,8 @@ impl BasicCoverageBlockData {
             // `BasicCoverageBlock`).
             if self.counter_kind.as_ref().is_some_and(|c| !c.is_expression()) {
                 return Error::from_string(format!(
-                    "attempt to add an incoming edge counter from {:?} when the target BCB already \
-                    has a `Counter`",
-                    from_bcb
+                    "attempt to add an incoming edge counter from {from_bcb:?} when the target BCB already \
+                    has a `Counter`"
                 ));
             }
         }
@@ -401,8 +399,7 @@ impl BasicCoverageBlockData {
         {
             Error::from_string(format!(
                 "attempt to set an edge counter more than once; from_bcb: \
-                {:?} already had counter {:?}",
-                from_bcb, replaced,
+                {from_bcb:?} already had counter {replaced:?}",
             ))
         } else {
             Ok(operand)
@@ -612,7 +609,7 @@ impl TraverseCoverageGraphWithLoops {
                             the {}",
                             successor_to_add,
                             if let Some(loop_header) = some_loop_header {
-                                format!("worklist for the loop headed by {:?}", loop_header)
+                                format!("worklist for the loop headed by {loop_header:?}")
                             } else {
                                 String::from("non-loop worklist")
                             },
@@ -623,7 +620,7 @@ impl TraverseCoverageGraphWithLoops {
                             "{:?} successor is non-branching. Defer it to the end of the {}",
                             successor_to_add,
                             if let Some(loop_header) = some_loop_header {
-                                format!("worklist for the loop headed by {:?}", loop_header)
+                                format!("worklist for the loop headed by {loop_header:?}")
                             } else {
                                 String::from("non-loop worklist")
                             },
diff --git a/compiler/rustc_mir_transform/src/coverage/spans.rs b/compiler/rustc_mir_transform/src/coverage/spans.rs
index 35cf9ea5f91..deebf5345ba 100644
--- a/compiler/rustc_mir_transform/src/coverage/spans.rs
+++ b/compiler/rustc_mir_transform/src/coverage/spans.rs
@@ -11,7 +11,7 @@ use rustc_middle::ty::TyCtxt;
 use rustc_span::source_map::original_sp;
 use rustc_span::{BytePos, ExpnKind, MacroKind, Span, Symbol};
 
-use std::cell::RefCell;
+use std::cell::OnceCell;
 use std::cmp::Ordering;
 
 #[derive(Debug, Copy, Clone)]
@@ -67,7 +67,7 @@ impl CoverageStatement {
 pub(super) struct CoverageSpan {
     pub span: Span,
     pub expn_span: Span,
-    pub current_macro_or_none: RefCell<Option<Option<Symbol>>>,
+    pub current_macro_or_none: OnceCell<Option<Symbol>>,
     pub bcb: BasicCoverageBlock,
     pub coverage_statements: Vec<CoverageStatement>,
     pub is_closure: bool,
@@ -175,8 +175,7 @@ impl CoverageSpan {
     /// If the span is part of a macro, returns the macro name symbol.
     pub fn current_macro(&self) -> Option<Symbol> {
         self.current_macro_or_none
-            .borrow_mut()
-            .get_or_insert_with(|| {
+            .get_or_init(|| {
                 if let ExpnKind::Macro(MacroKind::Bang, current_macro) =
                     self.expn_span.ctxt().outer_expn_data().kind
                 {
diff --git a/compiler/rustc_mir_transform/src/coverage/test_macros/src/lib.rs b/compiler/rustc_mir_transform/src/coverage/test_macros/src/lib.rs
index 3d6095d2738..f41adf667ec 100644
--- a/compiler/rustc_mir_transform/src/coverage/test_macros/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/coverage/test_macros/src/lib.rs
@@ -2,5 +2,5 @@ use proc_macro::TokenStream;
 
 #[proc_macro]
 pub fn let_bcb(item: TokenStream) -> TokenStream {
-    format!("let bcb{} = graph::BasicCoverageBlock::from_usize({});", item, item).parse().unwrap()
+    format!("let bcb{item} = graph::BasicCoverageBlock::from_usize({item});").parse().unwrap()
 }
diff --git a/compiler/rustc_mir_transform/src/elaborate_drops.rs b/compiler/rustc_mir_transform/src/elaborate_drops.rs
index d5664e2b40a..43757a9ea35 100644
--- a/compiler/rustc_mir_transform/src/elaborate_drops.rs
+++ b/compiler/rustc_mir_transform/src/elaborate_drops.rs
@@ -358,8 +358,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
                         self.tcx.sess.delay_span_bug(
                             terminator.source_info.span,
                             format!(
-                                "drop of untracked, uninitialized value {:?}, place {:?} ({:?})",
-                                bb, place, path
+                                "drop of untracked, uninitialized value {bb:?}, place {place:?} ({path:?})"
                             ),
                         );
                     }
@@ -424,7 +423,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
                             if !replace {
                                 self.tcx.sess.delay_span_bug(
                                     terminator.source_info.span,
-                                    format!("drop of untracked value {:?}", bb),
+                                    format!("drop of untracked value {bb:?}"),
                                 );
                             }
                             // A drop and replace behind a pointer/array/whatever.
diff --git a/compiler/rustc_mir_transform/src/function_item_references.rs b/compiler/rustc_mir_transform/src/function_item_references.rs
index fdf6ab33c82..a42eacbf22b 100644
--- a/compiler/rustc_mir_transform/src/function_item_references.rs
+++ b/compiler/rustc_mir_transform/src/function_item_references.rs
@@ -168,15 +168,15 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
             }
         };
         let ident = self.tcx.item_name(fn_id).to_ident_string();
-        let ty_params = fn_args.types().map(|ty| format!("{}", ty));
-        let const_params = fn_args.consts().map(|c| format!("{}", c));
+        let ty_params = fn_args.types().map(|ty| format!("{ty}"));
+        let const_params = fn_args.consts().map(|c| format!("{c}"));
         let params = ty_params.chain(const_params).join(", ");
         let num_args = fn_sig.inputs().map_bound(|inputs| inputs.len()).skip_binder();
         let variadic = if fn_sig.c_variadic() { ", ..." } else { "" };
         let ret = if fn_sig.output().skip_binder().is_unit() { "" } else { " -> _" };
         let sugg = format!(
             "{} as {}{}fn({}{}){}",
-            if params.is_empty() { ident.clone() } else { format!("{}::<{}>", ident, params) },
+            if params.is_empty() { ident.clone() } else { format!("{ident}::<{params}>") },
             unsafety,
             abi,
             vec!["_"; num_args].join(", "),
diff --git a/compiler/rustc_mir_transform/src/generator.rs b/compiler/rustc_mir_transform/src/generator.rs
index eaeaff69cf3..669135f80bc 100644
--- a/compiler/rustc_mir_transform/src/generator.rs
+++ b/compiler/rustc_mir_transform/src/generator.rs
@@ -1477,7 +1477,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
                 )
             }
             _ => {
-                tcx.sess.delay_span_bug(body.span, format!("unexpected generator type {}", gen_ty));
+                tcx.sess.delay_span_bug(body.span, format!("unexpected generator type {gen_ty}"));
                 return;
             }
         };
diff --git a/compiler/rustc_mir_transform/src/instsimplify.rs b/compiler/rustc_mir_transform/src/instsimplify.rs
index a430f8da35c..8b0a0903d18 100644
--- a/compiler/rustc_mir_transform/src/instsimplify.rs
+++ b/compiler/rustc_mir_transform/src/instsimplify.rs
@@ -57,7 +57,7 @@ struct InstSimplifyContext<'tcx, 'a> {
 impl<'tcx> InstSimplifyContext<'tcx, '_> {
     fn should_simplify(&self, source_info: &SourceInfo, rvalue: &Rvalue<'tcx>) -> bool {
         self.tcx.consider_optimizing(|| {
-            format!("InstSimplify - Rvalue: {:?} SourceInfo: {:?}", rvalue, source_info)
+            format!("InstSimplify - Rvalue: {rvalue:?} SourceInfo: {source_info:?}")
         })
     }
 
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index d419329f2d6..734321e97d8 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -615,7 +615,7 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
         // computes and caches its result.
         Some(hir::ConstContext::ConstFn) => tcx.ensure_with_value().mir_for_ctfe(did),
         None => {}
-        Some(other) => panic!("do not use `optimized_mir` for constants: {:?}", other),
+        Some(other) => panic!("do not use `optimized_mir` for constants: {other:?}"),
     }
     debug!("about to call mir_drops_elaborated...");
     let body = tcx.mir_drops_elaborated_and_const_checked(did).steal();
diff --git a/compiler/rustc_mir_transform/src/match_branches.rs b/compiler/rustc_mir_transform/src/match_branches.rs
index 6eb48498274..bc29fb8ded1 100644
--- a/compiler/rustc_mir_transform/src/match_branches.rs
+++ b/compiler/rustc_mir_transform/src/match_branches.rs
@@ -51,7 +51,7 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
         let bbs = body.basic_blocks.as_mut();
         let mut should_cleanup = false;
         'outer: for bb_idx in bbs.indices() {
-            if !tcx.consider_optimizing(|| format!("MatchBranchSimplification {:?} ", def_id)) {
+            if !tcx.consider_optimizing(|| format!("MatchBranchSimplification {def_id:?} ")) {
                 continue;
             }
 
diff --git a/compiler/rustc_mir_transform/src/multiple_return_terminators.rs b/compiler/rustc_mir_transform/src/multiple_return_terminators.rs
index 3957cd92c4e..c97d034544a 100644
--- a/compiler/rustc_mir_transform/src/multiple_return_terminators.rs
+++ b/compiler/rustc_mir_transform/src/multiple_return_terminators.rs
@@ -27,7 +27,7 @@ impl<'tcx> MirPass<'tcx> for MultipleReturnTerminators {
         }
 
         for bb in bbs {
-            if !tcx.consider_optimizing(|| format!("MultipleReturnTerminators {:?} ", def_id)) {
+            if !tcx.consider_optimizing(|| format!("MultipleReturnTerminators {def_id:?} ")) {
                 break;
             }
 
diff --git a/compiler/rustc_mir_transform/src/nrvo.rs b/compiler/rustc_mir_transform/src/nrvo.rs
index 5ce96012b90..e1298b0654f 100644
--- a/compiler/rustc_mir_transform/src/nrvo.rs
+++ b/compiler/rustc_mir_transform/src/nrvo.rs
@@ -45,7 +45,7 @@ impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
             return;
         };
 
-        if !tcx.consider_optimizing(|| format!("RenameReturnPlace {:?}", def_id)) {
+        if !tcx.consider_optimizing(|| format!("RenameReturnPlace {def_id:?}")) {
             return;
         }
 
diff --git a/compiler/rustc_mir_transform/src/pass_manager.rs b/compiler/rustc_mir_transform/src/pass_manager.rs
index 710eed3ed38..057f5fe8293 100644
--- a/compiler/rustc_mir_transform/src/pass_manager.rs
+++ b/compiler/rustc_mir_transform/src/pass_manager.rs
@@ -118,7 +118,7 @@ fn run_passes_inner<'tcx>(
                 dump_mir_for_pass(tcx, body, &name, false);
             }
             if validate {
-                validate_body(tcx, body, format!("before pass {}", name));
+                validate_body(tcx, body, format!("before pass {name}"));
             }
 
             tcx.sess.time(name, || pass.run_pass(tcx, body));
@@ -127,7 +127,7 @@ fn run_passes_inner<'tcx>(
                 dump_mir_for_pass(tcx, body, &name, true);
             }
             if validate {
-                validate_body(tcx, body, format!("after pass {}", name));
+                validate_body(tcx, body, format!("after pass {name}"));
             }
 
             body.pass_count += 1;
diff --git a/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs b/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
index 84ccf6e1f61..08b2a6537e9 100644
--- a/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
+++ b/compiler/rustc_mir_transform/src/remove_unneeded_drops.rs
@@ -27,7 +27,7 @@ impl<'tcx> MirPass<'tcx> for RemoveUnneededDrops {
                 if ty.ty.needs_drop(tcx, param_env) {
                     continue;
                 }
-                if !tcx.consider_optimizing(|| format!("RemoveUnneededDrops {:?} ", did)) {
+                if !tcx.consider_optimizing(|| format!("RemoveUnneededDrops {did:?} ")) {
                     continue;
                 }
                 debug!("SUCCESS: replacing `drop` with goto({:?})", target);
diff --git a/compiler/rustc_mir_transform/src/remove_zsts.rs b/compiler/rustc_mir_transform/src/remove_zsts.rs
index 1ba9ad87537..9c6c55b0811 100644
--- a/compiler/rustc_mir_transform/src/remove_zsts.rs
+++ b/compiler/rustc_mir_transform/src/remove_zsts.rs
@@ -102,7 +102,7 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
         let op_ty = operand.ty(self.local_decls, self.tcx);
         if self.known_to_be_zst(op_ty)
             && self.tcx.consider_optimizing(|| {
-                format!("RemoveZsts - Operand: {:?} Location: {:?}", operand, loc)
+                format!("RemoveZsts - Operand: {operand:?} Location: {loc:?}")
             })
         {
             *operand = Operand::Constant(Box::new(self.make_zst(op_ty)))
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs
index c34c2c248fe..de6db8ae6ae 100644
--- a/compiler/rustc_monomorphize/src/partitioning.rs
+++ b/compiler/rustc_monomorphize/src/partitioning.rs
@@ -394,7 +394,7 @@ fn merge_codegen_units<'tcx>(
         && codegen_units.iter().any(|cgu| cgu.size_estimate() < NON_INCR_MIN_CGU_SIZE)
     {
         // Sort small cgus to the back.
-        codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));
+        codegen_units.sort_by_key(|cgu| cmp::Reverse(cgu.size_estimate()));
 
         let mut smallest = codegen_units.pop().unwrap();
         let second_smallest = codegen_units.last_mut().unwrap();
diff --git a/compiler/rustc_parse/messages.ftl b/compiler/rustc_parse/messages.ftl
index 9787d98c1a4..83d96ad8e76 100644
--- a/compiler/rustc_parse/messages.ftl
+++ b/compiler/rustc_parse/messages.ftl
@@ -690,6 +690,8 @@ parse_single_colon_import_path = expected `::`, found `:`
 parse_single_colon_struct_type = found single colon in a struct field type path
     .suggestion = write a path separator here
 
+parse_static_with_generics = static items may not have generic parameters
+
 parse_struct_literal_body_without_path =
     struct literal body without path
     .suggestion = you might have forgotten to add the struct literal inside the block
@@ -722,6 +724,10 @@ parse_sugg_wrap_pattern_in_parens = wrap the pattern in parentheses
 
 parse_switch_mut_let_order =
     switch the order of `mut` and `let`
+
+parse_ternary_operator = Rust has no ternary operator
+    .help = use an `if-else` expression instead
+
 parse_tilde_const_lifetime = `~const` may only modify trait bounds, not lifetime bounds
 
 parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
@@ -847,6 +853,12 @@ parse_visibility_not_followed_by_item = visibility `{$vis}` is not followed by a
     .label = the visibility
     .help = you likely meant to define an item, e.g., `{$vis} fn foo() {"{}"}`
 
+parse_where_clause_before_const_body = where clauses are not allowed before const item bodies
+    .label = unexpected where clause
+    .name_label = while parsing this const item
+    .body_label = the item body
+    .suggestion = move the body before the where clause
+
 parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies
     .label = unexpected where clause
     .name_label = while parsing this tuple struct
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 96e1c0e3c6d..06c09960727 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -365,6 +365,14 @@ pub(crate) enum IfExpressionMissingThenBlockSub {
     AddThenBlock(#[primary_span] Span),
 }
 
+#[derive(Diagnostic)]
+#[diag(parse_ternary_operator)]
+#[help]
+pub struct TernaryOperator {
+    #[primary_span]
+    pub span: Span,
+}
+
 #[derive(Subdiagnostic)]
 #[suggestion(parse_extra_if_in_let_else, applicability = "maybe-incorrect", code = "")]
 pub(crate) struct IfExpressionLetSomeSub {
@@ -2692,3 +2700,34 @@ pub(crate) struct ExpectedBuiltinIdent {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(parse_static_with_generics)]
+pub(crate) struct StaticWithGenerics {
+    #[primary_span]
+    pub span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(parse_where_clause_before_const_body)]
+pub(crate) struct WhereClauseBeforeConstBody {
+    #[primary_span]
+    #[label]
+    pub span: Span,
+    #[label(parse_name_label)]
+    pub name: Span,
+    #[label(parse_body_label)]
+    pub body: Span,
+    #[subdiagnostic]
+    pub sugg: Option<WhereClauseBeforeConstBodySugg>,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")]
+pub(crate) struct WhereClauseBeforeConstBodySugg {
+    #[suggestion_part(code = "= {snippet} ")]
+    pub left: Span,
+    pub snippet: String,
+    #[suggestion_part(code = "")]
+    pub right: Span,
+}
diff --git a/compiler/rustc_parse/src/lexer/diagnostics.rs b/compiler/rustc_parse/src/lexer/diagnostics.rs
index 9e6d27bf036..b50bb47f297 100644
--- a/compiler/rustc_parse/src/lexer/diagnostics.rs
+++ b/compiler/rustc_parse/src/lexer/diagnostics.rs
@@ -46,7 +46,7 @@ pub fn report_missing_open_delim(
             };
             err.span_label(
                 unmatch_brace.found_span.shrink_to_lo(),
-                format!("missing open `{}` for this delimiter", missed_open),
+                format!("missing open `{missed_open}` for this delimiter"),
             );
             reported_missing_open = true;
         }
diff --git a/compiler/rustc_parse/src/lexer/tokentrees.rs b/compiler/rustc_parse/src/lexer/tokentrees.rs
index 318a2998509..07910113dee 100644
--- a/compiler/rustc_parse/src/lexer/tokentrees.rs
+++ b/compiler/rustc_parse/src/lexer/tokentrees.rs
@@ -198,7 +198,7 @@ impl<'a> TokenTreesReader<'a> {
         // An unexpected closing delimiter (i.e., there is no
         // matching opening delimiter).
         let token_str = token_to_string(&self.token);
-        let msg = format!("unexpected closing delimiter: `{}`", token_str);
+        let msg = format!("unexpected closing delimiter: `{token_str}`");
         let mut err = self.string_reader.sess.span_diagnostic.struct_span_err(self.token.span, msg);
 
         report_suspicious_mismatch_block(
diff --git a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs
index d1f852b1a40..446472d1294 100644
--- a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs
+++ b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs
@@ -135,7 +135,7 @@ pub(crate) fn emit_unescape_error(
                 "unknown character escape"
             };
             let ec = escaped_char(c);
-            let mut diag = handler.struct_span_err(span, format!("{}: `{}`", label, ec));
+            let mut diag = handler.struct_span_err(span, format!("{label}: `{ec}`"));
             diag.span_label(span, label);
             if c == '{' || c == '}' && matches!(mode, Mode::Str | Mode::RawStr) {
                 diag.help(
@@ -151,7 +151,7 @@ pub(crate) fn emit_unescape_error(
                     diag.span_suggestion(
                         span_with_quotes,
                         "if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal",
-                        format!("r\"{}\"", lit),
+                        format!("r\"{lit}\""),
                         Applicability::MaybeIncorrect,
                     );
                 }
@@ -180,21 +180,20 @@ pub(crate) fn emit_unescape_error(
                 Mode::RawByteStr => "raw byte string literal",
                 _ => panic!("non-is_byte literal paired with NonAsciiCharInByte"),
             };
-            let mut err = handler.struct_span_err(span, format!("non-ASCII character in {}", desc));
+            let mut err = handler.struct_span_err(span, format!("non-ASCII character in {desc}"));
             let postfix = if unicode_width::UnicodeWidthChar::width(c).unwrap_or(1) == 0 {
-                format!(" but is {:?}", c)
+                format!(" but is {c:?}")
             } else {
                 String::new()
             };
-            err.span_label(span, format!("must be ASCII{}", postfix));
+            err.span_label(span, format!("must be ASCII{postfix}"));
             // Note: the \\xHH suggestions are not given for raw byte string
             // literals, because they are araw and so cannot use any escapes.
             if (c as u32) <= 0xFF && mode != Mode::RawByteStr {
                 err.span_suggestion(
                     span,
                     format!(
-                        "if you meant to use the unicode code point for {:?}, use a \\xHH escape",
-                        c
+                        "if you meant to use the unicode code point for {c:?}, use a \\xHH escape"
                     ),
                     format!("\\x{:X}", c as u32),
                     Applicability::MaybeIncorrect,
@@ -206,7 +205,7 @@ pub(crate) fn emit_unescape_error(
                 utf8.push(c);
                 err.span_suggestion(
                     span,
-                    format!("if you meant to use the UTF-8 encoding of {:?}, use \\xHH escapes", c),
+                    format!("if you meant to use the UTF-8 encoding of {c:?}, use \\xHH escapes"),
                     utf8.as_bytes()
                         .iter()
                         .map(|b: &u8| format!("\\x{:X}", *b))
diff --git a/compiler/rustc_parse/src/lexer/unicode_chars.rs b/compiler/rustc_parse/src/lexer/unicode_chars.rs
index 829d9693e55..bbfb160ebf7 100644
--- a/compiler/rustc_parse/src/lexer/unicode_chars.rs
+++ b/compiler/rustc_parse/src/lexer/unicode_chars.rs
@@ -349,7 +349,7 @@ pub(super) fn check_for_substitution(
     let span = Span::with_root_ctxt(pos, pos + Pos::from_usize(ch.len_utf8() * count));
 
     let Some((_, ascii_name, token)) = ASCII_ARRAY.iter().find(|&&(s, _, _)| s == ascii_str) else {
-        let msg = format!("substitution character not found for '{}'", ch);
+        let msg = format!("substitution character not found for '{ch}'");
         reader.sess.span_diagnostic.span_bug_no_panic(span, msg);
         return (None, None);
     };
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs
index 25de7808532..47233d0615c 100644
--- a/compiler/rustc_parse/src/lib.rs
+++ b/compiler/rustc_parse/src/lib.rs
@@ -247,7 +247,7 @@ pub fn parse_cfg_attr(
             match parse_in(parse_sess, tokens.clone(), "`cfg_attr` input", |p| p.parse_cfg_attr()) {
                 Ok(r) => return Some(r),
                 Err(mut e) => {
-                    e.help(format!("the valid syntax is `{}`", CFG_ATTR_GRAMMAR_HELP))
+                    e.help(format!("the valid syntax is `{CFG_ATTR_GRAMMAR_HELP}`"))
                         .note(CFG_ATTR_NOTE_REF)
                         .emit();
                 }
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs
index b579da098d8..158ab2a2956 100644
--- a/compiler/rustc_parse/src/parser/attr_wrapper.rs
+++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs
@@ -107,7 +107,7 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
         let tokens =
             std::iter::once((FlatToken::Token(self.start_token.0.clone()), self.start_token.1))
                 .chain((0..self.num_calls).map(|_| {
-                    let token = cursor_snapshot.next(cursor_snapshot.desugar_doc_comments);
+                    let token = cursor_snapshot.next();
                     (FlatToken::Token(token.0), token.1)
                 }))
                 .take(self.num_calls);
@@ -145,13 +145,11 @@ impl ToAttrTokenStream for LazyAttrTokenStreamImpl {
             // another replace range will capture the *replaced* tokens for the inner
             // range, not the original tokens.
             for (range, new_tokens) in replace_ranges.into_iter().rev() {
-                assert!(!range.is_empty(), "Cannot replace an empty range: {:?}", range);
+                assert!(!range.is_empty(), "Cannot replace an empty range: {range:?}");
                 // Replace ranges are only allowed to decrease the number of tokens.
                 assert!(
                     range.len() >= new_tokens.len(),
-                    "Range {:?} has greater len than {:?}",
-                    range,
-                    new_tokens
+                    "Range {range:?} has greater len than {new_tokens:?}"
                 );
 
                 // Replace any removed tokens with `FlatToken::Empty`.
@@ -409,22 +407,19 @@ fn make_token_stream(
             FlatToken::Token(Token { kind: TokenKind::CloseDelim(delim), span }) => {
                 let frame_data = stack
                     .pop()
-                    .unwrap_or_else(|| panic!("Token stack was empty for token: {:?}", token));
+                    .unwrap_or_else(|| panic!("Token stack was empty for token: {token:?}"));
 
                 let (open_delim, open_sp) = frame_data.open_delim_sp.unwrap();
                 assert_eq!(
                     open_delim, delim,
-                    "Mismatched open/close delims: open={:?} close={:?}",
-                    open_delim, span
+                    "Mismatched open/close delims: open={open_delim:?} close={span:?}"
                 );
                 let dspan = DelimSpan::from_pair(open_sp, span);
                 let stream = AttrTokenStream::new(frame_data.inner);
                 let delimited = AttrTokenTree::Delimited(dspan, delim, stream);
                 stack
                     .last_mut()
-                    .unwrap_or_else(|| {
-                        panic!("Bottom token frame is missing for token: {:?}", token)
-                    })
+                    .unwrap_or_else(|| panic!("Bottom token frame is missing for token: {token:?}"))
                     .inner
                     .push(delimited);
             }
@@ -456,7 +451,7 @@ fn make_token_stream(
                 .inner
                 .push(AttrTokenTree::Token(Token::new(unglued_first, first_span), spacing));
         } else {
-            panic!("Unexpected last token {:?}", last_token)
+            panic!("Unexpected last token {last_token:?}")
         }
     }
     AttrTokenStream::new(final_buf.inner)
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index c3cf6437afa..e6de51a673c 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -14,7 +14,7 @@ use crate::errors::{
     PatternMethodParamWithoutBody, QuestionMarkInType, QuestionMarkInTypeSugg, SelfParamNotFirst,
     StructLiteralBodyWithoutPath, StructLiteralBodyWithoutPathSugg, StructLiteralNeedingParens,
     StructLiteralNeedingParensSugg, SuggAddMissingLetStmt, SuggEscapeIdentifier, SuggRemoveComma,
-    UnexpectedConstInGenericParam, UnexpectedConstParamDeclaration,
+    TernaryOperator, UnexpectedConstInGenericParam, UnexpectedConstParamDeclaration,
     UnexpectedConstParamDeclarationSugg, UnmatchedAngleBrackets, UseEqInstead,
 };
 
@@ -500,6 +500,10 @@ impl<'a> Parser<'a> {
 
         // Special-case "expected `;`" errors
         if expected.contains(&TokenType::Token(token::Semi)) {
+            if self.prev_token == token::Question && self.maybe_recover_from_ternary_operator() {
+                return Ok(true);
+            }
+
             if self.token.span == DUMMY_SP || self.prev_token.span == DUMMY_SP {
                 // Likely inside a macro, can't provide meaningful suggestions.
             } else if !sm.is_multiline(self.prev_token.span.until(self.token.span)) {
@@ -608,13 +612,13 @@ impl<'a> Parser<'a> {
         if let TokenKind::Ident(prev, _) = &self.prev_token.kind
           && let TokenKind::Ident(cur, _) = &self.token.kind
         {
-                let concat = Symbol::intern(&format!("{}{}", prev, cur));
+                let concat = Symbol::intern(&format!("{prev}{cur}"));
                 let ident = Ident::new(concat, DUMMY_SP);
                 if ident.is_used_keyword() || ident.is_reserved() || ident.is_raw_guess() {
                     let span = self.prev_token.span.to(self.token.span);
                     err.span_suggestion_verbose(
                         span,
-                        format!("consider removing the space to spell keyword `{}`", concat),
+                        format!("consider removing the space to spell keyword `{concat}`"),
                         concat,
                         Applicability::MachineApplicable,
                     );
@@ -1330,6 +1334,45 @@ impl<'a> Parser<'a> {
         }
     }
 
+    /// Rust has no ternary operator (`cond ? then : else`). Parse it and try
+    /// to recover from it if `then` and `else` are valid expressions. Returns
+    /// whether it was a ternary operator.
+    pub(super) fn maybe_recover_from_ternary_operator(&mut self) -> bool {
+        if self.prev_token != token::Question {
+            return false;
+        }
+
+        let lo = self.prev_token.span.lo();
+        let snapshot = self.create_snapshot_for_diagnostic();
+
+        if match self.parse_expr() {
+            Ok(_) => true,
+            Err(err) => {
+                err.cancel();
+                // The colon can sometimes be mistaken for type
+                // ascription. Catch when this happens and continue.
+                self.token == token::Colon
+            }
+        } {
+            if self.eat_noexpect(&token::Colon) {
+                match self.parse_expr() {
+                    Ok(_) => {
+                        self.sess.emit_err(TernaryOperator { span: self.token.span.with_lo(lo) });
+                        return true;
+                    }
+                    Err(err) => {
+                        err.cancel();
+                        self.restore_snapshot(snapshot);
+                    }
+                };
+            }
+        } else {
+            self.restore_snapshot(snapshot);
+        };
+
+        false
+    }
+
     pub(super) fn maybe_recover_from_bad_type_plus(&mut self, ty: &Ty) -> PResult<'a, ()> {
         // Do not add `+` to expected tokens.
         if !self.token.is_like_plus() {
@@ -2111,7 +2154,7 @@ impl<'a> Parser<'a> {
             }
             _ => (
                 self.token.span,
-                format!("expected expression, found {}", super::token_descr(&self.token),),
+                format!("expected expression, found {}", super::token_descr(&self.token)),
             ),
         };
         let mut err = self.struct_span_err(span, msg);
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index b54cb8c5a0c..55f857aa31c 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1052,7 +1052,7 @@ impl<'a> Parser<'a> {
                 }
                 components.push(Punct(c));
             } else {
-                panic!("unexpected character in a float token: {:?}", c)
+                panic!("unexpected character in a float token: {c:?}")
             }
         }
         if !ident_like.is_empty() {
@@ -1113,7 +1113,7 @@ impl<'a> Parser<'a> {
                 self.error_unexpected_after_dot();
                 DestructuredFloat::Error
             }
-            _ => panic!("unexpected components in a float token: {:?}", components),
+            _ => panic!("unexpected components in a float token: {components:?}"),
         }
     }
 
@@ -2342,7 +2342,7 @@ impl<'a> Parser<'a> {
             let ty = if this.eat(&token::Colon) {
                 this.parse_ty()?
             } else {
-                this.mk_ty(this.prev_token.span, TyKind::Infer)
+                this.mk_ty(pat.span, TyKind::Infer)
             };
 
             Ok((
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 1470180dea7..1301ed3e388 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -226,9 +226,9 @@ impl<'a> Parser<'a> {
         } else if self.is_static_global() {
             // STATIC ITEM
             self.bump(); // `static`
-            let m = self.parse_mutability();
-            let (ident, ty, expr) = self.parse_item_global(Some(m))?;
-            (ident, ItemKind::Static(Box::new(StaticItem { ty, mutability: m, expr })))
+            let mutability = self.parse_mutability();
+            let (ident, item) = self.parse_static_item(mutability)?;
+            (ident, ItemKind::Static(Box::new(item)))
         } else if let Const::Yes(const_span) = self.parse_constness(Case::Sensitive) {
             // CONST ITEM
             if self.token.is_keyword(kw::Impl) {
@@ -236,8 +236,16 @@ impl<'a> Parser<'a> {
                 self.recover_const_impl(const_span, attrs, def_())?
             } else {
                 self.recover_const_mut(const_span);
-                let (ident, ty, expr) = self.parse_item_global(None)?;
-                (ident, ItemKind::Const(Box::new(ConstItem { defaultness: def_(), ty, expr })))
+                let (ident, generics, ty, expr) = self.parse_const_item()?;
+                (
+                    ident,
+                    ItemKind::Const(Box::new(ConstItem {
+                        defaultness: def_(),
+                        generics,
+                        ty,
+                        expr,
+                    })),
+                )
             }
         } else if self.check_keyword(kw::Trait) || self.check_auto_or_unsafe_trait_item() {
             // TRAIT ITEM
@@ -878,6 +886,7 @@ impl<'a> Parser<'a> {
                             self.sess.emit_err(errors::AssociatedStaticItemNotAllowed { span });
                             AssocItemKind::Const(Box::new(ConstItem {
                                 defaultness: Defaultness::Final,
+                                generics: Generics::default(),
                                 ty,
                                 expr,
                             }))
@@ -892,7 +901,7 @@ impl<'a> Parser<'a> {
 
     /// Parses a `type` alias with the following grammar:
     /// ```ebnf
-    /// TypeAlias = "type" Ident Generics {":" GenericBounds}? {"=" Ty}? ";" ;
+    /// TypeAlias = "type" Ident Generics (":" GenericBounds)? WhereClause ("=" Ty)? WhereClause ";" ;
     /// ```
     /// The `"type"` has already been eaten.
     fn parse_type_alias(&mut self, defaultness: Defaultness) -> PResult<'a, ItemInfo> {
@@ -1220,33 +1229,132 @@ impl<'a> Parser<'a> {
         Ok(impl_info)
     }
 
-    /// Parse `["const" | ("static" "mut"?)] $ident ":" $ty (= $expr)?` with
-    /// `["const" | ("static" "mut"?)]` already parsed and stored in `m`.
+    /// Parse a static item with the prefix `"static" "mut"?` already parsed and stored in `mutability`.
     ///
-    /// When `m` is `"const"`, `$ident` may also be `"_"`.
-    fn parse_item_global(
-        &mut self,
-        m: Option<Mutability>,
-    ) -> PResult<'a, (Ident, P<Ty>, Option<P<ast::Expr>>)> {
-        let id = if m.is_none() { self.parse_ident_or_underscore() } else { self.parse_ident() }?;
+    /// ```ebnf
+    /// Static = "static" "mut"? $ident ":" $ty (= $expr)? ";" ;
+    /// ```
+    fn parse_static_item(&mut self, mutability: Mutability) -> PResult<'a, (Ident, StaticItem)> {
+        let ident = self.parse_ident()?;
+
+        if self.token.kind == TokenKind::Lt && self.may_recover() {
+            let generics = self.parse_generics()?;
+            self.sess.emit_err(errors::StaticWithGenerics { span: generics.span });
+        }
 
-        // Parse the type of a `const` or `static mut?` item.
-        // That is, the `":" $ty` fragment.
+        // Parse the type of a static item. That is, the `":" $ty` fragment.
+        // FIXME: This could maybe benefit from `.may_recover()`?
         let ty = match (self.eat(&token::Colon), self.check(&token::Eq) | self.check(&token::Semi))
         {
-            // If there wasn't a `:` or the colon was followed by a `=` or `;` recover a missing type.
             (true, false) => self.parse_ty()?,
-            (colon, _) => self.recover_missing_const_type(colon, m),
+            // If there wasn't a `:` or the colon was followed by a `=` or `;`, recover a missing type.
+            (colon, _) => self.recover_missing_global_item_type(colon, Some(mutability)),
+        };
+
+        let expr = if self.eat(&token::Eq) { Some(self.parse_expr()?) } else { None };
+
+        self.expect_semi()?;
+
+        Ok((ident, StaticItem { ty, mutability, expr }))
+    }
+
+    /// Parse a constant item with the prefix `"const"` already parsed.
+    ///
+    /// ```ebnf
+    /// Const = "const" ($ident | "_") Generics ":" $ty (= $expr)? WhereClause ";" ;
+    /// ```
+    fn parse_const_item(&mut self) -> PResult<'a, (Ident, Generics, P<Ty>, Option<P<ast::Expr>>)> {
+        let ident = self.parse_ident_or_underscore()?;
+
+        let mut generics = self.parse_generics()?;
+
+        // Check the span for emptiness instead of the list of parameters in order to correctly
+        // recognize and subsequently flag empty parameter lists (`<>`) as unstable.
+        if !generics.span.is_empty() {
+            self.sess.gated_spans.gate(sym::generic_const_items, generics.span);
+        }
+
+        // Parse the type of a constant item. That is, the `":" $ty` fragment.
+        // FIXME: This could maybe benefit from `.may_recover()`?
+        let ty = match (
+            self.eat(&token::Colon),
+            self.check(&token::Eq) | self.check(&token::Semi) | self.check_keyword(kw::Where),
+        ) {
+            (true, false) => self.parse_ty()?,
+            // If there wasn't a `:` or the colon was followed by a `=`, `;` or `where`, recover a missing type.
+            (colon, _) => self.recover_missing_global_item_type(colon, None),
         };
 
+        // Proactively parse a where-clause to be able to provide a good error message in case we
+        // encounter the item body following it.
+        let before_where_clause =
+            if self.may_recover() { self.parse_where_clause()? } else { WhereClause::default() };
+
         let expr = if self.eat(&token::Eq) { Some(self.parse_expr()?) } else { None };
+
+        let after_where_clause = self.parse_where_clause()?;
+
+        // Provide a nice error message if the user placed a where-clause before the item body.
+        // Users may be tempted to write such code if they are still used to the deprecated
+        // where-clause location on type aliases and associated types. See also #89122.
+        if before_where_clause.has_where_token && let Some(expr) = &expr {
+            self.sess.emit_err(errors::WhereClauseBeforeConstBody {
+                span: before_where_clause.span,
+                name: ident.span,
+                body: expr.span,
+                sugg: if !after_where_clause.has_where_token {
+                    self.sess.source_map().span_to_snippet(expr.span).ok().map(|body| {
+                        errors::WhereClauseBeforeConstBodySugg {
+                            left: before_where_clause.span.shrink_to_lo(),
+                            snippet: body,
+                            right: before_where_clause.span.shrink_to_hi().to(expr.span),
+                        }
+                    })
+                } else {
+                    // FIXME(generic_const_items): Provide a structured suggestion to merge the first
+                    // where-clause into the second one.
+                    None
+                },
+            });
+        }
+
+        // Merge the predicates of both where-clauses since either one can be relevant.
+        // If we didn't parse a body (which is valid for associated consts in traits) and we were
+        // allowed to recover, `before_where_clause` contains the predicates, otherwise they are
+        // in `after_where_clause`. Further, both of them might contain predicates iff two
+        // where-clauses were provided which is syntactically ill-formed but we want to recover from
+        // it and treat them as one large where-clause.
+        let mut predicates = before_where_clause.predicates;
+        predicates.extend(after_where_clause.predicates);
+        let where_clause = WhereClause {
+            has_where_token: before_where_clause.has_where_token
+                || after_where_clause.has_where_token,
+            predicates,
+            span: if after_where_clause.has_where_token {
+                after_where_clause.span
+            } else {
+                before_where_clause.span
+            },
+        };
+
+        if where_clause.has_where_token {
+            self.sess.gated_spans.gate(sym::generic_const_items, where_clause.span);
+        }
+
+        generics.where_clause = where_clause;
+
         self.expect_semi()?;
-        Ok((id, ty, expr))
+
+        Ok((ident, generics, ty, expr))
     }
 
     /// We were supposed to parse `":" $ty` but the `:` or the type was missing.
     /// This means that the type is missing.
-    fn recover_missing_const_type(&mut self, colon_present: bool, m: Option<Mutability>) -> P<Ty> {
+    fn recover_missing_global_item_type(
+        &mut self,
+        colon_present: bool,
+        m: Option<Mutability>,
+    ) -> P<Ty> {
         // Construct the error and stash it away with the hope
         // that typeck will later enrich the error with a type.
         let kind = match m {
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 2e1a61e634e..bd547ed790a 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -138,7 +138,6 @@ pub struct Parser<'a> {
     // Important: This must only be advanced from `bump` to ensure that
     // `token_cursor.num_next_calls` is updated properly.
     token_cursor: TokenCursor,
-    desugar_doc_comments: bool,
     /// This field is used to keep track of how many left angle brackets we have seen. This is
     /// required in order to detect extra leading left angle brackets (`<` characters) and error
     /// appropriately.
@@ -225,6 +224,9 @@ struct TokenCursor {
     // because it's the outermost token stream which never has delimiters.
     stack: Vec<(TokenTreeCursor, Delimiter, DelimSpan)>,
 
+    // We need to desugar doc comments from `/// foo` form into `#[doc =
+    // r"foo"]` form when parsing declarative macro inputs in `parse_tt`,
+    // because some declarative macros look for `doc` attributes.
     desugar_doc_comments: bool,
 
     // Counts the number of calls to `{,inlined_}next`.
@@ -255,33 +257,38 @@ struct TokenCursor {
 }
 
 impl TokenCursor {
-    fn next(&mut self, desugar_doc_comments: bool) -> (Token, Spacing) {
-        self.inlined_next(desugar_doc_comments)
+    fn next(&mut self) -> (Token, Spacing) {
+        self.inlined_next()
     }
 
     /// This always-inlined version should only be used on hot code paths.
     #[inline(always)]
-    fn inlined_next(&mut self, desugar_doc_comments: bool) -> (Token, Spacing) {
+    fn inlined_next(&mut self) -> (Token, Spacing) {
         loop {
             // FIXME: we currently don't return `Delimiter` open/close delims. To fix #67062 we will
             // need to, whereupon the `delim != Delimiter::Invisible` conditions below can be
             // removed.
             if let Some(tree) = self.tree_cursor.next_ref() {
                 match tree {
-                    &TokenTree::Token(ref token, spacing) => match (desugar_doc_comments, token) {
-                        (true, &Token { kind: token::DocComment(_, attr_style, data), span }) => {
-                            let desugared = self.desugar(attr_style, data, span);
-                            self.tree_cursor.replace_prev_and_rewind(desugared);
-                            // Continue to get the first token of the desugared doc comment.
-                        }
-                        _ => {
-                            debug_assert!(!matches!(
-                                token.kind,
-                                token::OpenDelim(_) | token::CloseDelim(_)
-                            ));
-                            return (token.clone(), spacing);
+                    &TokenTree::Token(ref token, spacing) => {
+                        match (self.desugar_doc_comments, token) {
+                            (
+                                true,
+                                &Token { kind: token::DocComment(_, attr_style, data), span },
+                            ) => {
+                                let desugared = self.desugar(attr_style, data, span);
+                                self.tree_cursor.replace_prev_and_rewind(desugared);
+                                // Continue to get the first token of the desugared doc comment.
+                            }
+                            _ => {
+                                debug_assert!(!matches!(
+                                    token.kind,
+                                    token::OpenDelim(_) | token::CloseDelim(_)
+                                ));
+                                return (token.clone(), spacing);
+                            }
                         }
-                    },
+                    }
                     &TokenTree::Delimited(sp, delim, ref tts) => {
                         let trees = tts.clone().into_trees();
                         self.stack.push((mem::replace(&mut self.tree_cursor, trees), delim, sp));
@@ -368,7 +375,7 @@ impl TokenType {
     fn to_string(&self) -> String {
         match self {
             TokenType::Token(t) => format!("`{}`", pprust::token_kind_to_string(t)),
-            TokenType::Keyword(kw) => format!("`{}`", kw),
+            TokenType::Keyword(kw) => format!("`{kw}`"),
             TokenType::Operator => "an operator".to_string(),
             TokenType::Lifetime => "lifetime".to_string(),
             TokenType::Ident => "identifier".to_string(),
@@ -438,7 +445,7 @@ pub(super) fn token_descr(token: &Token) -> String {
         TokenDescription::DocComment => "doc comment",
     });
 
-    if let Some(kind) = kind { format!("{} `{}`", kind, name) } else { format!("`{}`", name) }
+    if let Some(kind) = kind { format!("{kind} `{name}`") } else { format!("`{name}`") }
 }
 
 impl<'a> Parser<'a> {
@@ -463,7 +470,6 @@ impl<'a> Parser<'a> {
                 desugar_doc_comments,
                 break_last_token: false,
             },
-            desugar_doc_comments,
             unmatched_angle_bracket_count: 0,
             max_angle_bracket_count: 0,
             last_unexpected_token_span: None,
@@ -923,7 +929,7 @@ impl<'a> Parser<'a> {
                                     expect_err
                                         .span_suggestion_short(
                                             sp,
-                                            format!("missing `{}`", token_str),
+                                            format!("missing `{token_str}`"),
                                             token_str,
                                             Applicability::MaybeIncorrect,
                                         )
@@ -1107,7 +1113,7 @@ impl<'a> Parser<'a> {
     pub fn bump(&mut self) {
         // Note: destructuring here would give nicer code, but it was found in #96210 to be slower
         // than `.0`/`.1` access.
-        let mut next = self.token_cursor.inlined_next(self.desugar_doc_comments);
+        let mut next = self.token_cursor.inlined_next();
         self.token_cursor.num_next_calls += 1;
         // We've retrieved an token from the underlying
         // cursor, so we no longer need to worry about
@@ -1157,7 +1163,7 @@ impl<'a> Parser<'a> {
         let mut i = 0;
         let mut token = Token::dummy();
         while i < dist {
-            token = cursor.next(/* desugar_doc_comments */ false).0;
+            token = cursor.next().0;
             if matches!(
                 token.kind,
                 token::OpenDelim(Delimiter::Invisible) | token::CloseDelim(Delimiter::Invisible)
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 14891c45d81..fed16278db5 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -428,7 +428,7 @@ impl<'a> Parser<'a> {
                     );
 
                     let mut err = self_.struct_span_err(self_.token.span, msg);
-                    err.span_label(self_.token.span, format!("expected {}", expected));
+                    err.span_label(self_.token.span, format!("expected {expected}"));
                     err
                 });
             PatKind::Lit(self.mk_expr(lo, ExprKind::Lit(lit)))
@@ -664,7 +664,7 @@ impl<'a> Parser<'a> {
         let msg = format!("expected {}, found {}", expected, super::token_descr(&self.token));
 
         let mut err = self.struct_span_err(self.token.span, msg);
-        err.span_label(self.token.span, format!("expected {}", expected));
+        err.span_label(self.token.span, format!("expected {expected}"));
 
         let sp = self.sess.source_map().start_point(self.token.span);
         if let Some(sp) = self.sess.ambiguous_block_expr_parse.borrow().get(&sp) {
@@ -977,7 +977,7 @@ impl<'a> Parser<'a> {
                     break;
                 }
                 let token_str = super::token_descr(&self.token);
-                let msg = format!("expected `}}`, found {}", token_str);
+                let msg = format!("expected `}}`, found {token_str}");
                 let mut err = self.struct_span_err(self.token.span, msg);
 
                 err.span_label(self.token.span, "expected `}`");
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index feb7e829caf..445516c03a1 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -679,7 +679,7 @@ impl<'a> Parser<'a> {
                     );
                     err.span_suggestion(
                         eq.to(before_next),
-                        format!("remove the `=` if `{}` is a type", ident),
+                        format!("remove the `=` if `{ident}` is a type"),
                         "",
                         Applicability::MaybeIncorrect,
                     )
diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs
index 9fcf51a04ec..1cdf2efa764 100644
--- a/compiler/rustc_parse/src/parser/stmt.rs
+++ b/compiler/rustc_parse/src/parser/stmt.rs
@@ -300,7 +300,7 @@ impl<'a> Parser<'a> {
                 Ok(ty) => (None, Some(ty)),
                 Err(mut err) => {
                     if let Ok(snip) = self.span_to_snippet(pat.span) {
-                        err.span_label(pat.span, format!("while parsing the type for `{}`", snip));
+                        err.span_label(pat.span, format!("while parsing the type for `{snip}`"));
                     }
                     // we use noexpect here because we don't actually expect Eq to be here
                     // but we are still checking for it in order to be able to handle it if
@@ -502,7 +502,7 @@ impl<'a> Parser<'a> {
 
     fn error_block_no_opening_brace<T>(&mut self) -> PResult<'a, T> {
         let tok = super::token_descr(&self.token);
-        let msg = format!("expected `{{`, found {}", tok);
+        let msg = format!("expected `{{`, found {tok}");
         Err(self.error_block_no_opening_brace_msg(Cow::from(msg)))
     }
 
@@ -638,10 +638,9 @@ impl<'a> Parser<'a> {
                                 e.span_suggestion(
                                     sp.with_hi(sp.lo() + BytePos(marker.len() as u32)),
                                     format!(
-                                        "add a space before `{}` to use a regular comment",
-                                        doc_comment_marker,
+                                        "add a space before `{doc_comment_marker}` to use a regular comment",
                                     ),
-                                    format!("{} {}", comment_marker, doc_comment_marker),
+                                    format!("{comment_marker} {doc_comment_marker}"),
                                     Applicability::MaybeIncorrect,
                                 );
                             }
diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs
index fc437c429fb..e70817d7b7c 100644
--- a/compiler/rustc_passes/src/check_const.rs
+++ b/compiler/rustc_passes/src/check_const.rs
@@ -157,10 +157,8 @@ impl<'tcx> CheckConstVisitor<'tcx> {
                 // is a pretty narrow case, however.
                 if tcx.sess.is_nightly_build() {
                     for gate in missing_secondary {
-                        let note = format!(
-                            "add `#![feature({})]` to the crate attributes to enable",
-                            gate,
-                        );
+                        let note =
+                            format!("add `#![feature({gate})]` to the crate attributes to enable",);
                         err.help(note);
                     }
                 }
diff --git a/compiler/rustc_passes/src/hir_id_validator.rs b/compiler/rustc_passes/src/hir_id_validator.rs
index 363e1743677..f825363ae39 100644
--- a/compiler/rustc_passes/src/hir_id_validator.rs
+++ b/compiler/rustc_passes/src/hir_id_validator.rs
@@ -89,9 +89,8 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
 
             self.error(|| {
                 format!(
-                    "ItemLocalIds not assigned densely in {}. \
-                Max ItemLocalId = {}, missing IDs = {:#?}; seen IDs = {:#?}",
-                    pretty_owner, max, missing_items, seen_items
+                    "ItemLocalIds not assigned densely in {pretty_owner}. \
+                Max ItemLocalId = {max}, missing IDs = {missing_items:#?}; seen IDs = {seen_items:#?}"
                 )
             });
         }
diff --git a/compiler/rustc_passes/src/hir_stats.rs b/compiler/rustc_passes/src/hir_stats.rs
index 6c748147abe..5aa8aef6a85 100644
--- a/compiler/rustc_passes/src/hir_stats.rs
+++ b/compiler/rustc_passes/src/hir_stats.rs
@@ -126,12 +126,12 @@ impl<'k> StatCollector<'k> {
 
         let total_size = nodes.iter().map(|(_, node)| node.stats.count * node.stats.size).sum();
 
-        eprintln!("{} {}", prefix, title);
+        eprintln!("{prefix} {title}");
         eprintln!(
             "{} {:<18}{:>18}{:>14}{:>14}",
             prefix, "Name", "Accumulated Size", "Count", "Item Size"
         );
-        eprintln!("{} ----------------------------------------------------------------", prefix);
+        eprintln!("{prefix} ----------------------------------------------------------------");
 
         let percent = |m, n| (m * 100) as f64 / n as f64;
 
@@ -163,9 +163,9 @@ impl<'k> StatCollector<'k> {
                 }
             }
         }
-        eprintln!("{} ----------------------------------------------------------------", prefix);
+        eprintln!("{prefix} ----------------------------------------------------------------");
         eprintln!("{} {:<18}{:>10}", prefix, "Total", to_readable_str(total_size));
-        eprintln!("{}", prefix);
+        eprintln!("{prefix}");
     }
 }
 
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs
index 89c6704e416..15757a0f1ad 100644
--- a/compiler/rustc_passes/src/liveness.rs
+++ b/compiler/rustc_passes/src/liveness.rs
@@ -605,7 +605,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
         for var_idx in 0..self.ir.var_kinds.len() {
             let var = Variable::from(var_idx);
             if test(var) {
-                write!(wr, " {:?}", var)?;
+                write!(wr, " {var:?}")?;
             }
         }
         Ok(())
diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs
index 160528e4074..7dec5b0acc8 100644
--- a/compiler/rustc_passes/src/reachable.rs
+++ b/compiler/rustc_passes/src/reachable.rs
@@ -236,7 +236,7 @@ impl<'tcx> ReachableContext<'tcx> {
                     // Reachable constants will be inlined into other crates
                     // unconditionally, so we need to make sure that their
                     // contents are also reachable.
-                    hir::ItemKind::Const(_, init) | hir::ItemKind::Static(_, _, init) => {
+                    hir::ItemKind::Const(_, _, init) | hir::ItemKind::Static(_, _, init) => {
                         self.visit_nested_body(init);
                     }
 
diff --git a/compiler/rustc_privacy/src/lib.rs b/compiler/rustc_privacy/src/lib.rs
index e2827252509..5fa780a372b 100644
--- a/compiler/rustc_privacy/src/lib.rs
+++ b/compiler/rustc_privacy/src/lib.rs
@@ -1941,7 +1941,7 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
         let reexported_at_vis = effective_vis.at_level(Level::Reexported);
         let reachable_at_vis = effective_vis.at_level(Level::Reachable);
 
-        if reexported_at_vis != reachable_at_vis {
+        if reachable_at_vis.is_public() && reexported_at_vis != reachable_at_vis {
             let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
             let span = self.tcx.def_span(def_id.to_def_id());
             self.tcx.emit_spanned_lint(
@@ -1973,10 +1973,6 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
             AssocItemKind::Type => (self.tcx.defaultness(def_id).has_value(), true),
         };
 
-        if is_assoc_ty {
-            self.check_unnameable(def_id, self.get(def_id));
-        }
-
         check.in_assoc_ty = is_assoc_ty;
         check.generics().predicates();
         if check_ty {
diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs
index c9e80a6d9bc..b87757a3e1a 100644
--- a/compiler/rustc_query_system/src/dep_graph/graph.rs
+++ b/compiler/rustc_query_system/src/dep_graph/graph.rs
@@ -557,7 +557,7 @@ impl<K: DepKind> DepGraph<K> {
                         result,
                         prev_index,
                         hash_result,
-                        |value| format!("{:?}", value),
+                        |value| format!("{value:?}"),
                     );
 
                     #[cfg(debug_assertions)]
@@ -1433,7 +1433,7 @@ pub(crate) fn print_markframe_trace<K: DepKind>(
     let mut current = frame;
     while let Some(frame) = current {
         let node = data.previous.index_to_node(frame.index);
-        eprintln!("#{i} {:?}", node);
+        eprintln!("#{i} {node:?}");
         current = frame.parent;
         i += 1;
     }
diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs
index ff63e4e33cb..2f432799022 100644
--- a/compiler/rustc_resolve/src/build_reduced_graph.rs
+++ b/compiler/rustc_resolve/src/build_reduced_graph.rs
@@ -41,6 +41,7 @@ impl<'a, Id: Into<DefId>> ToNameBinding<'a>
         arenas.alloc_name_binding(NameBindingData {
             kind: NameBindingKind::Module(self.0),
             ambiguity: None,
+            warn_ambiguity: false,
             vis: self.1.to_def_id(),
             span: self.2,
             expansion: self.3,
@@ -53,6 +54,7 @@ impl<'a, Id: Into<DefId>> ToNameBinding<'a> for (Res, ty::Visibility<Id>, Span,
         arenas.alloc_name_binding(NameBindingData {
             kind: NameBindingKind::Res(self.0),
             ambiguity: None,
+            warn_ambiguity: false,
             vis: self.1.to_def_id(),
             span: self.2,
             expansion: self.3,
@@ -69,7 +71,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
     {
         let binding = def.to_name_binding(self.arenas);
         let key = self.new_disambiguated_key(ident, ns);
-        if let Err(old_binding) = self.try_define(parent, key, binding) {
+        if let Err(old_binding) = self.try_define(parent, key, binding, false) {
             self.report_conflict(parent, ident, ns, old_binding, binding);
         }
     }
@@ -999,7 +1001,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
         allow_shadowing: bool,
     ) {
         if self.r.macro_use_prelude.insert(name, binding).is_some() && !allow_shadowing {
-            let msg = format!("`{}` is already in scope", name);
+            let msg = format!("`{name}` is already in scope");
             let note =
                 "macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)";
             self.r.tcx.sess.struct_span_err(span, msg).note(note).emit();
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs
index 3228e8d52f0..7dbbd4c34ea 100644
--- a/compiler/rustc_resolve/src/check_unused.rs
+++ b/compiler/rustc_resolve/src/check_unused.rs
@@ -362,7 +362,7 @@ impl Resolver<'_, '_> {
             let mut span_snippets = spans
                 .iter()
                 .filter_map(|s| match tcx.sess.source_map().span_to_snippet(*s) {
-                    Ok(s) => Some(format!("`{}`", s)),
+                    Ok(s) => Some(format!("`{s}`")),
                     _ => None,
                 })
                 .collect::<Vec<String>>();
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 73cd596c076..cd1a9b934cf 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -5,10 +5,8 @@ use rustc_ast::{self as ast, Crate, ItemKind, ModKind, NodeId, Path, CRATE_NODE_
 use rustc_ast::{MetaItemKind, NestedMetaItem};
 use rustc_ast_pretty::pprust;
 use rustc_data_structures::fx::FxHashSet;
-use rustc_errors::{
-    pluralize, Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, MultiSpan,
-};
-use rustc_errors::{struct_span_err, SuggestionStyle};
+use rustc_errors::{pluralize, report_ambiguity_error, struct_span_err, SuggestionStyle};
+use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, MultiSpan};
 use rustc_feature::BUILTIN_ATTRIBUTES;
 use rustc_hir::def::Namespace::{self, *};
 use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind, PerNS};
@@ -17,8 +15,9 @@ use rustc_hir::PrimTy;
 use rustc_middle::bug;
 use rustc_middle::ty::TyCtxt;
 use rustc_session::lint::builtin::ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE;
+use rustc_session::lint::builtin::AMBIGUOUS_GLOB_IMPORTS;
 use rustc_session::lint::builtin::MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS;
-use rustc_session::lint::BuiltinLintDiagnostics;
+use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiagnostics};
 use rustc_session::Session;
 use rustc_span::edit_distance::find_best_match_for_name;
 use rustc_span::edition::Edition;
@@ -135,7 +134,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         }
 
         for ambiguity_error in &self.ambiguity_errors {
-            self.report_ambiguity_error(ambiguity_error);
+            let diag = self.ambiguity_diagnostics(ambiguity_error);
+            if ambiguity_error.warning {
+                let NameBindingKind::Import { import, .. } = ambiguity_error.b1.0.kind else {
+                    unreachable!()
+                };
+                self.lint_buffer.buffer_lint_with_diagnostic(
+                    AMBIGUOUS_GLOB_IMPORTS,
+                    import.root_id,
+                    ambiguity_error.ident.span,
+                    diag.msg.to_string(),
+                    BuiltinLintDiagnostics::AmbiguousGlobImports { diag },
+                );
+            } else {
+                let mut err = struct_span_err!(self.tcx.sess, diag.span, E0659, "{}", &diag.msg);
+                report_ambiguity_error(&mut err, diag);
+                err.emit();
+            }
         }
 
         let mut reported_spans = FxHashSet::default();
@@ -228,7 +243,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             (TypeNS, _) => "type",
         };
 
-        let msg = format!("the name `{}` is defined multiple times", name);
+        let msg = format!("the name `{name}` is defined multiple times");
 
         let mut err = match (old_binding.is_extern_crate(), new_binding.is_extern_crate()) {
             (true, true) => struct_span_err!(self.tcx.sess, span, E0259, "{}", msg),
@@ -250,11 +265,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             container
         ));
 
-        err.span_label(span, format!("`{}` re{} here", name, new_participle));
+        err.span_label(span, format!("`{name}` re{new_participle} here"));
         if !old_binding.span.is_dummy() && old_binding.span != span {
             err.span_label(
                 self.tcx.sess.source_map().guess_head_span(old_binding.span),
-                format!("previous {} of the {} `{}` here", old_noun, old_kind, name),
+                format!("previous {old_noun} of the {old_kind} `{name}` here"),
             );
         }
 
@@ -343,15 +358,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         binding_span: Span,
     ) {
         let suggested_name = if name.as_str().chars().next().unwrap().is_uppercase() {
-            format!("Other{}", name)
+            format!("Other{name}")
         } else {
-            format!("other_{}", name)
+            format!("other_{name}")
         };
 
         let mut suggestion = None;
         match import.kind {
             ImportKind::Single { type_ns_only: true, .. } => {
-                suggestion = Some(format!("self as {}", suggested_name))
+                suggestion = Some(format!("self as {suggested_name}"))
             }
             ImportKind::Single { source, .. } => {
                 if let Some(pos) =
@@ -587,11 +602,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     let sugg_msg = "try using a local generic parameter instead";
                     let name = self.tcx.item_name(def_id);
                     let (span, snippet) = if span.is_empty() {
-                        let snippet = format!("<{}>", name);
+                        let snippet = format!("<{name}>");
                         (span, snippet)
                     } else {
                         let span = sm.span_through_char(span, '<').shrink_to_hi();
-                        let snippet = format!("{}, ", name);
+                        let snippet = format!("{name}, ");
                         (span, snippet)
                     };
                     // Suggest the modification to the user
@@ -652,7 +667,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     name,
                 );
                 for sp in target_sp {
-                    err.span_label(sp, format!("pattern doesn't bind `{}`", name));
+                    err.span_label(sp, format!("pattern doesn't bind `{name}`"));
                 }
                 for sp in origin_sp {
                     err.span_label(sp, "variable not in all patterns");
@@ -679,8 +694,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     if import_suggestions.is_empty() {
                         let help_msg = format!(
                             "if you meant to match on a variant or a `const` item, consider \
-                             making the path in the pattern qualified: `path::to::ModOrType::{}`",
-                            name,
+                             making the path in the pattern qualified: `path::to::ModOrType::{name}`",
                         );
                         err.span_help(span, help_msg);
                     }
@@ -938,8 +952,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 let mut err = self.tcx.sess.struct_span_err_with_code(
                     span,
                     format!(
-                        "item `{}` is an associated {}, which doesn't match its trait `{}`",
-                        name, kind, trait_path,
+                        "item `{name}` is an associated {kind}, which doesn't match its trait `{trait_path}`",
                     ),
                     code,
                 );
@@ -1412,10 +1425,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                         "a function-like macro".to_string()
                     }
                     Res::Def(DefKind::Macro(MacroKind::Attr), _) | Res::NonMacroAttr(..) => {
-                        format!("an attribute: `#[{}]`", ident)
+                        format!("an attribute: `#[{ident}]`")
                     }
                     Res::Def(DefKind::Macro(MacroKind::Derive), _) => {
-                        format!("a derive macro: `#[derive({})]`", ident)
+                        format!("a derive macro: `#[derive({ident})]`")
                     }
                     Res::ToolMod => {
                         // Don't confuse the user with tool modules.
@@ -1436,7 +1449,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     if !import.span.is_dummy() {
                         err.span_note(
                             import.span,
-                            format!("`{}` is imported here, but it is {}", ident, desc),
+                            format!("`{ident}` is imported here, but it is {desc}"),
                         );
                         // Silence the 'unused import' warning we might get,
                         // since this diagnostic already covers that import.
@@ -1444,7 +1457,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                         return;
                     }
                 }
-                err.note(format!("`{}` is in scope, but it is {}", ident, desc));
+                err.note(format!("`{ident}` is in scope, but it is {desc}"));
                 return;
             }
         }
@@ -1540,20 +1553,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         }
     }
 
-    fn report_ambiguity_error(&self, ambiguity_error: &AmbiguityError<'_>) {
-        let AmbiguityError { kind, ident, b1, b2, misc1, misc2 } = *ambiguity_error;
+    fn ambiguity_diagnostics(&self, ambiguity_error: &AmbiguityError<'_>) -> AmbiguityErrorDiag {
+        let AmbiguityError { kind, ident, b1, b2, misc1, misc2, .. } = *ambiguity_error;
         let (b1, b2, misc1, misc2, swapped) = if b2.span.is_dummy() && !b1.span.is_dummy() {
             // We have to print the span-less alternative first, otherwise formatting looks bad.
             (b2, b1, misc2, misc1, true)
         } else {
             (b1, b2, misc1, misc2, false)
         };
-
-        let mut err = struct_span_err!(self.tcx.sess, ident.span, E0659, "`{ident}` is ambiguous");
-        err.span_label(ident.span, "ambiguous name");
-        err.note(format!("ambiguous because of {}", kind.descr()));
-
-        let mut could_refer_to = |b: NameBinding<'_>, misc: AmbiguityErrorMisc, also: &str| {
+        let could_refer_to = |b: NameBinding<'_>, misc: AmbiguityErrorMisc, also: &str| {
             let what = self.binding_description(b, ident, misc == AmbiguityErrorMisc::FromPrelude);
             let note_msg = format!("`{ident}` could{also} refer to {what}");
 
@@ -1579,16 +1587,35 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 AmbiguityErrorMisc::FromPrelude | AmbiguityErrorMisc::None => {}
             }
 
-            err.span_note(b.span, note_msg);
-            for (i, help_msg) in help_msgs.iter().enumerate() {
-                let or = if i == 0 { "" } else { "or " };
-                err.help(format!("{}{}", or, help_msg));
-            }
+            (
+                b.span,
+                note_msg,
+                help_msgs
+                    .iter()
+                    .enumerate()
+                    .map(|(i, help_msg)| {
+                        let or = if i == 0 { "" } else { "or " };
+                        format!("{or}{help_msg}")
+                    })
+                    .collect::<Vec<_>>(),
+            )
         };
-
-        could_refer_to(b1, misc1, "");
-        could_refer_to(b2, misc2, " also");
-        err.emit();
+        let (b1_span, b1_note_msg, b1_help_msgs) = could_refer_to(b1, misc1, "");
+        let (b2_span, b2_note_msg, b2_help_msgs) = could_refer_to(b2, misc2, " also");
+
+        AmbiguityErrorDiag {
+            msg: format!("`{ident}` is ambiguous"),
+            span: ident.span,
+            label_span: ident.span,
+            label_msg: "ambiguous name".to_string(),
+            note_msg: format!("ambiguous because of {}", kind.descr()),
+            b1_span,
+            b1_note_msg,
+            b1_help_msgs,
+            b2_span,
+            b2_note_msg,
+            b2_help_msgs,
+        }
     }
 
     /// If the binding refers to a tuple struct constructor with fields,
@@ -1626,7 +1653,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         let descr = get_descr(binding);
         let mut err =
             struct_span_err!(self.tcx.sess, ident.span, E0603, "{} `{}` is private", descr, ident);
-        err.span_label(ident.span, format!("private {}", descr));
+        err.span_label(ident.span, format!("private {descr}"));
 
         if let Some((this_res, outer_ident)) = outermost_res {
             let import_suggestions = self.lookup_import_candidates(
@@ -1811,7 +1838,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 _ => format!("`{parent}`"),
             };
 
-            let mut msg = format!("could not find `{}` in {}", ident, parent);
+            let mut msg = format!("could not find `{ident}` in {parent}");
             if ns == TypeNS || ns == ValueNS {
                 let ns_to_try = if ns == TypeNS { ValueNS } else { TypeNS };
                 let binding = if let Some(module) = module {
@@ -1926,12 +1953,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             let suggestion = match_span.map(|span| {
                 (
                     vec![(span, String::from(""))],
-                    format!("`{}` is defined here, but is not a type", ident),
+                    format!("`{ident}` is defined here, but is not a type"),
                     Applicability::MaybeIncorrect,
                 )
             });
 
-            (format!("use of undeclared type `{}`", ident), suggestion)
+            (format!("use of undeclared type `{ident}`"), suggestion)
         } else {
             let mut suggestion = None;
             if ident.name == sym::alloc {
@@ -1953,7 +1980,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     },
                 )
             });
-            (format!("use of undeclared crate or module `{}`", ident), suggestion)
+            (format!("use of undeclared crate or module `{ident}`"), suggestion)
         }
     }
 
@@ -2137,16 +2164,16 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             let module_name = crate_module.kind.name().unwrap();
             let import_snippet = match import.kind {
                 ImportKind::Single { source, target, .. } if source != target => {
-                    format!("{} as {}", source, target)
+                    format!("{source} as {target}")
                 }
-                _ => format!("{}", ident),
+                _ => format!("{ident}"),
             };
 
             let mut corrections: Vec<(Span, String)> = Vec::new();
             if !import.is_nested() {
                 // Assume this is the easy case of `use issue_59764::foo::makro;` and just remove
                 // intermediate segments.
-                corrections.push((import.span, format!("{}::{}", module_name, import_snippet)));
+                corrections.push((import.span, format!("{module_name}::{import_snippet}")));
             } else {
                 // Find the binding span (and any trailing commas and spaces).
                 //   ie. `use a::b::{c, d, e};`
@@ -2213,11 +2240,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                         start_point,
                         if has_nested {
                             // In this case, `start_snippet` must equal '{'.
-                            format!("{}{}, ", start_snippet, import_snippet)
+                            format!("{start_snippet}{import_snippet}, ")
                         } else {
                             // In this case, add a `{`, then the moved import, then whatever
                             // was there before.
-                            format!("{{{}, {}", import_snippet, start_snippet)
+                            format!("{{{import_snippet}, {start_snippet}")
                         },
                     ));
 
@@ -2634,9 +2661,9 @@ fn show_candidates(
                 "item"
             };
             let plural_descr =
-                if descr.ends_with('s') { format!("{}es", descr) } else { format!("{}s", descr) };
+                if descr.ends_with('s') { format!("{descr}es") } else { format!("{descr}s") };
 
-            let mut msg = format!("{}these {} exist but are inaccessible", prefix, plural_descr);
+            let mut msg = format!("{prefix}these {plural_descr} exist but are inaccessible");
             let mut has_colon = false;
 
             let mut spans = Vec::new();
@@ -2657,7 +2684,7 @@ fn show_candidates(
 
             let mut multi_span = MultiSpan::from_spans(spans.iter().map(|(_, sp)| *sp).collect());
             for (name, span) in spans {
-                multi_span.push_span_label(span, format!("`{}`: not accessible", name));
+                multi_span.push_span_label(span, format!("`{name}`: not accessible"));
             }
 
             for note in inaccessible_path_strings.iter().flat_map(|cand| cand.3.as_ref()) {
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs
index de431444769..3bd9cea27ce 100644
--- a/compiler/rustc_resolve/src/ident.rs
+++ b/compiler/rustc_resolve/src/ident.rs
@@ -677,6 +677,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                                         ident: orig_ident,
                                         b1: innermost_binding,
                                         b2: binding,
+                                        warning: false,
                                         misc1: misc(innermost_flags),
                                         misc2: misc(flags),
                                     });
@@ -905,6 +906,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     ident,
                     b1: binding,
                     b2: shadowed_glob,
+                    warning: false,
                     misc1: AmbiguityErrorMisc::None,
                     misc2: AmbiguityErrorMisc::None,
                 });
@@ -1443,12 +1445,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     let name_str = if name == kw::PathRoot {
                         "crate root".to_string()
                     } else {
-                        format!("`{}`", name)
+                        format!("`{name}`")
                     };
                     let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot {
-                        format!("global paths cannot start with {}", name_str)
+                        format!("global paths cannot start with {name_str}")
                     } else {
-                        format!("{} in paths can only be used in start position", name_str)
+                        format!("{name_str} in paths can only be used in start position")
                     };
                     (label, None)
                 });
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs
index f3cf61c5b93..a175d9f6c7f 100644
--- a/compiler/rustc_resolve/src/imports.rs
+++ b/compiler/rustc_resolve/src/imports.rs
@@ -284,6 +284,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         self.arenas.alloc_name_binding(NameBindingData {
             kind: NameBindingKind::Import { binding, import, used: Cell::new(false) },
             ambiguity: None,
+            warn_ambiguity: false,
             span: import.span,
             vis,
             expansion: import.parent_scope.expansion,
@@ -291,16 +292,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
     }
 
     /// Define the name or return the existing binding if there is a collision.
+    /// `update` indicates if the definition is a redefinition of an existing binding.
     pub(crate) fn try_define(
         &mut self,
         module: Module<'a>,
         key: BindingKey,
         binding: NameBinding<'a>,
+        warn_ambiguity: bool,
     ) -> Result<(), NameBinding<'a>> {
         let res = binding.res();
         self.check_reserved_macro_name(key.ident, res);
         self.set_binding_parent_module(binding, module);
-        self.update_resolution(module, key, |this, resolution| {
+        self.update_resolution(module, key, warn_ambiguity, |this, resolution| {
             if let Some(old_binding) = resolution.binding {
                 if res == Res::Err && old_binding.res() != Res::Err {
                     // Do not override real bindings with `Res::Err`s from error recovery.
@@ -308,15 +311,42 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 }
                 match (old_binding.is_glob_import(), binding.is_glob_import()) {
                     (true, true) => {
-                        if res != old_binding.res() {
-                            resolution.binding = Some(this.ambiguity(
-                                AmbiguityKind::GlobVsGlob,
-                                old_binding,
-                                binding,
-                            ));
+                        // FIXME: remove `!binding.is_ambiguity()` after delete the warning ambiguity.
+                        if !binding.is_ambiguity()
+                            && let NameBindingKind::Import { import: old_import, .. } = old_binding.kind
+                            && let NameBindingKind::Import { import, .. } = binding.kind
+                            && old_import == import {
+                            // We should replace the `old_binding` with `binding` regardless
+                            // of whether they has same resolution or not when they are
+                            // imported from the same glob-import statement.
+                            // However we currently using `Some(old_binding)` for back compact
+                            // purposes.
+                            // This case can be removed after once `Undetermined` is prepared
+                            // for glob-imports.
+                        } else if res != old_binding.res() {
+                            let binding = if warn_ambiguity {
+                                this.warn_ambiguity(
+                                    AmbiguityKind::GlobVsGlob,
+                                    old_binding,
+                                    binding,
+                                )
+                            } else {
+                                this.ambiguity(
+                                    AmbiguityKind::GlobVsGlob,
+                                    old_binding,
+                                    binding,
+                                )
+                            };
+                            resolution.binding = Some(binding);
                         } else if !old_binding.vis.is_at_least(binding.vis, this.tcx) {
                             // We are glob-importing the same item but with greater visibility.
                             resolution.binding = Some(binding);
+                        } else if binding.is_ambiguity() {
+                            resolution.binding =
+                                Some(self.arenas.alloc_name_binding(NameBindingData {
+                                    warn_ambiguity: true,
+                                    ..(*binding).clone()
+                                }));
                         }
                     }
                     (old_glob @ true, false) | (old_glob @ false, true) => {
@@ -374,29 +404,52 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         })
     }
 
+    fn warn_ambiguity(
+        &self,
+        kind: AmbiguityKind,
+        primary_binding: NameBinding<'a>,
+        secondary_binding: NameBinding<'a>,
+    ) -> NameBinding<'a> {
+        self.arenas.alloc_name_binding(NameBindingData {
+            ambiguity: Some((secondary_binding, kind)),
+            warn_ambiguity: true,
+            ..(*primary_binding).clone()
+        })
+    }
+
     // Use `f` to mutate the resolution of the name in the module.
     // If the resolution becomes a success, define it in the module's glob importers.
-    fn update_resolution<T, F>(&mut self, module: Module<'a>, key: BindingKey, f: F) -> T
+    fn update_resolution<T, F>(
+        &mut self,
+        module: Module<'a>,
+        key: BindingKey,
+        warn_ambiguity: bool,
+        f: F,
+    ) -> T
     where
         F: FnOnce(&mut Resolver<'a, 'tcx>, &mut NameResolution<'a>) -> T,
     {
         // Ensure that `resolution` isn't borrowed when defining in the module's glob importers,
         // during which the resolution might end up getting re-defined via a glob cycle.
-        let (binding, t) = {
+        let (binding, t, warn_ambiguity) = {
             let resolution = &mut *self.resolution(module, key).borrow_mut();
             let old_binding = resolution.binding();
 
             let t = f(self, resolution);
 
-            if old_binding.is_none() && let Some(binding) = resolution.binding() {
-                (binding, t)
+            if let Some(binding) = resolution.binding() && old_binding != Some(binding) {
+                (binding, t, warn_ambiguity || old_binding.is_some())
             } else {
                 return t;
             }
         };
 
-        // Define `binding` in `module`s glob importers.
-        for import in module.glob_importers.borrow_mut().iter() {
+        let Ok(glob_importers) = module.glob_importers.try_borrow_mut() else {
+            return t;
+        };
+
+        // Define or update `binding` in `module`s glob importers.
+        for import in glob_importers.iter() {
             let mut ident = key.ident;
             let scope = match ident.span.reverse_glob_adjust(module.expansion, import.span) {
                 Some(Some(def)) => self.expn_def_scope(def),
@@ -406,7 +459,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             if self.is_accessible_from(binding.vis, scope) {
                 let imported_binding = self.import(binding, *import);
                 let key = BindingKey { ident, ..key };
-                let _ = self.try_define(import.parent_scope.module, key, imported_binding);
+                let _ = self.try_define(
+                    import.parent_scope.module,
+                    key,
+                    imported_binding,
+                    warn_ambiguity,
+                );
             }
         }
 
@@ -425,7 +483,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             let dummy_binding = self.import(dummy_binding, import);
             self.per_ns(|this, ns| {
                 let key = BindingKey::new(target, ns);
-                let _ = this.try_define(import.parent_scope.module, key, dummy_binding);
+                let _ = this.try_define(import.parent_scope.module, key, dummy_binding, false);
             });
             self.record_use(target, dummy_binding, false);
         } else if import.imported_module.get().is_none() {
@@ -475,15 +533,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
         let indeterminate_imports = mem::take(&mut self.indeterminate_imports);
 
         for (is_indeterminate, import) in determined_imports
-            .into_iter()
+            .iter()
             .map(|i| (false, i))
-            .chain(indeterminate_imports.into_iter().map(|i| (true, i)))
+            .chain(indeterminate_imports.iter().map(|i| (true, i)))
         {
-            let unresolved_import_error = self.finalize_import(import);
+            let unresolved_import_error = self.finalize_import(*import);
 
             // If this import is unresolved then create a dummy import
             // resolution for it so that later resolve stages won't complain.
-            self.import_dummy_binding(import, is_indeterminate);
+            self.import_dummy_binding(*import, is_indeterminate);
 
             if let Some(err) = unresolved_import_error {
                 if let ImportKind::Single { source, ref source_bindings, .. } = import.kind {
@@ -505,27 +563,34 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     errors = vec![];
                 }
                 if seen_spans.insert(err.span) {
-                    errors.push((import, err));
+                    errors.push((*import, err));
                     prev_root_id = import.root_id;
                 }
-            } else if is_indeterminate {
-                let path = import_path_to_string(
-                    &import.module_path.iter().map(|seg| seg.ident).collect::<Vec<_>>(),
-                    &import.kind,
-                    import.span,
-                );
-                let err = UnresolvedImportError {
-                    span: import.span,
-                    label: None,
-                    note: None,
-                    suggestion: None,
-                    candidates: None,
-                };
-                // FIXME: there should be a better way of doing this than
-                // formatting this as a string then checking for `::`
-                if path.contains("::") {
-                    errors.push((import, err))
-                }
+            }
+        }
+
+        if !errors.is_empty() {
+            self.throw_unresolved_import_error(errors);
+            return;
+        }
+
+        for import in &indeterminate_imports {
+            let path = import_path_to_string(
+                &import.module_path.iter().map(|seg| seg.ident).collect::<Vec<_>>(),
+                &import.kind,
+                import.span,
+            );
+            let err = UnresolvedImportError {
+                span: import.span,
+                label: None,
+                note: None,
+                suggestion: None,
+                candidates: None,
+            };
+            // FIXME: there should be a better way of doing this than
+            // formatting this as a string then checking for `::`
+            if path.contains("::") {
+                errors.push((*import, err))
             }
         }
 
@@ -700,7 +765,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             Segment::names_to_string(&import.module_path),
             module_to_string(import.parent_scope.module).unwrap_or_else(|| "???".to_string()),
         );
-
         let module = if let Some(module) = import.imported_module.get() {
             module
         } else {
@@ -773,7 +837,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                                 .emit();
                         }
                         let key = BindingKey::new(target, ns);
-                        this.update_resolution(parent, key, |_, resolution| {
+                        this.update_resolution(parent, key, false, |_, resolution| {
                             resolution.single_imports.remove(&import);
                         });
                     }
@@ -989,7 +1053,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                             initial_binding.res()
                         });
                         let res = binding.res();
-                        if res == Res::Err || !this.ambiguity_errors.is_empty() {
+                        let has_ambiguity_error = this
+                            .ambiguity_errors
+                            .iter()
+                            .filter(|error| !error.warning)
+                            .next()
+                            .is_some();
+                        if res == Res::Err || has_ambiguity_error {
                             this.tcx
                                 .sess
                                 .delay_span_bug(import.span, "some error happened for an import");
@@ -1090,18 +1160,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                     ModuleOrUniformRoot::Module(module) => {
                         let module_str = module_to_string(module);
                         if let Some(module_str) = module_str {
-                            format!("no `{}` in `{}`", ident, module_str)
+                            format!("no `{ident}` in `{module_str}`")
                         } else {
-                            format!("no `{}` in the root", ident)
+                            format!("no `{ident}` in the root")
                         }
                     }
                     _ => {
                         if !ident.is_path_segment_keyword() {
-                            format!("no external crate `{}`", ident)
+                            format!("no external crate `{ident}`")
                         } else {
                             // HACK(eddyb) this shows up for `self` & `super`, which
                             // should work instead - for now keep the same error message.
-                            format!("no `{}` in the root", ident)
+                            format!("no `{ident}` in the root")
                         }
                     }
                 };
@@ -1149,10 +1219,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             let (ns, binding) = reexport_error.unwrap();
             if pub_use_of_private_extern_crate_hack(import, binding) {
                 let msg = format!(
-                    "extern crate `{}` is private, and cannot be \
+                    "extern crate `{ident}` is private, and cannot be \
                                    re-exported (error E0365), consider declaring with \
-                                   `pub`",
-                    ident
+                                   `pub`"
                 );
                 self.lint_buffer.buffer_lint(
                     PUB_USE_OF_PRIVATE_EXTERN_CRATE,
@@ -1292,7 +1361,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 UNUSED_IMPORTS,
                 id,
                 import.span,
-                format!("the item `{}` is imported redundantly", ident),
+                format!("the item `{ident}` is imported redundantly"),
                 BuiltinLintDiagnostics::RedundantImport(redundant_spans, ident),
             );
         }
@@ -1338,7 +1407,17 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             };
             if self.is_accessible_from(binding.vis, scope) {
                 let imported_binding = self.import(binding, import);
-                let _ = self.try_define(import.parent_scope.module, key, imported_binding);
+                let warn_ambiguity = self
+                    .resolution(import.parent_scope.module, key)
+                    .borrow()
+                    .binding()
+                    .is_some_and(|binding| binding.is_warn_ambiguity());
+                let _ = self.try_define(
+                    import.parent_scope.module,
+                    key,
+                    imported_binding,
+                    warn_ambiguity,
+                );
             }
         }
 
@@ -1357,7 +1436,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
 
             module.for_each_child(self, |this, ident, _, binding| {
                 let res = binding.res().expect_non_local();
-                if res != def::Res::Err && !binding.is_ambiguity() {
+                let error_ambiguity = binding.is_ambiguity() && !binding.warn_ambiguity;
+                if res != def::Res::Err && !error_ambiguity {
                     let mut reexport_chain = SmallVec::new();
                     let mut next_binding = binding;
                     while let NameBindingKind::Import { binding, import, .. } = next_binding.kind {
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index aab71494fd3..0e9d74480a9 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -337,6 +337,7 @@ enum LifetimeBinderKind {
     PolyTrait,
     WhereBound,
     Item,
+    ConstItem,
     Function,
     Closure,
     ImplBlock,
@@ -349,7 +350,7 @@ impl LifetimeBinderKind {
             BareFnType => "type",
             PolyTrait => "bound",
             WhereBound => "bound",
-            Item => "item",
+            Item | ConstItem => "item",
             ImplBlock => "impl block",
             Function => "function",
             Closure => "closure",
@@ -1916,10 +1917,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
         candidate: LifetimeElisionCandidate,
     ) {
         if let Some(prev_res) = self.r.lifetimes_res_map.insert(id, res) {
-            panic!(
-                "lifetime {:?} resolved multiple times ({:?} before, {:?} now)",
-                id, prev_res, res
-            )
+            panic!("lifetime {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)")
         }
         match res {
             LifetimeRes::Param { .. } | LifetimeRes::Fresh { .. } | LifetimeRes::Static => {
@@ -1935,8 +1933,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
     fn record_lifetime_param(&mut self, id: NodeId, res: LifetimeRes) {
         if let Some(prev_res) = self.r.lifetimes_res_map.insert(id, res) {
             panic!(
-                "lifetime parameter {:?} resolved multiple times ({:?} before, {:?} now)",
-                id, prev_res, res
+                "lifetime parameter {id:?} resolved multiple times ({prev_res:?} before, {res:?} now)"
             )
         }
     }
@@ -2404,30 +2401,44 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
                 });
             }
 
-            ItemKind::Static(box ast::StaticItem { ref ty, ref expr, .. })
-            | ItemKind::Const(box ast::ConstItem { ref ty, ref expr, .. }) => {
+            ItemKind::Static(box ast::StaticItem { ref ty, ref expr, .. }) => {
                 self.with_static_rib(|this| {
                     this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Static), |this| {
                         this.visit_ty(ty);
                     });
-                    this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
+                    if let Some(expr) = expr {
+                        // We already forbid generic params because of the above item rib,
+                        // so it doesn't matter whether this is a trivial constant.
+                        this.resolve_const_body(expr, Some((item.ident, ConstantItemKind::Static)));
+                    }
+                });
+            }
+
+            ItemKind::Const(box ast::ConstItem { ref generics, ref ty, ref expr, .. }) => {
+                self.with_generic_param_rib(
+                    &generics.params,
+                    RibKind::Item(HasGenericParams::Yes(generics.span)),
+                    LifetimeRibKind::Generics {
+                        binder: item.id,
+                        kind: LifetimeBinderKind::ConstItem,
+                        span: generics.span,
+                    },
+                    |this| {
+                        this.visit_generics(generics);
+
+                        this.with_lifetime_rib(
+                            LifetimeRibKind::Elided(LifetimeRes::Static),
+                            |this| this.visit_ty(ty),
+                        );
+
                         if let Some(expr) = expr {
-                            let constant_item_kind = match item.kind {
-                                ItemKind::Const(..) => ConstantItemKind::Const,
-                                ItemKind::Static(..) => ConstantItemKind::Static,
-                                _ => unreachable!(),
-                            };
-                            // We already forbid generic params because of the above item rib,
-                            // so it doesn't matter whether this is a trivial constant.
-                            this.with_constant_rib(
-                                IsRepeatExpr::No,
-                                ConstantHasGenerics::Yes,
-                                Some((item.ident, constant_item_kind)),
-                                |this| this.visit_expr(expr),
+                            this.resolve_const_body(
+                                expr,
+                                Some((item.ident, ConstantItemKind::Const)),
                             );
                         }
-                    });
-                });
+                    },
+                );
             }
 
             ItemKind::Use(ref use_tree) => {
@@ -2700,28 +2711,31 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
         for item in trait_items {
             self.resolve_doc_links(&item.attrs, MaybeExported::Ok(item.id));
             match &item.kind {
-                AssocItemKind::Const(box ast::ConstItem { ty, expr, .. }) => {
-                    self.visit_ty(ty);
-                    // Only impose the restrictions of `ConstRibKind` for an
-                    // actual constant expression in a provided default.
-                    if let Some(expr) = expr {
-                        // We allow arbitrary const expressions inside of associated consts,
-                        // even if they are potentially not const evaluatable.
-                        //
-                        // Type parameters can already be used and as associated consts are
-                        // not used as part of the type system, this is far less surprising.
-                        self.with_lifetime_rib(
-                            LifetimeRibKind::Elided(LifetimeRes::Infer),
-                            |this| {
-                                this.with_constant_rib(
-                                    IsRepeatExpr::No,
-                                    ConstantHasGenerics::Yes,
-                                    None,
-                                    |this| this.visit_expr(expr),
-                                )
-                            },
-                        );
-                    }
+                AssocItemKind::Const(box ast::ConstItem { generics, ty, expr, .. }) => {
+                    self.with_generic_param_rib(
+                        &generics.params,
+                        RibKind::AssocItem,
+                        LifetimeRibKind::Generics {
+                            binder: item.id,
+                            span: generics.span,
+                            kind: LifetimeBinderKind::ConstItem,
+                        },
+                        |this| {
+                            this.visit_generics(generics);
+                            this.visit_ty(ty);
+
+                            // Only impose the restrictions of `ConstRibKind` for an
+                            // actual constant expression in a provided default.
+                            if let Some(expr) = expr {
+                                // We allow arbitrary const expressions inside of associated consts,
+                                // even if they are potentially not const evaluatable.
+                                //
+                                // Type parameters can already be used and as associated consts are
+                                // not used as part of the type system, this is far less surprising.
+                                this.resolve_const_body(expr, None);
+                            }
+                        },
+                    );
                 }
                 AssocItemKind::Fn(box Fn { generics, .. }) => {
                     walk_assoc_item(self, generics, LifetimeBinderKind::Function, item);
@@ -2876,36 +2890,42 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
         use crate::ResolutionError::*;
         self.resolve_doc_links(&item.attrs, MaybeExported::ImplItem(trait_id.ok_or(&item.vis)));
         match &item.kind {
-            AssocItemKind::Const(box ast::ConstItem { ty, expr, .. }) => {
+            AssocItemKind::Const(box ast::ConstItem { generics, ty, expr, .. }) => {
                 debug!("resolve_implementation AssocItemKind::Const");
-                // If this is a trait impl, ensure the const
-                // exists in trait
-                self.check_trait_item(
-                    item.id,
-                    item.ident,
-                    &item.kind,
-                    ValueNS,
-                    item.span,
-                    seen_trait_items,
-                    |i, s, c| ConstNotMemberOfTrait(i, s, c),
-                );
 
-                self.visit_ty(ty);
-                if let Some(expr) = expr {
-                    // We allow arbitrary const expressions inside of associated consts,
-                    // even if they are potentially not const evaluatable.
-                    //
-                    // Type parameters can already be used and as associated consts are
-                    // not used as part of the type system, this is far less surprising.
-                    self.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
-                        this.with_constant_rib(
-                            IsRepeatExpr::No,
-                            ConstantHasGenerics::Yes,
-                            None,
-                            |this| this.visit_expr(expr),
-                        )
-                    });
-                }
+                self.with_generic_param_rib(
+                    &generics.params,
+                    RibKind::AssocItem,
+                    LifetimeRibKind::Generics {
+                        binder: item.id,
+                        span: generics.span,
+                        kind: LifetimeBinderKind::ConstItem,
+                    },
+                    |this| {
+                        // If this is a trait impl, ensure the const
+                        // exists in trait
+                        this.check_trait_item(
+                            item.id,
+                            item.ident,
+                            &item.kind,
+                            ValueNS,
+                            item.span,
+                            seen_trait_items,
+                            |i, s, c| ConstNotMemberOfTrait(i, s, c),
+                        );
+
+                        this.visit_generics(generics);
+                        this.visit_ty(ty);
+                        if let Some(expr) = expr {
+                            // We allow arbitrary const expressions inside of associated consts,
+                            // even if they are potentially not const evaluatable.
+                            //
+                            // Type parameters can already be used and as associated consts are
+                            // not used as part of the type system, this is far less surprising.
+                            this.resolve_const_body(expr, None);
+                        }
+                    },
+                );
             }
             AssocItemKind::Fn(box Fn { generics, .. }) => {
                 debug!("resolve_implementation AssocItemKind::Fn");
@@ -3063,6 +3083,14 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
         );
     }
 
+    fn resolve_const_body(&mut self, expr: &'ast Expr, item: Option<(Ident, ConstantItemKind)>) {
+        self.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
+            this.with_constant_rib(IsRepeatExpr::No, ConstantHasGenerics::Yes, item, |this| {
+                this.visit_expr(expr)
+            });
+        })
+    }
+
     fn resolve_params(&mut self, params: &'ast [Param]) {
         let mut bindings = smallvec![(PatBoundCtx::Product, Default::default())];
         self.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| {
@@ -4448,6 +4476,7 @@ impl<'ast> Visitor<'ast> for LifetimeCountVisitor<'_, '_, '_> {
     fn visit_item(&mut self, item: &'ast Item) {
         match &item.kind {
             ItemKind::TyAlias(box TyAlias { ref generics, .. })
+            | ItemKind::Const(box ConstItem { ref generics, .. })
             | ItemKind::Fn(box Fn { ref generics, .. })
             | ItemKind::Enum(_, ref generics)
             | ItemKind::Struct(_, ref generics)
@@ -4467,7 +4496,6 @@ impl<'ast> Visitor<'ast> for LifetimeCountVisitor<'_, '_, '_> {
             ItemKind::Mod(..)
             | ItemKind::ForeignMod(..)
             | ItemKind::Static(..)
-            | ItemKind::Const(..)
             | ItemKind::Use(..)
             | ItemKind::ExternCrate(..)
             | ItemKind::MacroDef(..)
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index 753a1adc66d..974580f815b 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -585,13 +585,13 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                     let others = match enum_candidates.len() {
                         1 => String::new(),
                         2 => " and 1 other".to_owned(),
-                        n => format!(" and {} others", n),
+                        n => format!(" and {n} others"),
                     };
                     format!("there is an enum variant `{}`{}; ", enum_candidates[0].0, others)
                 } else {
                     String::new()
                 };
-                let msg = format!("{}try using the variant's enum", preamble);
+                let msg = format!("{preamble}try using the variant's enum");
 
                 err.span_suggestions(
                     span,
@@ -696,7 +696,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                     ident.name == path[0].ident.name {
                     err.span_help(
                         ident.span,
-                        format!("the binding `{}` is available in a different scope in the same function", path_str),
+                        format!("the binding `{path_str}` is available in a different scope in the same function"),
                     );
                     return (true, candidates);
                 }
@@ -858,7 +858,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 for label_rib in &self.label_ribs {
                     for (label_ident, node_id) in &label_rib.bindings {
                         let ident = path.last().unwrap().ident;
-                        if format!("'{}", ident) == label_ident.to_string() {
+                        if format!("'{ident}") == label_ident.to_string() {
                             err.span_label(label_ident.span, "a label with a similar name exists");
                             if let PathSource::Expr(Some(Expr {
                                 kind: ExprKind::Break(None, Some(_)),
@@ -983,7 +983,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 if let Some(ident) = fn_kind.ident() {
                     err.span_label(
                         ident.span,
-                        format!("this function {} have a `self` parameter", doesnt),
+                        format!("this function {doesnt} have a `self` parameter"),
                     );
                 }
             }
@@ -1164,7 +1164,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                         };
                         err.span_suggestion_verbose(
                             *where_span,
-                            format!("constrain the associated type to `{}`", ident),
+                            format!("constrain the associated type to `{ident}`"),
                             where_bound_predicate_to_string(&new_where_bound_predicate),
                             Applicability::MaybeIncorrect,
                         );
@@ -1338,8 +1338,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                             span, // Note the parentheses surrounding the suggestion below
                             format!(
                                 "you might want to surround a struct literal with parentheses: \
-                                 `({} {{ /* fields */ }})`?",
-                                path_str
+                                 `({path_str} {{ /* fields */ }})`?"
                             ),
                         );
                     }
@@ -1373,7 +1372,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                                     .map(|(idx, new)| (new, old_fields.get(idx)))
                                     .map(|(new, old)| {
                                         let new = new.to_ident_string();
-                                        if let Some(Some(old)) = old && new != *old { format!("{}: {}", new, old) } else { new }
+                                        if let Some(Some(old)) = old && new != *old { format!("{new}: {old}") } else { new }
                                     })
                                     .collect::<Vec<String>>()
                             } else {
@@ -1390,7 +1389,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                     };
                     err.span_suggestion(
                         span,
-                        format!("use struct {} syntax instead", descr),
+                        format!("use struct {descr} syntax instead"),
                         format!("{path_str} {{{pad}{fields}{pad}}}"),
                         applicability,
                     );
@@ -1584,7 +1583,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 err.span_suggestion(
                     span,
                     "use the tuple variant pattern syntax instead",
-                    format!("{}({})", path_str, fields),
+                    format!("{path_str}({fields})"),
                     Applicability::HasPlaceholders,
                 );
             }
@@ -1994,9 +1993,9 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
 
             if !suggestable_variants.is_empty() {
                 let msg = if non_suggestable_variant_count == 0 && suggestable_variants.len() == 1 {
-                    format!("try {} the enum's variant", source_msg)
+                    format!("try {source_msg} the enum's variant")
                 } else {
-                    format!("try {} one of the enum's variants", source_msg)
+                    format!("try {source_msg} one of the enum's variants")
                 };
 
                 err.span_suggestions(
@@ -2009,19 +2008,15 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
 
             // If the enum has no tuple variants..
             if non_suggestable_variant_count == variants.len() {
-                err.help(format!("the enum has no tuple variants {}", source_msg));
+                err.help(format!("the enum has no tuple variants {source_msg}"));
             }
 
             // If there are also non-tuple variants..
             if non_suggestable_variant_count == 1 {
-                err.help(format!(
-                    "you might have meant {} the enum's non-tuple variant",
-                    source_msg
-                ));
+                err.help(format!("you might have meant {source_msg} the enum's non-tuple variant"));
             } else if non_suggestable_variant_count >= 1 {
                 err.help(format!(
-                    "you might have meant {} one of the enum's non-tuple variants",
-                    source_msg
+                    "you might have meant {source_msg} one of the enum's non-tuple variants"
                 ));
             }
         } else {
@@ -2041,7 +2036,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 .map(|(variant, _, kind)| (path_names_to_string(variant), kind))
                 .map(|(variant, kind)| match kind {
                     CtorKind::Const => variant,
-                    CtorKind::Fn => format!("({}())", variant),
+                    CtorKind::Fn => format!("({variant}())"),
                 })
                 .collect::<Vec<_>>();
             let no_suggestable_variant = suggestable_variants.is_empty();
@@ -2066,7 +2061,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 .filter(|(_, def_id, kind)| needs_placeholder(*def_id, *kind))
                 .map(|(variant, _, kind)| (path_names_to_string(variant), kind))
                 .filter_map(|(variant, kind)| match kind {
-                    CtorKind::Fn => Some(format!("({}(/* fields */))", variant)),
+                    CtorKind::Fn => Some(format!("({variant}(/* fields */))")),
                     _ => None,
                 })
                 .collect::<Vec<_>>();
@@ -2348,13 +2343,20 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
             let mut should_continue = true;
             match rib.kind {
                 LifetimeRibKind::Generics { binder: _, span, kind } => {
+                    // Avoid suggesting placing lifetime parameters on constant items unless the relevant
+                    // feature is enabled. Suggest the parent item as a possible location if applicable.
+                    if let LifetimeBinderKind::ConstItem = kind
+                        && !self.r.tcx().features().generic_const_items
+                    {
+                        continue;
+                    }
+
                     if !span.can_be_used_for_suggestions() && suggest_note && let Some(name) = name {
                         suggest_note = false; // Avoid displaying the same help multiple times.
                         err.span_label(
                             span,
                             format!(
-                                "lifetime `{}` is missing in item created through this procedural macro",
-                                name,
+                                "lifetime `{name}` is missing in item created through this procedural macro",
                             ),
                         );
                         continue;
@@ -2398,7 +2400,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                         );
                     } else if let Some(name) = name {
                         let message =
-                            Cow::from(format!("consider introducing lifetime `{}` here", name));
+                            Cow::from(format!("consider introducing lifetime `{name}` here"));
                         should_continue = suggest(err, false, span, message, sugg);
                     } else {
                         let message = Cow::from("consider introducing a named lifetime parameter");
@@ -2542,7 +2544,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 }
 
                 let help_name = if let Some(ident) = ident {
-                    format!("`{}`", ident)
+                    format!("`{ident}`")
                 } else {
                     format!("argument {}", index + 1)
                 };
@@ -2550,7 +2552,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                 if lifetime_count == 1 {
                     m.push_str(&help_name[..])
                 } else {
-                    m.push_str(&format!("one of {}'s {} lifetimes", help_name, lifetime_count)[..])
+                    m.push_str(&format!("one of {help_name}'s {lifetime_count} lifetimes")[..])
                 }
             }
 
@@ -2580,14 +2582,12 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
             } else if num_params == 1 {
                 err.help(format!(
                     "this function's return type contains a borrowed value, \
-                 but the signature does not say which {} it is borrowed from",
-                    m
+                 but the signature does not say which {m} it is borrowed from"
                 ));
             } else {
                 err.help(format!(
                     "this function's return type contains a borrowed value, \
-                 but the signature does not say whether it is borrowed from {}",
-                    m
+                 but the signature does not say whether it is borrowed from {m}"
                 ));
             }
         }
@@ -2606,7 +2606,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
             }
             MissingLifetimeKind::Ampersand => {
                 debug_assert_eq!(lt.count, 1);
-                (lt.span.shrink_to_hi(), format!("{} ", existing_name))
+                (lt.span.shrink_to_hi(), format!("{existing_name} "))
             }
             MissingLifetimeKind::Comma => {
                 let sugg: String = std::iter::repeat([existing_name.as_str(), ", "])
@@ -2653,7 +2653,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
             }
             1 => {
                 err.multipart_suggestion_verbose(
-                    format!("consider using the `{}` lifetime", existing_name),
+                    format!("consider using the `{existing_name}` lifetime"),
                     spans_suggs,
                     Applicability::MaybeIncorrect,
                 );
@@ -2770,9 +2770,9 @@ pub(super) fn signal_label_shadowing(sess: &Session, orig: Span, shadower: Ident
     let shadower = shadower.span;
     let mut err = sess.struct_span_warn(
         shadower,
-        format!("label name `{}` shadows a label name that is already in scope", name),
+        format!("label name `{name}` shadows a label name that is already in scope"),
     );
     err.span_label(orig, "first declared here");
-    err.span_label(shadower, format!("label `{}` already in scope", name));
+    err.span_label(shadower, format!("label `{name}` already in scope"));
     err.emit();
 }
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index faa672db59c..da5e92a075a 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -658,6 +658,7 @@ impl<'a> fmt::Debug for Module<'a> {
 struct NameBindingData<'a> {
     kind: NameBindingKind<'a>,
     ambiguity: Option<(NameBinding<'a>, AmbiguityKind)>,
+    warn_ambiguity: bool,
     expansion: LocalExpnId,
     span: Span,
     vis: ty::Visibility<DefId>,
@@ -767,6 +768,7 @@ struct AmbiguityError<'a> {
     b2: NameBinding<'a>,
     misc1: AmbiguityErrorMisc,
     misc2: AmbiguityErrorMisc,
+    warning: bool,
 }
 
 impl<'a> NameBindingData<'a> {
@@ -794,6 +796,14 @@ impl<'a> NameBindingData<'a> {
             }
     }
 
+    fn is_warn_ambiguity(&self) -> bool {
+        self.warn_ambiguity
+            || match self.kind {
+                NameBindingKind::Import { binding, .. } => binding.is_warn_ambiguity(),
+                _ => false,
+            }
+    }
+
     fn is_possibly_imported_variant(&self) -> bool {
         match self.kind {
             NameBindingKind::Import { binding, .. } => binding.is_possibly_imported_variant(),
@@ -1158,7 +1168,7 @@ impl<'tcx> Resolver<'_, 'tcx> {
     }
 
     fn local_def_id(&self, node: NodeId) -> LocalDefId {
-        self.opt_local_def_id(node).unwrap_or_else(|| panic!("no entry for node id: `{:?}`", node))
+        self.opt_local_def_id(node).unwrap_or_else(|| panic!("no entry for node id: `{node:?}`"))
     }
 
     /// Adds a definition with a parent definition.
@@ -1322,6 +1332,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             dummy_binding: arenas.alloc_name_binding(NameBindingData {
                 kind: NameBindingKind::Res(Res::Err),
                 ambiguity: None,
+                warn_ambiguity: false,
                 expansion: LocalExpnId::ROOT,
                 span: DUMMY_SP,
                 vis: ty::Visibility::Public,
@@ -1685,6 +1696,16 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
     }
 
     fn record_use(&mut self, ident: Ident, used_binding: NameBinding<'a>, is_lexical_scope: bool) {
+        self.record_use_inner(ident, used_binding, is_lexical_scope, used_binding.warn_ambiguity);
+    }
+
+    fn record_use_inner(
+        &mut self,
+        ident: Ident,
+        used_binding: NameBinding<'a>,
+        is_lexical_scope: bool,
+        warn_ambiguity: bool,
+    ) {
         if let Some((b2, kind)) = used_binding.ambiguity {
             let ambiguity_error = AmbiguityError {
                 kind,
@@ -1693,9 +1714,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 b2,
                 misc1: AmbiguityErrorMisc::None,
                 misc2: AmbiguityErrorMisc::None,
+                warning: warn_ambiguity,
             };
             if !self.matches_previous_ambiguity_error(&ambiguity_error) {
-                // avoid duplicated span information to be emitt out
+                // avoid duplicated span information to be emit out
                 self.ambiguity_errors.push(ambiguity_error);
             }
         }
@@ -1715,7 +1737,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
                 self.used_imports.insert(id);
             }
             self.add_to_glob_map(import, ident);
-            self.record_use(ident, binding, false);
+            self.record_use_inner(ident, binding, false, warn_ambiguity || binding.warn_ambiguity);
         }
     }
 
@@ -1812,7 +1834,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
     fn record_partial_res(&mut self, node_id: NodeId, resolution: PartialRes) {
         debug!("(recording res) recording {:?} for {}", resolution, node_id);
         if let Some(prev_res) = self.partial_res_map.insert(node_id, resolution) {
-            panic!("path resolved multiple times ({:?} before, {:?} now)", prev_res, resolution);
+            panic!("path resolved multiple times ({prev_res:?} before, {resolution:?} now)");
         }
     }
 
diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs
index 266e37e4cef..614a29e7578 100644
--- a/compiler/rustc_resolve/src/macros.rs
+++ b/compiler/rustc_resolve/src/macros.rs
@@ -24,7 +24,9 @@ use rustc_hir::def_id::{CrateNum, LocalDefId};
 use rustc_middle::middle::stability;
 use rustc_middle::ty::RegisteredTools;
 use rustc_middle::ty::TyCtxt;
-use rustc_session::lint::builtin::{LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE};
+use rustc_session::lint::builtin::{
+    LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE, UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
+};
 use rustc_session::lint::builtin::{UNUSED_MACROS, UNUSED_MACRO_RULES};
 use rustc_session::lint::BuiltinLintDiagnostics;
 use rustc_session::parse::feature_err;
@@ -140,9 +142,9 @@ pub(crate) fn registered_tools(tcx: TyCtxt<'_>, (): ()) -> RegisteredTools {
             }
         }
     }
-    // We implicitly add `rustfmt` and `clippy` to known tools,
+    // We implicitly add `rustfmt`, `clippy`, `diagnostic` to known tools,
     // but it's not an error to register them explicitly.
-    let predefined_tools = [sym::clippy, sym::rustfmt];
+    let predefined_tools = [sym::clippy, sym::rustfmt, sym::diagnostic];
     registered_tools.extend(predefined_tools.iter().cloned().map(Ident::with_dummy_span));
     registered_tools
 }
@@ -205,7 +207,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
             self.tcx
                 .sess
                 .diagnostic()
-                .bug(format!("built-in macro `{}` was already registered", name));
+                .bug(format!("built-in macro `{name}` was already registered"));
         }
     }
 
@@ -568,7 +570,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             }
 
             let mut err = self.tcx.sess.create_err(err);
-            err.span_label(path.span, format!("not {} {}", article, expected));
+            err.span_label(path.span, format!("not {article} {expected}"));
 
             err.emit();
 
@@ -595,6 +597,18 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             }
         }
 
+        if res == Res::NonMacroAttr(NonMacroAttrKind::Tool)
+            && path.segments.len() >= 2
+            && path.segments[0].ident.name == sym::diagnostic
+        {
+            self.tcx.sess.parse_sess.buffer_lint(
+                UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
+                path.segments[1].span(),
+                node_id,
+                "unknown diagnostic attribute",
+            );
+        }
+
         Ok((ext, res))
     }
 
@@ -892,7 +906,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
             if macro_kind.is_some() && sub_namespace_match(macro_kind, Some(MacroKind::Attr)) {
                 self.tcx.sess.span_err(
                     ident.span,
-                    format!("name `{}` is reserved in attribute namespace", ident),
+                    format!("name `{ident}` is reserved in attribute namespace"),
                 );
             }
         }
diff --git a/compiler/rustc_session/Cargo.toml b/compiler/rustc_session/Cargo.toml
index 1291d1454a6..e26d25d9a41 100644
--- a/compiler/rustc_session/Cargo.toml
+++ b/compiler/rustc_session/Cargo.toml
@@ -4,7 +4,6 @@ version = "0.0.0"
 edition = "2021"
 
 [dependencies]
-atty = "0.2.13"
 bitflags = "1.2.1"
 getopts = "0.2"
 rustc_macros = { path = "../rustc_macros" }
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 36b5c385ab1..28ae88424ab 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -834,9 +834,10 @@ impl OutFileName {
     }
 
     pub fn is_tty(&self) -> bool {
+        use std::io::IsTerminal;
         match *self {
             OutFileName::Real(_) => false,
-            OutFileName::Stdout => atty::is(atty::Stream::Stdout),
+            OutFileName::Stdout => std::io::stdout().is_terminal(),
         }
     }
 
@@ -1538,9 +1539,8 @@ pub(super) fn build_target_config(
     );
     let (target, target_warnings) = target_result.unwrap_or_else(|e| {
         handler.early_error(format!(
-            "Error loading target specification: {}. \
-                 Run `rustc --print target-list` for a list of built-in targets",
-            e
+            "Error loading target specification: {e}. \
+                 Run `rustc --print target-list` for a list of built-in targets"
         ))
     });
     for warning in target_warnings.warning_messages() {
@@ -1977,8 +1977,7 @@ pub fn parse_crate_edition(handler: &EarlyErrorHandler, matches: &getopts::Match
         let is_nightly = nightly_options::match_is_nightly_build(matches);
         let msg = if !is_nightly {
             format!(
-                "the crate requires edition {}, but the latest edition supported by this Rust version is {}",
-                edition, LATEST_STABLE_EDITION
+                "the crate requires edition {edition}, but the latest edition supported by this Rust version is {LATEST_STABLE_EDITION}"
             )
         } else {
             format!("edition {edition} is unstable and only available with -Z unstable-options")
@@ -2151,6 +2150,12 @@ fn collect_print_requests(
     prints.extend(matches.opt_strs("print").into_iter().map(|req| {
         let (req, out) = split_out_file_name(&req);
 
+        if out.is_some() && !unstable_opts.unstable_options {
+            handler.early_error(
+                "the `-Z unstable-options` flag must also be passed to \
+                 enable the path print option",
+            );
+        }
         let kind = match PRINT_KINDS.iter().find(|&&(name, _)| name == req) {
             Some((_, PrintKind::TargetSpec)) => {
                 if unstable_opts.unstable_options {
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 4a535f80b8a..055ab2d9c15 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -330,8 +330,7 @@ fn build_options<O: Default>(
                     match value {
                         None => handler.early_error(
                             format!(
-                                "{0} option `{1}` requires {2} ({3} {1}=<value>)",
-                                outputname, key, type_desc, prefix
+                                "{outputname} option `{key}` requires {type_desc} ({prefix} {key}=<value>)"
                             ),
                         ),
                         Some(value) => handler.early_error(
@@ -1882,6 +1881,7 @@ written to standard error output)"),
 
     // If you add a new option, please update:
     // - compiler/rustc_interface/src/tests.rs
+    // - src/doc/unstable-book/src/compiler-flags
 }
 
 #[derive(Clone, Hash, PartialEq, Eq, Debug)]
diff --git a/compiler/rustc_smir/src/rustc_smir/mod.rs b/compiler/rustc_smir/src/rustc_smir/mod.rs
index cefcab1e18f..16744db7e4c 100644
--- a/compiler/rustc_smir/src/rustc_smir/mod.rs
+++ b/compiler/rustc_smir/src/rustc_smir/mod.rs
@@ -156,7 +156,9 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> {
                 ops.0.stable(tables),
                 ops.1.stable(tables),
             ),
-            NullaryOp(_, _) => todo!(),
+            NullaryOp(null_op, ty) => {
+                stable_mir::mir::Rvalue::NullaryOp(null_op.stable(tables), tables.intern_ty(*ty))
+            }
             UnaryOp(un_op, op) => {
                 stable_mir::mir::Rvalue::UnaryOp(un_op.stable(tables), op.stable(tables))
             }
@@ -510,7 +512,7 @@ impl<'tcx> Stable<'tcx> for mir::InlineAsmOperand<'tcx> {
             | InlineAsmOperand::SymStatic { .. } => (None, None),
         };
 
-        stable_mir::mir::InlineAsmOperand { in_value, out_place, raw_rpr: format!("{:?}", self) }
+        stable_mir::mir::InlineAsmOperand { in_value, out_place, raw_rpr: format!("{self:?}") }
     }
 }
 
@@ -559,10 +561,10 @@ impl<'tcx> Stable<'tcx> for mir::Terminator<'tcx> {
             },
             InlineAsm { template, operands, options, line_spans, destination, unwind } => {
                 Terminator::InlineAsm {
-                    template: format!("{:?}", template),
+                    template: format!("{template:?}"),
                     operands: operands.iter().map(|operand| operand.stable(tables)).collect(),
-                    options: format!("{:?}", options),
-                    line_spans: format!("{:?}", line_spans),
+                    options: format!("{options:?}"),
+                    line_spans: format!("{line_spans:?}"),
                     destination: destination.map(|d| d.as_usize()),
                     unwind: unwind.stable(tables),
                 }
diff --git a/compiler/rustc_smir/src/stable_mir/mir/body.rs b/compiler/rustc_smir/src/stable_mir/mir/body.rs
index 831eb6589e4..1b1871bcd2a 100644
--- a/compiler/rustc_smir/src/stable_mir/mir/body.rs
+++ b/compiler/rustc_smir/src/stable_mir/mir/body.rs
@@ -218,6 +218,9 @@ pub enum Rvalue {
     /// nature of this operation?
     ThreadLocalRef(stable_mir::CrateItem),
 
+    /// Computes a value as described by the operation.
+    NullaryOp(NullOp, Ty),
+
     /// Exactly like `BinaryOp`, but less operands.
     ///
     /// Also does two's-complement arithmetic. Negation requires a signed integer or a float;
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index ecaa82874a3..fbd9bf05528 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -605,7 +605,7 @@ impl Span {
         // FIXME: If this span comes from a `derive` macro but it points at code the user wrote,
         // the callsite span and the span will be pointing at different places. It also means that
         // we can safely provide suggestions on this span.
-            || (matches!(self.ctxt().outer_expn_data().kind, ExpnKind::Macro(MacroKind::Derive, _))
+            || (self.in_derive_expansion()
                 && self.parent_callsite().map(|p| (p.lo(), p.hi())) != Some((self.lo(), self.hi())))
     }
 
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 54eb7bef5f2..d3739733c1d 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -620,6 +620,7 @@ symbols! {
         destruct,
         destructuring_assignment,
         diagnostic,
+        diagnostic_namespace,
         direct,
         discriminant_kind,
         discriminant_type,
@@ -782,6 +783,7 @@ symbols! {
         generic_associated_types,
         generic_associated_types_extended,
         generic_const_exprs,
+        generic_const_items,
         generic_param_attrs,
         get_context,
         global_allocator,
@@ -1369,9 +1371,13 @@ symbols! {
         simd_arith_offset,
         simd_as,
         simd_bitmask,
+        simd_bitreverse,
+        simd_bswap,
         simd_cast,
         simd_cast_ptr,
         simd_ceil,
+        simd_ctlz,
+        simd_cttz,
         simd_div,
         simd_eq,
         simd_expose_addr,
diff --git a/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs b/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
index f683832e3df..845b5791161 100644
--- a/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
+++ b/compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs
@@ -7,10 +7,10 @@
 ///
 /// For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler,
 /// see design document in the tracking issue #89653.
-use core::fmt::Display;
 use rustc_data_structures::base_n;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_hir as hir;
+use rustc_middle::ty::layout::IntegerExt;
 use rustc_middle::ty::{
     self, Const, ExistentialPredicate, FloatTy, FnSig, Instance, IntTy, List, Region, RegionKind,
     TermKind, Ty, TyCtxt, UintTy,
@@ -19,6 +19,7 @@ use rustc_middle::ty::{GenericArg, GenericArgKind, GenericArgsRef};
 use rustc_span::def_id::DefId;
 use rustc_span::sym;
 use rustc_target::abi::call::{Conv, FnAbi};
+use rustc_target::abi::Integer;
 use rustc_target::spec::abi::Abi;
 use std::fmt::Write as _;
 
@@ -93,44 +94,54 @@ fn encode_const<'tcx>(
     dict: &mut FxHashMap<DictKey<'tcx>, usize>,
     options: EncodeTyOptions,
 ) -> String {
-    // L<element-type>[n]<element-value>E as literal argument
+    // L<element-type>[n][<element-value>]E as literal argument
     let mut s = String::from('L');
 
-    // Element type
-    s.push_str(&encode_ty(tcx, c.ty(), dict, options));
+    match c.kind() {
+        // Const parameters
+        ty::ConstKind::Param(..) => {
+            // L<element-type>E as literal argument
 
-    // The only allowed types of const parameters are bool, u8, u16, u32, u64, u128, usize i8, i16,
-    // i32, i64, i128, isize, and char. The bool value false is encoded as 0 and true as 1.
-    fn push_signed_value<T: Display + PartialOrd>(s: &mut String, value: T, zero: T) {
-        if value < zero {
-            s.push('n')
-        };
-        let _ = write!(s, "{value}");
-    }
-
-    fn push_unsigned_value<T: Display>(s: &mut String, value: T) {
-        let _ = write!(s, "{value}");
-    }
+            // Element type
+            s.push_str(&encode_ty(tcx, c.ty(), dict, options));
+        }
 
-    if let Some(scalar_int) = c.try_to_scalar_int() {
-        let signed = c.ty().is_signed();
-        match scalar_int.size().bits() {
-            8 if signed => push_signed_value(&mut s, scalar_int.try_to_i8().unwrap(), 0),
-            16 if signed => push_signed_value(&mut s, scalar_int.try_to_i16().unwrap(), 0),
-            32 if signed => push_signed_value(&mut s, scalar_int.try_to_i32().unwrap(), 0),
-            64 if signed => push_signed_value(&mut s, scalar_int.try_to_i64().unwrap(), 0),
-            128 if signed => push_signed_value(&mut s, scalar_int.try_to_i128().unwrap(), 0),
-            8 => push_unsigned_value(&mut s, scalar_int.try_to_u8().unwrap()),
-            16 => push_unsigned_value(&mut s, scalar_int.try_to_u16().unwrap()),
-            32 => push_unsigned_value(&mut s, scalar_int.try_to_u32().unwrap()),
-            64 => push_unsigned_value(&mut s, scalar_int.try_to_u64().unwrap()),
-            128 => push_unsigned_value(&mut s, scalar_int.try_to_u128().unwrap()),
-            _ => {
-                bug!("encode_const: unexpected size `{:?}`", scalar_int.size().bits());
+        // Literal arguments
+        ty::ConstKind::Value(..) => {
+            // L<element-type>[n]<element-value>E as literal argument
+
+            // Element type
+            s.push_str(&encode_ty(tcx, c.ty(), dict, options));
+
+            // The only allowed types of const values are bool, u8, u16, u32,
+            // u64, u128, usize i8, i16, i32, i64, i128, isize, and char. The
+            // bool value false is encoded as 0 and true as 1.
+            match c.ty().kind() {
+                ty::Int(ity) => {
+                    let bits = c.eval_bits(tcx, ty::ParamEnv::reveal_all(), c.ty());
+                    let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128;
+                    if val < 0 {
+                        s.push('n');
+                    }
+                    let _ = write!(s, "{val}");
+                }
+                ty::Uint(_) => {
+                    let val = c.eval_bits(tcx, ty::ParamEnv::reveal_all(), c.ty());
+                    let _ = write!(s, "{val}");
+                }
+                ty::Bool => {
+                    let val = c.try_eval_bool(tcx, ty::ParamEnv::reveal_all()).unwrap();
+                    let _ = write!(s, "{val}");
+                }
+                _ => {
+                    bug!("encode_const: unexpected type `{:?}`", c.ty());
+                }
             }
-        };
-    } else {
-        bug!("encode_const: unexpected type `{:?}`", c.ty());
+        }
+
+        _ => {
+            bug!("encode_const: unexpected kind `{:?}`", c.kind());
+        }
     }
 
     // Close the "L..E" pair
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 7114c243ea1..9e556c6cb96 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1300,6 +1300,7 @@ supported_targets! {
     ("armv7-linux-androideabi", armv7_linux_androideabi),
     ("thumbv7neon-linux-androideabi", thumbv7neon_linux_androideabi),
     ("aarch64-linux-android", aarch64_linux_android),
+    ("riscv64-linux-android", riscv64_linux_android),
 
     ("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
     ("armv6-unknown-freebsd", armv6_unknown_freebsd),
diff --git a/compiler/rustc_target/src/spec/riscv64_linux_android.rs b/compiler/rustc_target/src/spec/riscv64_linux_android.rs
new file mode 100644
index 00000000000..af0d6855494
--- /dev/null
+++ b/compiler/rustc_target/src/spec/riscv64_linux_android.rs
@@ -0,0 +1,19 @@
+use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions};
+
+pub fn target() -> Target {
+    Target {
+        llvm_target: "riscv64-linux-android".into(),
+        pointer_width: 64,
+        data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
+        arch: "riscv64".into(),
+        options: TargetOptions {
+            code_model: Some(CodeModel::Medium),
+            cpu: "generic-rv64".into(),
+            features: "+m,+a,+f,+d,+c".into(),
+            llvm_abiname: "lp64d".into(),
+            supported_sanitizers: SanitizerSet::ADDRESS,
+            max_atomic_width: Some(64),
+            ..super::android_base::opts()
+        },
+    }
+}
diff --git a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
index ab90db6ff58..5ec48c7ac57 100644
--- a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
+++ b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
@@ -7,7 +7,7 @@ use rustc_hir::def_id::DefId;
 use rustc_infer::traits::query::NoSolution;
 use rustc_infer::traits::Reveal;
 use rustc_middle::traits::solve::inspect::CandidateKind;
-use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, MaybeCause, QueryResult};
+use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, QueryResult};
 use rustc_middle::traits::BuiltinImplSource;
 use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams};
 use rustc_middle::ty::{self, Ty, TyCtxt};
@@ -299,7 +299,7 @@ pub(super) trait GoalKind<'tcx>:
     /// for unsize coercion in hir typeck and because it is difficult to
     /// otherwise recompute this for codegen. This is a bit of a mess but the
     /// easiest way to maintain the existing behavior for now.
-    fn consider_builtin_unsize_and_upcast_candidates(
+    fn consider_builtin_unsize_candidates(
         ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
     ) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)>;
@@ -402,7 +402,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
                 ecx.with_incremented_depth(
                     |ecx| {
                         let result = ecx.evaluate_added_goals_and_make_canonical_response(
-                            Certainty::Maybe(MaybeCause::Overflow),
+                            Certainty::OVERFLOW,
                         )?;
                         Ok(vec![Candidate {
                             source: CandidateSource::BuiltinImpl(BuiltinImplSource::Misc),
@@ -624,7 +624,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
         // There may be multiple unsize candidates for a trait with several supertraits:
         // `trait Foo: Bar<A> + Bar<B>` and `dyn Foo: Unsize<dyn Bar<_>>`
         if lang_items.unsize_trait() == Some(trait_def_id) {
-            for (result, source) in G::consider_builtin_unsize_and_upcast_candidates(self, goal) {
+            for (result, source) in G::consider_builtin_unsize_candidates(self, goal) {
                 candidates.push(Candidate { source: CandidateSource::BuiltinImpl(source), result });
             }
         }
diff --git a/compiler/rustc_trait_selection/src/solve/canonicalize.rs b/compiler/rustc_trait_selection/src/solve/canonicalize.rs
index 255620489ff..88771f90756 100644
--- a/compiler/rustc_trait_selection/src/solve/canonicalize.rs
+++ b/compiler/rustc_trait_selection/src/solve/canonicalize.rs
@@ -125,9 +125,8 @@ impl<'a, 'tcx> Canonicalizer<'a, 'tcx> {
         // - var_infos: [E0, U1, E1, U1, E1, E6, U6], curr_compressed_uv: 1, next_orig_uv: 6
         // - var_infos: [E0, U1, E1, U1, E1, E2, U2], curr_compressed_uv: 2, next_orig_uv: -
         //
-        // This algorithm runs in `O(nm)` where `n` is the number of different universe
-        // indices in the input and `m` is the number of canonical variables.
-        // This should be fine as both `n` and `m` are expected to be small.
+        // This algorithm runs in `O(n²)` where `n` is the number of different universe
+        // indices in the input. This should be fine as `n` is expected to be small.
         let mut curr_compressed_uv = ty::UniverseIndex::ROOT;
         let mut existential_in_new_uv = false;
         let mut next_orig_uv = Some(ty::UniverseIndex::ROOT);
@@ -263,14 +262,18 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
             ty::ReError(_) => return r,
         };
 
-        let var = ty::BoundVar::from(
-            self.variables.iter().position(|&v| v == r.into()).unwrap_or_else(|| {
-                let var = self.variables.len();
-                self.variables.push(r.into());
-                self.primitive_var_infos.push(CanonicalVarInfo { kind });
-                var
-            }),
-        );
+        let existing_bound_var = match self.canonicalize_mode {
+            CanonicalizeMode::Input => None,
+            CanonicalizeMode::Response { .. } => {
+                self.variables.iter().position(|&v| v == r.into()).map(ty::BoundVar::from)
+            }
+        };
+        let var = existing_bound_var.unwrap_or_else(|| {
+            let var = ty::BoundVar::from(self.variables.len());
+            self.variables.push(r.into());
+            self.primitive_var_infos.push(CanonicalVarInfo { kind });
+            var
+        });
         let br = ty::BoundRegion { var, kind: BrAnon(None) };
         ty::Region::new_late_bound(self.interner(), self.binder_index, br)
     }
diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs
index f48a992d327..485bc912c44 100644
--- a/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs
+++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt.rs
@@ -11,8 +11,8 @@ use rustc_infer::traits::ObligationCause;
 use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
 use rustc_middle::traits::solve::inspect;
 use rustc_middle::traits::solve::{
-    CanonicalInput, CanonicalResponse, Certainty, IsNormalizesToHack, MaybeCause,
-    PredefinedOpaques, PredefinedOpaquesData, QueryResult,
+    CanonicalInput, CanonicalResponse, Certainty, IsNormalizesToHack, PredefinedOpaques,
+    PredefinedOpaquesData, QueryResult,
 };
 use rustc_middle::traits::DefiningAnchor;
 use rustc_middle::ty::{
@@ -344,7 +344,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
             Ok(response) => response,
         };
 
-        let has_changed = !canonical_response.value.var_values.is_identity()
+        let has_changed = !canonical_response.value.var_values.is_identity_modulo_regions()
             || !canonical_response.value.external_constraints.opaque_types.is_empty();
         let (certainty, nested_goals) = match self.instantiate_and_apply_query_response(
             goal.param_env,
@@ -475,7 +475,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
         let mut new_goals = NestedGoals::new();
 
         let response = self.repeat_while_none(
-            |_| Ok(Certainty::Maybe(MaybeCause::Overflow)),
+            |_| Ok(Certainty::OVERFLOW),
             |this| {
                 this.inspect.evaluate_added_goals_loop_start();
 
diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs
index 6045001510e..409bcf5ce61 100644
--- a/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs
+++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs
@@ -338,7 +338,7 @@ fn rematch_unsize<'tcx>(
                     .into_obligations(),
             );
 
-            // Similar to ADTs, require that the rest of the fields are equal.
+            // Similar to ADTs, require that we can unsize the tail.
             nested.push(Obligation::new(
                 tcx,
                 ObligationCause::dummy(),
diff --git a/compiler/rustc_trait_selection/src/solve/project_goals.rs b/compiler/rustc_trait_selection/src/solve/project_goals.rs
index 03ade738bb6..2ce57751740 100644
--- a/compiler/rustc_trait_selection/src/solve/project_goals.rs
+++ b/compiler/rustc_trait_selection/src/solve/project_goals.rs
@@ -503,7 +503,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
         )
     }
 
-    fn consider_builtin_unsize_and_upcast_candidates(
+    fn consider_builtin_unsize_candidates(
         _ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
     ) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)> {
diff --git a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
index 98c8a74752c..c25d6eca918 100644
--- a/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
+++ b/compiler/rustc_trait_selection/src/solve/search_graph/mod.rs
@@ -9,9 +9,7 @@ use cache::ProvisionalCache;
 use overflow::OverflowData;
 use rustc_index::IndexVec;
 use rustc_middle::dep_graph::DepKind;
-use rustc_middle::traits::solve::{
-    CanonicalInput, Certainty, EvaluationCache, MaybeCause, QueryResult,
-};
+use rustc_middle::traits::solve::{CanonicalInput, Certainty, EvaluationCache, QueryResult};
 use rustc_middle::ty::TyCtxt;
 use std::{collections::hash_map::Entry, mem};
 
@@ -146,11 +144,7 @@ impl<'tcx> SearchGraph<'tcx> {
                 {
                     Err(cache.provisional_result(entry_index))
                 } else {
-                    Err(super::response_no_constraints(
-                        tcx,
-                        input,
-                        Certainty::Maybe(MaybeCause::Overflow),
-                    ))
+                    Err(super::response_no_constraints(tcx, input, Certainty::OVERFLOW))
                 }
             }
         }
diff --git a/compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs b/compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs
index e0a2e0c5cc2..83a051eeb1a 100644
--- a/compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs
+++ b/compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs
@@ -1,6 +1,6 @@
 use rustc_infer::infer::canonical::Canonical;
 use rustc_infer::traits::query::NoSolution;
-use rustc_middle::traits::solve::{Certainty, MaybeCause, QueryResult};
+use rustc_middle::traits::solve::{Certainty, QueryResult};
 use rustc_middle::ty::TyCtxt;
 use rustc_session::Limit;
 
@@ -115,6 +115,6 @@ impl<'tcx> SearchGraph<'tcx> {
         goal: Canonical<'tcx, impl Sized>,
     ) -> QueryResult<'tcx> {
         self.overflow_data.deal_with_overflow();
-        response_no_constraints(tcx, goal, Certainty::Maybe(MaybeCause::Overflow))
+        response_no_constraints(tcx, goal, Certainty::OVERFLOW)
     }
 }
diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs
index 24ea9b5ea12..14a5b9656e5 100644
--- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs
+++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs
@@ -7,7 +7,7 @@ use rustc_hir::def_id::DefId;
 use rustc_hir::{LangItem, Movability};
 use rustc_infer::traits::query::NoSolution;
 use rustc_middle::traits::solve::inspect::CandidateKind;
-use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, MaybeCause, QueryResult};
+use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, QueryResult};
 use rustc_middle::traits::{BuiltinImplSource, Reveal};
 use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams, TreatProjections};
 use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt};
@@ -366,69 +366,6 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
         )
     }
 
-    fn consider_builtin_unsize_and_upcast_candidates(
-        ecx: &mut EvalCtxt<'_, 'tcx>,
-        goal: Goal<'tcx, Self>,
-    ) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)> {
-        if goal.predicate.polarity != ty::ImplPolarity::Positive {
-            return vec![];
-        }
-
-        ecx.probe(|_| CandidateKind::DynUpcastingAssembly).enter(|ecx| {
-            let a_ty = goal.predicate.self_ty();
-            // We need to normalize the b_ty since it's matched structurally
-            // in the other functions below.
-            let b_ty = match ecx
-                .normalize_non_self_ty(goal.predicate.trait_ref.args.type_at(1), goal.param_env)
-            {
-                Ok(Some(b_ty)) => {
-                    // If we have a type var, then bail with ambiguity.
-                    if b_ty.is_ty_var() {
-                        return vec![(
-                            ecx.evaluate_added_goals_and_make_canonical_response(
-                                Certainty::AMBIGUOUS,
-                            )
-                            .unwrap(),
-                            BuiltinImplSource::Misc,
-                        )];
-                    } else {
-                        b_ty
-                    }
-                }
-                Ok(None) => {
-                    return vec![(
-                        ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Maybe(
-                            MaybeCause::Overflow,
-                        ))
-                        .unwrap(),
-                        BuiltinImplSource::Misc,
-                    )];
-                }
-                Err(_) => return vec![],
-            };
-
-            let mut results = vec![];
-            results.extend(ecx.consider_builtin_dyn_upcast_candidates(goal.param_env, a_ty, b_ty));
-            results.extend(
-                ecx.consider_builtin_unsize_candidate(goal.with(ecx.tcx(), (a_ty, b_ty)))
-                    .into_iter()
-                    .map(|resp| {
-                        // If we're unsizing from tuple -> tuple, detect
-                        let source =
-                            if matches!((a_ty.kind(), b_ty.kind()), (ty::Tuple(..), ty::Tuple(..)))
-                            {
-                                BuiltinImplSource::TupleUnsizing
-                            } else {
-                                BuiltinImplSource::Misc
-                            };
-                        (resp, source)
-                    }),
-            );
-
-            results
-        })
-    }
-
     fn consider_builtin_discriminant_kind_candidate(
         ecx: &mut EvalCtxt<'_, 'tcx>,
         goal: Goal<'tcx, Self>,
@@ -449,14 +386,11 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
             return Err(NoSolution);
         }
 
-        if !goal.param_env.is_const() {
-            // `Destruct` is automatically implemented for every type in
-            // non-const environments.
-            ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
-        } else {
-            // FIXME(-Ztrait-solver=next): Implement this when we get const working in the new solver
-            Err(NoSolution)
-        }
+        // FIXME(-Ztrait-solver=next): Implement this when we get const working in the new solver
+
+        // `Destruct` is automatically implemented for every type in
+        // non-const environments.
+        ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
     }
 
     fn consider_builtin_transmute_candidate(
@@ -489,153 +423,111 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
         )?;
         ecx.evaluate_added_goals_and_make_canonical_response(certainty)
     }
-}
 
-impl<'tcx> EvalCtxt<'_, 'tcx> {
-    fn consider_builtin_unsize_candidate(
-        &mut self,
-        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
-    ) -> QueryResult<'tcx> {
-        let Goal { param_env, predicate: (a_ty, b_ty) } = goal;
-        self.probe_candidate("builtin unsize").enter(|ecx| {
-            let tcx = ecx.tcx();
+    fn consider_builtin_unsize_candidates(
+        ecx: &mut EvalCtxt<'_, 'tcx>,
+        goal: Goal<'tcx, Self>,
+    ) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)> {
+        if goal.predicate.polarity != ty::ImplPolarity::Positive {
+            return vec![];
+        }
+
+        let misc_candidate = |ecx: &mut EvalCtxt<'_, 'tcx>, certainty| {
+            (
+                ecx.evaluate_added_goals_and_make_canonical_response(certainty).unwrap(),
+                BuiltinImplSource::Misc,
+            )
+        };
+
+        let result_to_single = |result, source| match result {
+            Ok(resp) => vec![(resp, source)],
+            Err(NoSolution) => vec![],
+        };
+
+        ecx.probe(|_| CandidateKind::DynUpcastingAssembly).enter(|ecx| {
+            let a_ty = goal.predicate.self_ty();
+            // We need to normalize the b_ty since it's matched structurally
+            // in the other functions below.
+            let b_ty = match ecx
+                .normalize_non_self_ty(goal.predicate.trait_ref.args.type_at(1), goal.param_env)
+            {
+                Ok(Some(b_ty)) => b_ty,
+                Ok(None) => return vec![misc_candidate(ecx, Certainty::OVERFLOW)],
+                Err(_) => return vec![],
+            };
+
+            let goal = goal.with(ecx.tcx(), (a_ty, b_ty));
             match (a_ty.kind(), b_ty.kind()) {
-                (ty::Infer(ty::TyVar(_)), _) | (_, ty::Infer(ty::TyVar(_))) => {
-                    bug!("unexpected type variable in unsize goal")
-                }
-                // Trait upcasting, or `dyn Trait + Auto + 'a` -> `dyn Trait + 'b`
-                (&ty::Dynamic(_, _, ty::Dyn), &ty::Dynamic(_, _, ty::Dyn)) => {
-                    // Dyn upcasting is handled separately, since due to upcasting,
-                    // when there are two supertraits that differ by args, we
-                    // may return more than one query response.
-                    Err(NoSolution)
-                }
-                // `T` -> `dyn Trait` unsizing
-                (_, &ty::Dynamic(data, region, ty::Dyn)) => {
-                    // Can only unsize to an object-safe type
-                    if data
-                        .principal_def_id()
-                        .is_some_and(|def_id| !tcx.check_is_object_safe(def_id))
-                    {
-                        return Err(NoSolution);
-                    }
+                (ty::Infer(ty::TyVar(..)), ..) => bug!("unexpected infer {a_ty:?} {b_ty:?}"),
+                (_, ty::Infer(ty::TyVar(..))) => vec![misc_candidate(ecx, Certainty::AMBIGUOUS)],
 
-                    let Some(sized_def_id) = tcx.lang_items().sized_trait() else {
-                        return Err(NoSolution);
-                    };
-                    // Check that the type implements all of the predicates of the def-id.
-                    // (i.e. the principal, all of the associated types match, and any auto traits)
-                    ecx.add_goals(
-                        data.iter()
-                            .map(|pred| Goal::new(tcx, param_env, pred.with_self_ty(tcx, a_ty))),
-                    );
-                    // The type must be Sized to be unsized.
-                    ecx.add_goal(Goal::new(
-                        tcx,
-                        param_env,
-                        ty::TraitRef::new(tcx, sized_def_id, [a_ty]),
-                    ));
-                    // The type must outlive the lifetime of the `dyn` we're unsizing into.
-                    ecx.add_goal(Goal::new(
-                        tcx,
-                        param_env,
-                        ty::Binder::dummy(ty::OutlivesPredicate(a_ty, region)),
-                    ));
-                    ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
-                }
-                // `[T; n]` -> `[T]` unsizing
-                (&ty::Array(a_elem_ty, ..), &ty::Slice(b_elem_ty)) => {
-                    // We just require that the element type stays the same
-                    ecx.eq(param_env, a_elem_ty, b_elem_ty)?;
-                    ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
-                }
-                // Struct unsizing `Struct<T>` -> `Struct<U>` where `T: Unsize<U>`
+                // Trait upcasting, or `dyn Trait + Auto + 'a` -> `dyn Trait + 'b`.
+                (
+                    &ty::Dynamic(a_data, a_region, ty::Dyn),
+                    &ty::Dynamic(b_data, b_region, ty::Dyn),
+                ) => ecx.consider_builtin_dyn_upcast_candidates(
+                    goal, a_data, a_region, b_data, b_region,
+                ),
+
+                // `T` -> `dyn Trait` unsizing
+                (_, &ty::Dynamic(b_data, b_region, ty::Dyn)) => result_to_single(
+                    ecx.consider_builtin_unsize_to_dyn(goal, b_data, b_region),
+                    BuiltinImplSource::Misc,
+                ),
+
+                // `[T; N]` -> `[T]` unsizing
+                (&ty::Array(a_elem_ty, ..), &ty::Slice(b_elem_ty)) => result_to_single(
+                    ecx.consider_builtin_array_unsize(goal, a_elem_ty, b_elem_ty),
+                    BuiltinImplSource::Misc,
+                ),
+
+                // `Struct<T>` -> `Struct<U>` where `T: Unsize<U>`
                 (&ty::Adt(a_def, a_args), &ty::Adt(b_def, b_args))
-                    if a_def.is_struct() && a_def.did() == b_def.did() =>
+                    if a_def.is_struct() && a_def == b_def =>
                 {
-                    let unsizing_params = tcx.unsizing_params_for_adt(a_def.did());
-                    // We must be unsizing some type parameters. This also implies
-                    // that the struct has a tail field.
-                    if unsizing_params.is_empty() {
-                        return Err(NoSolution);
-                    }
-
-                    let tail_field = a_def.non_enum_variant().tail();
-                    let tail_field_ty = tcx.type_of(tail_field.did);
-
-                    let a_tail_ty = tail_field_ty.instantiate(tcx, a_args);
-                    let b_tail_ty = tail_field_ty.instantiate(tcx, b_args);
-
-                    // Substitute just the unsizing params from B into A. The type after
-                    // this substitution must be equal to B. This is so we don't unsize
-                    // unrelated type parameters.
-                    let new_a_args =
-                        tcx.mk_args_from_iter(a_args.iter().enumerate().map(|(i, a)| {
-                            if unsizing_params.contains(i as u32) { b_args[i] } else { a }
-                        }));
-                    let unsized_a_ty = Ty::new_adt(tcx, a_def, new_a_args);
-
-                    // Finally, we require that `TailA: Unsize<TailB>` for the tail field
-                    // types.
-                    ecx.eq(param_env, unsized_a_ty, b_ty)?;
-                    ecx.add_goal(Goal::new(
-                        tcx,
-                        param_env,
-                        ty::TraitRef::new(
-                            tcx,
-                            tcx.lang_items().unsize_trait().unwrap(),
-                            [a_tail_ty, b_tail_ty],
-                        ),
-                    ));
-                    ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+                    result_to_single(
+                        ecx.consider_builtin_struct_unsize(goal, a_def, a_args, b_args),
+                        BuiltinImplSource::Misc,
+                    )
                 }
-                // Tuple unsizing `(.., T)` -> `(.., U)` where `T: Unsize<U>`
+
+                //  `(A, B, T)` -> `(A, B, U)` where `T: Unsize<U>`
                 (&ty::Tuple(a_tys), &ty::Tuple(b_tys))
                     if a_tys.len() == b_tys.len() && !a_tys.is_empty() =>
                 {
-                    let (a_last_ty, a_rest_tys) = a_tys.split_last().unwrap();
-                    let b_last_ty = b_tys.last().unwrap();
-
-                    // Substitute just the tail field of B., and require that they're equal.
-                    let unsized_a_ty =
-                        Ty::new_tup_from_iter(tcx, a_rest_tys.iter().chain([b_last_ty]).copied());
-                    ecx.eq(param_env, unsized_a_ty, b_ty)?;
-
-                    // Similar to ADTs, require that the rest of the fields are equal.
-                    ecx.add_goal(Goal::new(
-                        tcx,
-                        param_env,
-                        ty::TraitRef::new(
-                            tcx,
-                            tcx.lang_items().unsize_trait().unwrap(),
-                            [*a_last_ty, *b_last_ty],
-                        ),
-                    ));
-                    ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+                    result_to_single(
+                        ecx.consider_builtin_tuple_unsize(goal, a_tys, b_tys),
+                        BuiltinImplSource::TupleUnsizing,
+                    )
                 }
-                _ => Err(NoSolution),
+
+                _ => vec![],
             }
         })
     }
+}
 
+impl<'tcx> EvalCtxt<'_, 'tcx> {
+    /// Trait upcasting allows for coercions between trait objects:
+    /// ```ignore (builtin impl example)
+    /// trait Super {}
+    /// trait Trait: Super {}
+    /// // results in builtin impls upcasting to a super trait
+    /// impl<'a, 'b: 'a> Unsize<dyn Super + 'a> for dyn Trait + 'b {}
+    /// // and impls removing auto trait bounds.
+    /// impl<'a, 'b: 'a> Unsize<dyn Trait + 'a> for dyn Trait + Send + 'b {}
+    /// ```
     fn consider_builtin_dyn_upcast_candidates(
         &mut self,
-        param_env: ty::ParamEnv<'tcx>,
-        a_ty: Ty<'tcx>,
-        b_ty: Ty<'tcx>,
+        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
+        a_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
+        a_region: ty::Region<'tcx>,
+        b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
+        b_region: ty::Region<'tcx>,
     ) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)> {
-        if a_ty.is_ty_var() || b_ty.is_ty_var() {
-            bug!("unexpected type variable in unsize goal")
-        }
-
-        let ty::Dynamic(a_data, a_region, ty::Dyn) = *a_ty.kind() else {
-            return vec![];
-        };
-        let ty::Dynamic(b_data, b_region, ty::Dyn) = *b_ty.kind() else {
-            return vec![];
-        };
-
         let tcx = self.tcx();
+        let Goal { predicate: (a_ty, b_ty), .. } = goal;
+
         // All of a's auto traits need to be in b's auto traits.
         let auto_traits_compatible =
             b_data.auto_traits().all(|b| a_data.auto_traits().any(|a| a == b));
@@ -668,12 +560,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
                         let new_a_ty = Ty::new_dynamic(tcx, new_a_data, b_region, ty::Dyn);
 
                         // We also require that A's lifetime outlives B's lifetime.
-                        ecx.eq(param_env, new_a_ty, b_ty)?;
-                        ecx.add_goal(Goal::new(
-                            tcx,
-                            param_env,
-                            ty::Binder::dummy(ty::OutlivesPredicate(a_region, b_region)),
-                        ));
+                        ecx.eq(goal.param_env, new_a_ty, b_ty)?;
+                        ecx.add_goal(goal.with(tcx, ty::OutlivesPredicate(a_region, b_region)));
                         ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
                     },
                 )
@@ -706,6 +594,161 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
         responses
     }
 
+    /// ```ignore (builtin impl example)
+    /// trait Trait {
+    ///     fn foo(&self);
+    /// }
+    /// // results in the following builtin impl
+    /// impl<'a, T: Trait + 'a> Unsize<dyn Trait + 'a> for T {}
+    /// ```
+    fn consider_builtin_unsize_to_dyn(
+        &mut self,
+        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
+        b_data: &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>,
+        b_region: ty::Region<'tcx>,
+    ) -> QueryResult<'tcx> {
+        let tcx = self.tcx();
+        let Goal { predicate: (a_ty, _b_ty), .. } = goal;
+
+        // Can only unsize to an object-safe trait
+        if b_data.principal_def_id().is_some_and(|def_id| !tcx.check_is_object_safe(def_id)) {
+            return Err(NoSolution);
+        }
+
+        // Check that the type implements all of the predicates of the trait object.
+        // (i.e. the principal, all of the associated types match, and any auto traits)
+        self.add_goals(b_data.iter().map(|pred| goal.with(tcx, pred.with_self_ty(tcx, a_ty))));
+
+        // The type must be `Sized` to be unsized.
+        if let Some(sized_def_id) = tcx.lang_items().sized_trait() {
+            self.add_goal(goal.with(tcx, ty::TraitRef::new(tcx, sized_def_id, [a_ty])));
+        } else {
+            return Err(NoSolution);
+        }
+
+        // The type must outlive the lifetime of the `dyn` we're unsizing into.
+        self.add_goal(goal.with(tcx, ty::OutlivesPredicate(a_ty, b_region)));
+        self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+    }
+
+    /// We have the following builtin impls for arrays:
+    /// ```ignore (builtin impl example)
+    /// impl<T: ?Sized, const N: usize> Unsize<[T]> for [T; N] {}
+    /// ```
+    /// While the impl itself could theoretically not be builtin,
+    /// the actual unsizing behavior is builtin. Its also easier to
+    /// make all impls of `Unsize` builtin as we're able to use
+    /// `#[rustc_deny_explicit_impl]` in this case.
+    fn consider_builtin_array_unsize(
+        &mut self,
+        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
+        a_elem_ty: Ty<'tcx>,
+        b_elem_ty: Ty<'tcx>,
+    ) -> QueryResult<'tcx> {
+        self.eq(goal.param_env, a_elem_ty, b_elem_ty)?;
+        self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+    }
+
+    /// We generate a builtin `Unsize` impls for structs with generic parameters only
+    /// mentioned by the last field.
+    /// ```ignore (builtin impl example)
+    /// struct Foo<T, U: ?Sized> {
+    ///     sized_field: Vec<T>,
+    ///     unsizable: Box<U>,
+    /// }
+    /// // results in the following builtin impl
+    /// impl<T: ?Sized, U: ?Sized, V: ?Sized> Unsize<Foo<T, V>> for Foo<T, U>
+    /// where
+    ///     Box<U>: Unsize<Box<V>>,
+    /// {}
+    /// ```
+    fn consider_builtin_struct_unsize(
+        &mut self,
+        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
+        def: ty::AdtDef<'tcx>,
+        a_args: ty::GenericArgsRef<'tcx>,
+        b_args: ty::GenericArgsRef<'tcx>,
+    ) -> QueryResult<'tcx> {
+        let tcx = self.tcx();
+        let Goal { predicate: (_a_ty, b_ty), .. } = goal;
+
+        let unsizing_params = tcx.unsizing_params_for_adt(def.did());
+        // We must be unsizing some type parameters. This also implies
+        // that the struct has a tail field.
+        if unsizing_params.is_empty() {
+            return Err(NoSolution);
+        }
+
+        let tail_field = def.non_enum_variant().tail();
+        let tail_field_ty = tcx.type_of(tail_field.did);
+
+        let a_tail_ty = tail_field_ty.instantiate(tcx, a_args);
+        let b_tail_ty = tail_field_ty.instantiate(tcx, b_args);
+
+        // Substitute just the unsizing params from B into A. The type after
+        // this substitution must be equal to B. This is so we don't unsize
+        // unrelated type parameters.
+        let new_a_args = tcx.mk_args_from_iter(
+            a_args
+                .iter()
+                .enumerate()
+                .map(|(i, a)| if unsizing_params.contains(i as u32) { b_args[i] } else { a }),
+        );
+        let unsized_a_ty = Ty::new_adt(tcx, def, new_a_args);
+
+        // Finally, we require that `TailA: Unsize<TailB>` for the tail field
+        // types.
+        self.eq(goal.param_env, unsized_a_ty, b_ty)?;
+        self.add_goal(goal.with(
+            tcx,
+            ty::TraitRef::new(
+                tcx,
+                tcx.lang_items().unsize_trait().unwrap(),
+                [a_tail_ty, b_tail_ty],
+            ),
+        ));
+        self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+    }
+
+    /// We generate the following builtin impl for tuples of all sizes.
+    ///
+    /// This impl is still unstable and we emit a feature error when it
+    /// when it is used by a coercion.
+    /// ```ignore (builtin impl example)
+    /// impl<T: ?Sized, U: ?Sized, V: ?Sized> Unsize<(T, V)> for (T, U)
+    /// where
+    ///     U: Unsize<V>,
+    /// {}
+    /// ```
+    fn consider_builtin_tuple_unsize(
+        &mut self,
+        goal: Goal<'tcx, (Ty<'tcx>, Ty<'tcx>)>,
+        a_tys: &'tcx ty::List<Ty<'tcx>>,
+        b_tys: &'tcx ty::List<Ty<'tcx>>,
+    ) -> QueryResult<'tcx> {
+        let tcx = self.tcx();
+        let Goal { predicate: (_a_ty, b_ty), .. } = goal;
+
+        let (&a_last_ty, a_rest_tys) = a_tys.split_last().unwrap();
+        let &b_last_ty = b_tys.last().unwrap();
+
+        // Substitute just the tail field of B., and require that they're equal.
+        let unsized_a_ty =
+            Ty::new_tup_from_iter(tcx, a_rest_tys.iter().copied().chain([b_last_ty]));
+        self.eq(goal.param_env, unsized_a_ty, b_ty)?;
+
+        // Similar to ADTs, require that we can unsize the tail.
+        self.add_goal(goal.with(
+            tcx,
+            ty::TraitRef::new(
+                tcx,
+                tcx.lang_items().unsize_trait().unwrap(),
+                [a_last_ty, b_last_ty],
+            ),
+        ));
+        self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
+    }
+
     // Return `Some` if there is an impl (built-in or user provided) that may
     // hold for the self type of the goal, which for coherence and soundness
     // purposes must disqualify the built-in auto impl assembled by considering
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
index 27cd0f99f34..94d3cd035aa 100644
--- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs
+++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
@@ -161,7 +161,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
         let (full_env, full_user_env) = self
             .evaluate_predicates(&infcx, trait_did, ty, new_env, user_env, &mut fresh_preds)
             .unwrap_or_else(|| {
-                panic!("Failed to fully process: {:?} {:?} {:?}", ty, trait_did, orig_env)
+                panic!("Failed to fully process: {ty:?} {trait_did:?} {orig_env:?}")
             });
 
         debug!(
@@ -178,7 +178,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
         ocx.register_bound(ObligationCause::dummy(), full_env, ty, trait_did);
         let errors = ocx.select_all_or_error();
         if !errors.is_empty() {
-            panic!("Unable to fulfill trait {:?} for '{:?}': {:?}", trait_did, ty, errors);
+            panic!("Unable to fulfill trait {trait_did:?} for '{ty:?}': {errors:?}");
         }
 
         let outlives_env = OutlivesEnvironment::new(full_env);
@@ -339,7 +339,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
                         return None;
                     }
                 }
-                _ => panic!("Unexpected error for '{:?}': {:?}", ty, result),
+                _ => panic!("Unexpected error for '{ty:?}': {result:?}"),
             };
 
             let normalized_preds =
@@ -347,14 +347,12 @@ impl<'tcx> AutoTraitFinder<'tcx> {
             new_env = ty::ParamEnv::new(
                 tcx.mk_clauses_from_iter(normalized_preds.filter_map(|p| p.as_clause())),
                 param_env.reveal(),
-                param_env.constness(),
             );
         }
 
         let final_user_env = ty::ParamEnv::new(
             tcx.mk_clauses_from_iter(user_computed_preds.into_iter().filter_map(|p| p.as_clause())),
             user_env.reveal(),
-            user_env.constness(),
         );
         debug!(
             "evaluate_nested_obligations(ty={:?}, trait_did={:?}): succeeded with '{:?}' \
@@ -749,7 +747,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
                             // subobligations or getting an error) when we started off with
                             // inference variables
                             if p.term().skip_binder().has_infer_types() {
-                                panic!("Unexpected result when selecting {:?} {:?}", ty, obligation)
+                                panic!("Unexpected result when selecting {ty:?} {obligation:?}")
                             }
                         }
                     }
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs
index 039e4ec9afd..19d5baa30ec 100644
--- a/compiler/rustc_trait_selection/src/traits/coherence.rs
+++ b/compiler/rustc_trait_selection/src/traits/coherence.rs
@@ -357,7 +357,7 @@ fn impl_intersection_has_negative_obligation(
         Err(err) => {
             tcx.sess.delay_span_bug(
                 tcx.def_span(impl1_def_id),
-                format!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
+                format!("failed to fully normalize {impl1_def_id:?}: {err:?}"),
             );
             return false;
         }
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index c14839fe9be..14020c05251 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -226,7 +226,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
                 let span = variant_data.ctor_hir_id().map_or(DUMMY_SP, |id| hir.span(id));
                 (span, None, vec![ArgKind::empty(); variant_data.fields().len()])
             }
-            _ => panic!("non-FnLike node found: {:?}", node),
+            _ => panic!("non-FnLike node found: {node:?}"),
         })
     }
 
@@ -273,10 +273,10 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
             found_str,
         );
 
-        err.span_label(span, format!("expected {} that takes {}", kind, expected_str));
+        err.span_label(span, format!("expected {kind} that takes {expected_str}"));
 
         if let Some(found_span) = found_span {
-            err.span_label(found_span, format!("takes {}", found_str));
+            err.span_label(found_span, format!("takes {found_str}"));
 
             // Suggest to take and ignore the arguments with expected_args_length `_`s if
             // found arguments is empty (assume the user just wants to ignore args in this case).
@@ -289,7 +289,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
                         "consider changing the closure to take and ignore the expected argument{}",
                         pluralize!(expected_args.len())
                     ),
-                    format!("|{}|", underscores),
+                    format!("|{underscores}|"),
                     Applicability::MachineApplicable,
                 );
             }
@@ -304,7 +304,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
                     err.span_suggestion_verbose(
                         found_span,
                         "change the closure to take multiple arguments instead of a single tuple",
-                        format!("|{}|", sugg),
+                        format!("|{sugg}|"),
                         Applicability::MachineApplicable,
                     );
                 }
@@ -687,9 +687,8 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 match bound_predicate.skip_binder() {
                     ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_predicate)) => {
                         let trait_predicate = bound_predicate.rebind(trait_predicate);
-                        let mut trait_predicate = self.resolve_vars_if_possible(trait_predicate);
+                        let trait_predicate = self.resolve_vars_if_possible(trait_predicate);
 
-                        trait_predicate.remap_constness_diag(obligation.param_env);
                         let predicate_is_const = ty::BoundConstness::ConstIfConst
                             == trait_predicate.skip_binder().constness;
 
@@ -704,9 +703,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                             .get_parent_trait_ref(obligation.cause.code())
                             .map(|(t, s)| {
                                 (
-                                    format!(" in `{}`", t),
-                                    format!("within `{}`, ", t),
-                                    s.map(|s| (format!("within this `{}`", t), s)),
+                                    format!(" in `{t}`"),
+                                    format!("within `{t}`, "),
+                                    s.map(|s| (format!("within this `{t}`"), s)),
                                 )
                             })
                             .unwrap_or_default();
@@ -1071,7 +1070,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                                 // which bounds actually failed to hold.
                                 self.tcx.sess.struct_span_err(
                                     span,
-                                    format!("the type `{}` is not well-formed", ty),
+                                    format!("the type `{ty}` is not well-formed"),
                                 )
                             }
                         }
@@ -1109,7 +1108,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     ty::PredicateKind::Clause(ty::ClauseKind::ConstArgHasType(ct, ty)) => {
                         let mut diag = self.tcx.sess.struct_span_err(
                             span,
-                            format!("the constant `{}` is not of type `{}`", ct, ty),
+                            format!("the constant `{ct}` is not of type `{ty}`"),
                         );
                         self.note_type_err(
                             &mut diag,
@@ -1981,7 +1980,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     if all_traits_equal {
                         format!("\n  {}", c.self_ty())
                     } else {
-                        format!("\n  {}", c)
+                        format!("\n  {c}")
                     }
                 })
                 .collect();
@@ -2179,10 +2178,8 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 format!("trait impl{} with same name found", pluralize!(trait_impls.len())),
             );
             let trait_crate = self.tcx.crate_name(trait_with_same_path.krate);
-            let crate_msg = format!(
-                "perhaps two different versions of crate `{}` are being used?",
-                trait_crate
-            );
+            let crate_msg =
+                format!("perhaps two different versions of crate `{trait_crate}` are being used?");
             err.note(crate_msg);
             suggested = true;
         }
@@ -2310,7 +2307,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         err.cancel();
                         return;
                     }
-                    err.note(format!("cannot satisfy `{}`", predicate));
+                    err.note(format!("cannot satisfy `{predicate}`"));
                     let impl_candidates = self
                         .find_similar_impl_candidates(predicate.to_opt_poly_trait_pred().unwrap());
                     if impl_candidates.len() < 10 {
@@ -2374,7 +2371,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         if let Some(local_def_id) = data.trait_ref.def_id.as_local()
                             && let Some(hir::Node::Item(hir::Item { ident: trait_name, kind: hir::ItemKind::Trait(_, _, _, _, trait_item_refs), .. })) = self.tcx.hir().find_by_def_id(local_def_id)
                             && let Some(method_ref) = trait_item_refs.iter().find(|item_ref| item_ref.ident == *assoc_item_name) {
-                            err.span_label(method_ref.span, format!("`{}::{}` defined here", trait_name, assoc_item_name));
+                            err.span_label(method_ref.span, format!("`{trait_name}::{assoc_item_name}` defined here"));
                         }
 
                         err.span_label(span, format!("cannot {verb} associated {noun} of trait"));
@@ -2475,7 +2472,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         ErrorCode::E0284,
                         true,
                     );
-                    err.note(format!("cannot satisfy `{}`", predicate));
+                    err.note(format!("cannot satisfy `{predicate}`"));
                     err
                 } else {
                     // If we can't find a substitution, just print a generic error
@@ -2486,7 +2483,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         "type annotations needed: cannot satisfy `{}`",
                         predicate,
                     );
-                    err.span_label(span, format!("cannot satisfy `{}`", predicate));
+                    err.span_label(span, format!("cannot satisfy `{predicate}`"));
                     err
                 }
             }
@@ -2514,7 +2511,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         "type annotations needed: cannot satisfy `{}`",
                         predicate,
                     );
-                    err.span_label(span, format!("cannot satisfy `{}`", predicate));
+                    err.span_label(span, format!("cannot satisfy `{predicate}`"));
                     err
                 }
             }
@@ -2529,7 +2526,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     "type annotations needed: cannot satisfy `{}`",
                     predicate,
                 );
-                err.span_label(span, format!("cannot satisfy `{}`", predicate));
+                err.span_label(span, format!("cannot satisfy `{predicate}`"));
                 err
             }
         };
@@ -2566,7 +2563,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 }
             }
         }
-        let mut crate_names: Vec<_> = crates.iter().map(|n| format!("`{}`", n)).collect();
+        let mut crate_names: Vec<_> = crates.iter().map(|n| format!("`{n}`")).collect();
         crate_names.sort();
         crate_names.dedup();
         post.sort();
@@ -2593,7 +2590,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             predicate
         );
         let post = if post.len() > 1 || (post.len() == 1 && post[0].contains('\n')) {
-            format!(":\n{}", post.iter().map(|p| format!("- {}", p)).collect::<Vec<_>>().join("\n"),)
+            format!(":\n{}", post.iter().map(|p| format!("- {p}")).collect::<Vec<_>>().join("\n"),)
         } else if post.len() == 1 {
             format!(": `{}`", post[0])
         } else {
@@ -2602,7 +2599,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
         match (spans.len(), crates.len(), crate_names.len()) {
             (0, 0, 0) => {
-                err.note(format!("cannot satisfy `{}`", predicate));
+                err.note(format!("cannot satisfy `{predicate}`"));
             }
             (0, _, 1) => {
                 err.note(format!("{} in the `{}` crate{}", msg, crates[0], post,));
@@ -2773,7 +2770,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
         err.span_suggestion_verbose(
             span,
             "consider relaxing the implicit `Sized` restriction",
-            format!("{} ?Sized", separator),
+            format!("{separator} ?Sized"),
             Applicability::MachineApplicable,
         );
     }
@@ -2864,7 +2861,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 }
             })
             .unwrap_or_else(|| {
-                format!("the trait bound `{}` is not satisfied{}", trait_predicate, post_message)
+                format!("the trait bound `{trait_predicate}` is not satisfied{post_message}")
             })
     }
 
@@ -3108,11 +3105,11 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
         span: Span,
     ) -> UnsatisfiedConst {
         let mut unsatisfied_const = UnsatisfiedConst(false);
-        if trait_predicate.is_const_if_const() && obligation.param_env.is_const() {
+        if trait_predicate.is_const_if_const() {
             let non_const_predicate = trait_ref.without_const();
             let non_const_obligation = Obligation {
                 cause: obligation.cause.clone(),
-                param_env: obligation.param_env.without_const(),
+                param_env: obligation.param_env,
                 predicate: non_const_predicate.to_predicate(self.tcx),
                 recursion_depth: obligation.recursion_depth,
             };
@@ -3152,11 +3149,11 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
         err.span_label(
             closure_span,
-            format!("this closure implements `{}`, not `{}`", found_kind, kind),
+            format!("this closure implements `{found_kind}`, not `{kind}`"),
         );
         err.span_label(
             obligation.cause.span,
-            format!("the requirement to implement `{}` derives from here", kind),
+            format!("the requirement to implement `{kind}` derives from here"),
         );
 
         // Additional context information explaining why the closure only implements
@@ -3383,8 +3380,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                 let const_span = self.tcx.def_span(uv.def);
                 match self.tcx.sess.source_map().span_to_snippet(const_span) {
                     Ok(snippet) => err.help(format!(
-                        "try adding a `where` bound using this expression: `where [(); {}]:`",
-                        snippet
+                        "try adding a `where` bound using this expression: `where [(); {snippet}]:`"
                     )),
                     _ => err.help("consider adding a `where` bound using this expression"),
                 };
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs
index a530b27bc91..0e73bad1918 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs
@@ -170,7 +170,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
         if let Some(k) = obligation.cause.span.desugaring_kind() {
             flags.push((sym::from_desugaring, None));
-            flags.push((sym::from_desugaring, Some(format!("{:?}", k))));
+            flags.push((sym::from_desugaring, Some(format!("{k:?}"))));
         }
 
         if let ObligationCauseCode::MainFunctionType = obligation.cause.code() {
@@ -258,9 +258,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             if let ty::Array(aty, len) = self_ty.kind() {
                 flags.push((sym::_Self, Some("[]".to_string())));
                 let len = len.try_to_value().and_then(|v| v.try_to_target_usize(self.tcx));
-                flags.push((sym::_Self, Some(format!("[{}; _]", aty))));
+                flags.push((sym::_Self, Some(format!("[{aty}; _]"))));
                 if let Some(n) = len {
-                    flags.push((sym::_Self, Some(format!("[{}; {}]", aty, n))));
+                    flags.push((sym::_Self, Some(format!("[{aty}; {n}]"))));
                 }
                 if let Some(def) = aty.ty_adt_def() {
                     // We also want to be able to select the array's type's original
@@ -579,7 +579,7 @@ impl<'tcx> OnUnimplementedFormatString {
                                     "there is no parameter `{}` on {}",
                                     s,
                                     if trait_def_id == item_def_id {
-                                        format!("trait `{}`", trait_name)
+                                        format!("trait `{trait_name}`")
                                     } else {
                                         "impl".to_string()
                                     }
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index 220b3576ddb..31f70bbd34d 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -41,7 +41,6 @@ use rustc_span::{BytePos, DesugaringKind, ExpnKind, MacroKind, Span, DUMMY_SP};
 use rustc_target::spec::abi;
 use std::borrow::Cow;
 use std::iter;
-use std::ops::Deref;
 
 use super::InferCtxtPrivExt;
 use crate::infer::InferCtxtExt as _;
@@ -480,13 +479,13 @@ fn suggest_restriction<'tcx>(
                 .visit_ty(input);
         }
         // The type param `T: Trait` we will suggest to introduce.
-        let type_param = format!("{}: {}", type_param_name, bound_str);
+        let type_param = format!("{type_param_name}: {bound_str}");
 
         let mut sugg = vec![
             if let Some(span) = hir_generics.span_for_param_suggestion() {
-                (span, format!(", {}", type_param))
+                (span, format!(", {type_param}"))
             } else {
-                (hir_generics.span, format!("<{}>", type_param))
+                (hir_generics.span, format!("<{type_param}>"))
             },
             // `fn foo(t: impl Trait)`
             //                       ^ suggest `where <T as Trait>::A: Bound`
@@ -531,7 +530,7 @@ fn suggest_restriction<'tcx>(
 
         err.span_suggestion_verbose(
             sp,
-            format!("consider further restricting {}", msg),
+            format!("consider further restricting {msg}"),
             suggestion,
             Applicability::MachineApplicable,
         );
@@ -655,6 +654,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         | hir::ItemKind::Impl(hir::Impl { generics, .. })
                         | hir::ItemKind::Fn(_, generics, _)
                         | hir::ItemKind::TyAlias(_, generics)
+                        | hir::ItemKind::Const(_, generics, _)
                         | hir::ItemKind::TraitAlias(generics, _)
                         | hir::ItemKind::OpaqueTy(hir::OpaqueTy { generics, .. }),
                     ..
@@ -694,7 +694,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                                 term
                             );
                         } else {
-                            constraint.push_str(&format!("<{} = {}>", name, term));
+                            constraint.push_str(&format!("<{name} = {term}>"));
                         }
                     }
 
@@ -720,6 +720,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         | hir::ItemKind::Impl(hir::Impl { generics, .. })
                         | hir::ItemKind::Fn(_, generics, _)
                         | hir::ItemKind::TyAlias(_, generics)
+                        | hir::ItemKind::Const(_, generics, _)
                         | hir::ItemKind::TraitAlias(generics, _)
                         | hir::ItemKind::OpaqueTy(hir::OpaqueTy { generics, .. }),
                     ..
@@ -1015,7 +1016,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     let name = self.tcx.def_path_str(def_id);
                     err.span_label(
                         self.tcx.def_span(def_id),
-                        format!("consider calling the constructor for `{}`", name),
+                        format!("consider calling the constructor for `{name}`"),
                     );
                     name
                 }
@@ -1394,7 +1395,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     // Because of this, we modify the error to refer to the original obligation and
                     // return early in the caller.
 
-                    let msg = format!("the trait bound `{}` is not satisfied", old_pred);
+                    let msg = format!("the trait bound `{old_pred}` is not satisfied");
                     if has_custom_message {
                         err.note(msg);
                     } else {
@@ -1434,7 +1435,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                                 err.multipart_suggestion_verbose(
                                     sugg_msg,
                                     vec![
-                                        (span.shrink_to_lo(), format!("({}", sugg_prefix)),
+                                        (span.shrink_to_lo(), format!("({sugg_prefix}")),
                                         (span.shrink_to_hi(), ")".to_string()),
                                     ],
                                     Applicability::MaybeIncorrect,
@@ -1470,7 +1471,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                             vec![(span.shrink_to_lo(), sugg_prefix)]
                         } else {
                             vec![
-                                (span.shrink_to_lo(), format!("{}(", sugg_prefix)),
+                                (span.shrink_to_lo(), format!("{sugg_prefix}(")),
                                 (span.shrink_to_hi(), ")".to_string()),
                             ]
                         };
@@ -1701,8 +1702,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                             hir.get_if_local(*def_id)
                     {
                         let msg = format!(
-                            "alternatively, consider making `fn {}` asynchronous",
-                            ident
+                            "alternatively, consider making `fn {ident}` asynchronous"
                         );
                         if vis_span.is_empty() {
                             err.span_suggestion_verbose(
@@ -1953,10 +1953,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         // don't print out the [type error] here
                         err.delay_as_bug();
                     } else {
-                        err.span_label(
-                            expr.span,
-                            format!("this returned value is of type `{}`", ty),
-                        );
+                        err.span_label(expr.span, format!("this returned value is of type `{ty}`"));
                     }
                 }
             }
@@ -2457,8 +2454,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
             err.clear_code();
             err.set_primary_message(format!(
-                "{} cannot be {} between threads safely",
-                future_or_generator, trait_verb
+                "{future_or_generator} cannot be {trait_verb} between threads safely"
             ));
 
             let original_span = err.span.primary_span().unwrap();
@@ -2467,7 +2463,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             let message = outer_generator
                 .and_then(|generator_did| {
                     Some(match self.tcx.generator_kind(generator_did).unwrap() {
-                        GeneratorKind::Gen => format!("generator is not {}", trait_name),
+                        GeneratorKind::Gen => format!("generator is not {trait_name}"),
                         GeneratorKind::Async(AsyncGeneratorKind::Fn) => self
                             .tcx
                             .parent(generator_did)
@@ -2475,73 +2471,73 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                             .map(|parent_did| hir.local_def_id_to_hir_id(parent_did))
                             .and_then(|parent_hir_id| hir.opt_name(parent_hir_id))
                             .map(|name| {
-                                format!("future returned by `{}` is not {}", name, trait_name)
+                                format!("future returned by `{name}` is not {trait_name}")
                             })?,
                         GeneratorKind::Async(AsyncGeneratorKind::Block) => {
-                            format!("future created by async block is not {}", trait_name)
+                            format!("future created by async block is not {trait_name}")
                         }
                         GeneratorKind::Async(AsyncGeneratorKind::Closure) => {
-                            format!("future created by async closure is not {}", trait_name)
+                            format!("future created by async closure is not {trait_name}")
                         }
                     })
                 })
-                .unwrap_or_else(|| format!("{} is not {}", future_or_generator, trait_name));
+                .unwrap_or_else(|| format!("{future_or_generator} is not {trait_name}"));
 
             span.push_span_label(original_span, message);
             err.set_span(span);
 
-            format!("is not {}", trait_name)
+            format!("is not {trait_name}")
         } else {
             format!("does not implement `{}`", trait_pred.print_modifiers_and_trait_path())
         };
 
-        let mut explain_yield =
-            |interior_span: Span, yield_span: Span, scope_span: Option<Span>| {
-                let mut span = MultiSpan::from_span(yield_span);
-                let snippet = match source_map.span_to_snippet(interior_span) {
-                    // #70935: If snippet contains newlines, display "the value" instead
-                    // so that we do not emit complex diagnostics.
-                    Ok(snippet) if !snippet.contains('\n') => format!("`{}`", snippet),
-                    _ => "the value".to_string(),
-                };
-                // note: future is not `Send` as this value is used across an await
-                //   --> $DIR/issue-70935-complex-spans.rs:13:9
-                //    |
-                // LL |            baz(|| async {
-                //    |  ______________-
-                //    | |
-                //    | |
-                // LL | |              foo(tx.clone());
-                // LL | |          }).await;
-                //    | |          - ^^^^^^ await occurs here, with value maybe used later
-                //    | |__________|
-                //    |            has type `closure` which is not `Send`
-                // note: value is later dropped here
-                // LL | |          }).await;
-                //    | |                  ^
-                //
-                span.push_span_label(
-                    yield_span,
-                    format!("{} occurs here, with {} maybe used later", await_or_yield, snippet),
-                );
-                span.push_span_label(
-                    interior_span,
-                    format!("has type `{}` which {}", target_ty, trait_explanation),
-                );
-                if let Some(scope_span) = scope_span {
-                    let scope_span = source_map.end_point(scope_span);
+        let mut explain_yield = |interior_span: Span,
+                                 yield_span: Span,
+                                 scope_span: Option<Span>| {
+            let mut span = MultiSpan::from_span(yield_span);
+            let snippet = match source_map.span_to_snippet(interior_span) {
+                // #70935: If snippet contains newlines, display "the value" instead
+                // so that we do not emit complex diagnostics.
+                Ok(snippet) if !snippet.contains('\n') => format!("`{snippet}`"),
+                _ => "the value".to_string(),
+            };
+            // note: future is not `Send` as this value is used across an await
+            //   --> $DIR/issue-70935-complex-spans.rs:13:9
+            //    |
+            // LL |            baz(|| async {
+            //    |  ______________-
+            //    | |
+            //    | |
+            // LL | |              foo(tx.clone());
+            // LL | |          }).await;
+            //    | |          - ^^^^^^ await occurs here, with value maybe used later
+            //    | |__________|
+            //    |            has type `closure` which is not `Send`
+            // note: value is later dropped here
+            // LL | |          }).await;
+            //    | |                  ^
+            //
+            span.push_span_label(
+                yield_span,
+                format!("{await_or_yield} occurs here, with {snippet} maybe used later"),
+            );
+            span.push_span_label(
+                interior_span,
+                format!("has type `{target_ty}` which {trait_explanation}"),
+            );
+            if let Some(scope_span) = scope_span {
+                let scope_span = source_map.end_point(scope_span);
 
-                    let msg = format!("{} is later dropped here", snippet);
-                    span.push_span_label(scope_span, msg);
-                }
-                err.span_note(
+                let msg = format!("{snippet} is later dropped here");
+                span.push_span_label(scope_span, msg);
+            }
+            err.span_note(
                     span,
                     format!(
-                        "{} {} as this value is used across {}",
-                        future_or_generator, trait_explanation, an_await_or_yield
+                        "{future_or_generator} {trait_explanation} as this value is used across {an_await_or_yield}"
                     ),
                 );
-            };
+        };
         match interior_or_upvar_span {
             GeneratorInteriorOrUpvar::Interior(interior_span, interior_extra_info) => {
                 if let Some((scope_span, yield_span, expr, from_awaited_ty)) = interior_extra_info {
@@ -2551,15 +2547,13 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         span.push_span_label(
                             await_span,
                             format!(
-                                "await occurs here on type `{}`, which {}",
-                                target_ty, trait_explanation
+                                "await occurs here on type `{target_ty}`, which {trait_explanation}"
                             ),
                         );
                         err.span_note(
                             span,
                             format!(
-                                "future {not_trait} as it awaits another future which {not_trait}",
-                                not_trait = trait_explanation
+                                "future {trait_explanation} as it awaits another future which {trait_explanation}"
                             ),
                         );
                     } else {
@@ -2642,18 +2636,16 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                         let ref_kind = if is_mut { "&mut" } else { "&" };
                         (
                             format!(
-                                "has type `{}` which {}, because `{}` is not `{}`",
-                                target_ty, trait_explanation, ref_ty, ref_ty_trait
+                                "has type `{target_ty}` which {trait_explanation}, because `{ref_ty}` is not `{ref_ty_trait}`"
                             ),
                             format!(
-                                "captured value {} because `{}` references cannot be sent unless their referent is `{}`",
-                                trait_explanation, ref_kind, ref_ty_trait
+                                "captured value {trait_explanation} because `{ref_kind}` references cannot be sent unless their referent is `{ref_ty_trait}`"
                             ),
                         )
                     }
                     None => (
-                        format!("has type `{}` which {}", target_ty, trait_explanation),
-                        format!("captured value {}", trait_explanation),
+                        format!("has type `{target_ty}` which {trait_explanation}"),
+                        format!("captured value {trait_explanation}"),
                     ),
                 };
 
@@ -2742,8 +2734,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             }
             ObligationCauseCode::ObjectTypeBound(object_ty, region) => {
                 err.note(format!(
-                    "required so that the lifetime bound of `{}` for `{}` is satisfied",
-                    region, object_ty,
+                    "required so that the lifetime bound of `{region}` for `{object_ty}` is satisfied",
                 ));
             }
             ObligationCauseCode::ItemObligation(_)
@@ -3063,7 +3054,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                                 let mut msg =
                                     "required because it captures the following types: ".to_owned();
                                 for ty in bound_tys.skip_binder() {
-                                    with_forced_trimmed_paths!(write!(msg, "`{}`, ", ty).unwrap());
+                                    with_forced_trimmed_paths!(write!(msg, "`{ty}`, ").unwrap());
                                 }
                                 err.note(msg.trim_end_matches(", ").to_string())
                             }
@@ -3077,7 +3068,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                                     "required because it captures the following types: ".to_owned();
                                 for bty in tcx.generator_hidden_types(*def_id) {
                                     let ty = bty.instantiate(tcx, args);
-                                    write!(msg, "`{}`, ", ty).unwrap();
+                                    write!(msg, "`{ty}`, ").unwrap();
                                 }
                                 err.note(msg.trim_end_matches(", ").to_string())
                             }
@@ -3136,7 +3127,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             ObligationCauseCode::ImplDerivedObligation(ref data) => {
                 let mut parent_trait_pred =
                     self.resolve_vars_if_possible(data.derived.parent_trait_pred);
-                parent_trait_pred.remap_constness_diag(param_env);
                 let parent_def_id = parent_trait_pred.def_id();
                 let (self_ty, file) =
                     self.tcx.short_ty_string(parent_trait_pred.skip_binder().self_ty());
@@ -3513,7 +3503,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
                     trait_pred.skip_binder().self_ty(),
                     diagnostic_name,
                 ),
-                format!("#[derive({})]\n", diagnostic_name),
+                format!("#[derive({diagnostic_name})]\n"),
                 Applicability::MaybeIncorrect,
             );
         }
@@ -3576,7 +3566,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             // to an associated type (as seen from `trait_pred`) in the predicate. Like in
             // trait_pred `S: Sum<<Self as Iterator>::Item>` and predicate `i32: Sum<&()>`
             let mut type_diffs = vec![];
-            if let ObligationCauseCode::ExprBindingObligation(def_id, _, _, idx) = parent_code.deref()
+            if let ObligationCauseCode::ExprBindingObligation(def_id, _, _, idx) = parent_code
                 && let Some(node_args) = typeck_results.node_args_opt(call_hir_id)
                 && let where_clauses = self.tcx.predicates_of(def_id).instantiate(self.tcx, node_args)
                 && let Some(where_pred) = where_clauses.predicates.get(*idx)
@@ -3999,7 +3989,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
             .map(|trait_ref| trait_ref.trait_ref.self_ty())
             .find(|t| is_slice(*t))
         {
-            let msg = format!("convert the array to a `{}` slice instead", slice_ty);
+            let msg = format!("convert the array to a `{slice_ty}` slice instead");
 
             if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
                 let mut suggestions = vec![];
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index 6bab87e5de5..593f669e9bb 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -328,11 +328,7 @@ pub fn normalize_param_env_or_error<'tcx>(
 
     debug!("normalize_param_env_or_error: elaborated-predicates={:?}", predicates);
 
-    let elaborated_env = ty::ParamEnv::new(
-        tcx.mk_clauses(&predicates),
-        unnormalized_env.reveal(),
-        unnormalized_env.constness(),
-    );
+    let elaborated_env = ty::ParamEnv::new(tcx.mk_clauses(&predicates), unnormalized_env.reveal());
 
     // HACK: we are trying to normalize the param-env inside *itself*. The problem is that
     // normalization expects its param-env to be already normalized, which means we have
@@ -376,11 +372,8 @@ pub fn normalize_param_env_or_error<'tcx>(
     // here. I believe they should not matter, because we are ignoring TypeOutlives param-env
     // predicates here anyway. Keeping them here anyway because it seems safer.
     let outlives_env = non_outlives_predicates.iter().chain(&outlives_predicates).cloned();
-    let outlives_env = ty::ParamEnv::new(
-        tcx.mk_clauses_from_iter(outlives_env),
-        unnormalized_env.reveal(),
-        unnormalized_env.constness(),
-    );
+    let outlives_env =
+        ty::ParamEnv::new(tcx.mk_clauses_from_iter(outlives_env), unnormalized_env.reveal());
     let Ok(outlives_predicates) =
         do_normalize_predicates(tcx, cause, outlives_env, outlives_predicates)
     else {
@@ -393,11 +386,7 @@ pub fn normalize_param_env_or_error<'tcx>(
     let mut predicates = non_outlives_predicates;
     predicates.extend(outlives_predicates);
     debug!("normalize_param_env_or_error: final predicates={:?}", predicates);
-    ty::ParamEnv::new(
-        tcx.mk_clauses(&predicates),
-        unnormalized_env.reveal(),
-        unnormalized_env.constness(),
-    )
+    ty::ParamEnv::new(tcx.mk_clauses(&predicates), unnormalized_env.reveal())
 }
 
 /// Normalize a type and process all resulting obligations, returning any errors.
diff --git a/compiler/rustc_trait_selection/src/traits/object_safety.rs b/compiler/rustc_trait_selection/src/traits/object_safety.rs
index 143e8412967..76752edc4ae 100644
--- a/compiler/rustc_trait_selection/src/traits/object_safety.rs
+++ b/compiler/rustc_trait_selection/src/traits/object_safety.rs
@@ -517,8 +517,7 @@ fn virtual_call_violation_for_method<'tcx>(
                     tcx.sess.delay_span_bug(
                         tcx.def_span(method.def_id),
                         format!(
-                            "receiver when `Self = ()` should have a Scalar ABI; found {:?}",
-                            abi
+                            "receiver when `Self = ()` should have a Scalar ABI; found {abi:?}"
                         ),
                     );
                 }
@@ -536,8 +535,7 @@ fn virtual_call_violation_for_method<'tcx>(
                     tcx.sess.delay_span_bug(
                         tcx.def_span(method.def_id),
                         format!(
-                            "receiver when `Self = {}` should have a ScalarPair ABI; found {:?}",
-                            trait_object_ty, abi
+                            "receiver when `Self = {trait_object_ty}` should have a ScalarPair ABI; found {abi:?}"
                         ),
                     );
                 }
@@ -761,11 +759,7 @@ fn receiver_is_dispatchable<'tcx>(
         let caller_bounds =
             param_env.caller_bounds().iter().chain([unsize_predicate, trait_predicate]);
 
-        ty::ParamEnv::new(
-            tcx.mk_clauses_from_iter(caller_bounds),
-            param_env.reveal(),
-            param_env.constness(),
-        )
+        ty::ParamEnv::new(tcx.mk_clauses_from_iter(caller_bounds), param_env.reveal())
     };
 
     // Receiver: DispatchFromDyn<Receiver[Self => U]>
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index a35dd1f1a59..98f45826727 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -483,8 +483,7 @@ impl<'a, 'b, 'tcx> AssocTypeNormalizer<'a, 'b, 'tcx> {
 
         assert!(
             !value.has_escaping_bound_vars(),
-            "Normalizing {:?} without wrapping in a `Binder`",
-            value
+            "Normalizing {value:?} without wrapping in a `Binder`"
         );
 
         if !needs_normalization(&value, self.param_env.reveal()) {
@@ -1932,7 +1931,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
                 // These traits have no associated types.
                 selcx.tcx().sess.delay_span_bug(
                     obligation.cause.span,
-                    format!("Cannot project an associated type from `{:?}`", impl_source),
+                    format!("Cannot project an associated type from `{impl_source:?}`"),
                 );
                 return Err(());
             }
@@ -2303,8 +2302,7 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
         }
         Err(e) => {
             let msg = format!(
-                "Failed to unify obligation `{:?}` with poly_projection `{:?}`: {:?}",
-                obligation, poly_cache_entry, e,
+                "Failed to unify obligation `{obligation:?}` with poly_projection `{poly_cache_entry:?}`: {e:?}",
             );
             debug!("confirm_param_env_candidate: {}", msg);
             let err = Ty::new_error_with_message(infcx.tcx, obligation.cause.span, msg);
diff --git a/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs b/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs
index a50644bb709..65f32b1c48a 100644
--- a/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs
@@ -1,5 +1,4 @@
 use rustc_infer::traits::{TraitEngine, TraitEngineExt};
-use rustc_middle::ty;
 
 use crate::infer::canonical::OriginalQueryValues;
 use crate::infer::InferCtxt;
@@ -66,17 +65,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
     ) -> Result<EvaluationResult, OverflowError> {
         let mut _orig_values = OriginalQueryValues::default();
 
-        let param_env = match obligation.predicate.kind().skip_binder() {
-            ty::PredicateKind::Clause(ty::ClauseKind::Trait(pred)) => {
-                // we ignore the value set to it.
-                let mut _constness = pred.constness;
-                obligation
-                    .param_env
-                    .with_constness(_constness.and(obligation.param_env.constness()))
-            }
-            // constness has no effect on the given predicate.
-            _ => obligation.param_env.without_const(),
-        };
+        let param_env = obligation.param_env;
 
         if self.next_trait_solver() {
             self.probe(|snapshot| {
diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
index d45cf94f731..87beaddc6c2 100644
--- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
@@ -299,7 +299,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx>
                     if !tcx.sess.opts.actually_rustdoc {
                         tcx.sess.delay_span_bug(
                             DUMMY_SP,
-                            format!("unexpected ambiguity: {:?} {:?}", c_data, result),
+                            format!("unexpected ambiguity: {c_data:?} {result:?}"),
                         );
                     }
                     return Err(NoSolution);
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs
index 420d6326553..302b6016e5e 100644
--- a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs
@@ -82,7 +82,6 @@ fn relate_mir_and_user_args<'tcx>(
     def_id: DefId,
     user_args: UserArgs<'tcx>,
 ) -> Result<(), NoSolution> {
-    let param_env = param_env.without_const();
     let UserArgs { user_self_ty, args } = user_args;
     let tcx = ocx.infcx.tcx;
     let cause = ObligationCause::dummy_with_span(span);
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs
index 5420caee329..c99e018e9ae 100644
--- a/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs
@@ -77,8 +77,7 @@ where
     let pre_obligations = infcx.take_registered_region_obligations();
     assert!(
         pre_obligations.is_empty(),
-        "scrape_region_constraints: incoming region obligations = {:#?}",
-        pre_obligations,
+        "scrape_region_constraints: incoming region obligations = {pre_obligations:#?}",
     );
 
     let value = infcx.commit_if_ok(|_| {
@@ -92,7 +91,7 @@ where
         } else {
             Err(infcx.tcx.sess.delay_span_bug(
                 DUMMY_SP,
-                format!("errors selecting obligation during MIR typeck: {:?}", errors),
+                format!("errors selecting obligation during MIR typeck: {errors:?}"),
             ))
         }
     })?;
diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
index aa195d70a9f..b9f31be25b1 100644
--- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
@@ -124,11 +124,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
 
             self.assemble_candidates_from_projected_tys(obligation, &mut candidates);
             self.assemble_candidates_from_caller_bounds(stack, &mut candidates)?;
-            // Auto implementations have lower priority, so we only
-            // consider triggering a default if there is no other impl that can apply.
-            if candidates.vec.is_empty() {
-                self.assemble_candidates_from_auto_impls(obligation, &mut candidates);
-            }
+            self.assemble_candidates_from_auto_impls(obligation, &mut candidates);
         }
         debug!("candidate list size: {}", candidates.vec.len());
         Ok(candidates)
@@ -513,7 +509,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
                     // for an example of a test case that exercises
                     // this path.
                 }
-                ty::Infer(ty::TyVar(_)) => {
+                ty::Infer(ty::TyVar(_) | ty::IntVar(_) | ty::FloatVar(_)) => {
                     // The auto impl might apply; we don't know.
                     candidates.ambiguous = true;
                 }
@@ -533,7 +529,63 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
                     }
                 }
 
-                _ => candidates.vec.push(AutoImplCandidate),
+                ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
+                    bug!(
+                        "asked to assemble auto trait candidates of unexpected type: {:?}",
+                        self_ty
+                    );
+                }
+
+                ty::Alias(_, _)
+                    if candidates.vec.iter().any(|c| matches!(c, ProjectionCandidate(..))) =>
+                {
+                    // We do not generate an auto impl candidate for `impl Trait`s which already
+                    // reference our auto trait.
+                    //
+                    // For example during candidate assembly for `impl Send: Send`, we don't have
+                    // to look at the constituent types for this opaque types to figure out that this
+                    // trivially holds.
+                    //
+                    // Note that this is only sound as projection candidates of opaque types
+                    // are always applicable for auto traits.
+                }
+                ty::Alias(_, _) => candidates.vec.push(AutoImplCandidate),
+
+                ty::Bool
+                | ty::Char
+                | ty::Int(_)
+                | ty::Uint(_)
+                | ty::Float(_)
+                | ty::Str
+                | ty::Array(_, _)
+                | ty::Slice(_)
+                | ty::Adt(..)
+                | ty::RawPtr(_)
+                | ty::Ref(..)
+                | ty::FnDef(..)
+                | ty::FnPtr(_)
+                | ty::Closure(_, _)
+                | ty::Generator(..)
+                | ty::Never
+                | ty::Tuple(_)
+                | ty::GeneratorWitness(_)
+                | ty::GeneratorWitnessMIR(..) => {
+                    // Only consider auto impls if there are no manual impls for the root of `self_ty`.
+                    //
+                    // For example, we only consider auto candidates for `&i32: Auto` if no explicit impl
+                    // for `&SomeType: Auto` exists. Due to E0321 the only crate where impls
+                    // for `&SomeType: Auto` can be defined is the crate where `Auto` has been defined.
+                    //
+                    // Generally, we have to guarantee that for all `SimplifiedType`s the only crate
+                    // which may define impls for that type is either the crate defining the type
+                    // or the trait. This should be guaranteed by the orphan check.
+                    let mut has_impl = false;
+                    self.tcx().for_each_relevant_impl(def_id, self_ty, |_| has_impl = true);
+                    if !has_impl {
+                        candidates.vec.push(AutoImplCandidate)
+                    }
+                }
+                ty::Error(_) => {} // do not add an auto trait impl for `ty::Error` for now.
             }
         }
     }
@@ -839,7 +891,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     ) {
         // If the predicate is `~const Destruct` in a non-const environment, we don't actually need
         // to check anything. We'll short-circuit checking any obligations in confirmation, too.
-        if !obligation.is_const() {
+        // FIXME(effects)
+        if true {
             candidates.vec.push(ConstDestructCandidate(None));
             return;
         }
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 92b9364adfa..7140fedb74a 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -13,8 +13,8 @@ use rustc_infer::infer::LateBoundRegionConversionTime::HigherRankedType;
 use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
 use rustc_middle::traits::{BuiltinImplSource, SelectionOutputTypeParameterMismatch};
 use rustc_middle::ty::{
-    self, Binder, GenericArgs, GenericArgsRef, GenericParamDefKind, ToPolyTraitRef, ToPredicate,
-    TraitPredicate, TraitRef, Ty, TyCtxt, TypeVisitableExt,
+    self, GenericArgs, GenericArgsRef, GenericParamDefKind, ToPolyTraitRef, ToPredicate,
+    TraitPredicate, Ty, TyCtxt, TypeVisitableExt,
 };
 use rustc_span::def_id::DefId;
 
@@ -647,7 +647,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     fn confirm_fn_pointer_candidate(
         &mut self,
         obligation: &PolyTraitObligation<'tcx>,
-        is_const: bool,
+        // FIXME(effects)
+        _is_const: bool,
     ) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
         debug!(?obligation, "confirm_fn_pointer_candidate");
 
@@ -674,16 +675,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         let mut nested = self.confirm_poly_trait_refs(obligation, trait_ref)?;
         let cause = obligation.derived_cause(BuiltinDerivedObligation);
 
-        if obligation.is_const() && !is_const {
-            // function is a trait method
-            if let ty::FnDef(def_id, args) = self_ty.kind() && let Some(trait_id) = tcx.trait_of_item(*def_id) {
-                let trait_ref = TraitRef::from_method(tcx, trait_id, *args);
-                let poly_trait_pred = Binder::dummy(trait_ref).with_constness(ty::BoundConstness::ConstIfConst);
-                let obligation = Obligation::new(tcx, cause.clone(), obligation.param_env, poly_trait_pred);
-                nested.push(obligation);
-            }
-        }
-
         // Confirm the `type Output: Sized;` bound that is present on `FnOnce`
         let output_ty = self.infcx.instantiate_binder_with_placeholders(sig.output());
         let output_ty = normalize_with_depth_to(
@@ -1211,7 +1202,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         impl_def_id: Option<DefId>,
     ) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
         // `~const Destruct` in a non-const environment is always trivially true, since our type is `Drop`
-        if !obligation.is_const() {
+        // FIXME(effects)
+        if true {
             return Ok(vec![]);
         }
 
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index e086489b1bc..c29696bc817 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -74,22 +74,21 @@ impl IntercrateAmbiguityCause {
         match self {
             IntercrateAmbiguityCause::DownstreamCrate { trait_desc, self_desc } => {
                 let self_desc = if let Some(ty) = self_desc {
-                    format!(" for type `{}`", ty)
+                    format!(" for type `{ty}`")
                 } else {
                     String::new()
                 };
-                format!("downstream crates may implement trait `{}`{}", trait_desc, self_desc)
+                format!("downstream crates may implement trait `{trait_desc}`{self_desc}")
             }
             IntercrateAmbiguityCause::UpstreamCrateUpdate { trait_desc, self_desc } => {
                 let self_desc = if let Some(ty) = self_desc {
-                    format!(" for type `{}`", ty)
+                    format!(" for type `{ty}`")
                 } else {
                     String::new()
                 };
                 format!(
-                    "upstream crates may add a new impl of trait `{}`{} \
-                     in future versions",
-                    trait_desc, self_desc
+                    "upstream crates may add a new impl of trait `{trait_desc}`{self_desc} \
+                     in future versions"
                 )
             }
             IntercrateAmbiguityCause::ReservationImpl { message } => message.clone(),
@@ -1000,13 +999,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         }
 
         let stack = self.push_stack(previous_stack, &obligation);
-        let mut fresh_trait_pred = stack.fresh_trait_pred;
-        let mut param_env = obligation.param_env;
-
-        fresh_trait_pred = fresh_trait_pred.map_bound(|mut pred| {
-            pred.remap_constness(&mut param_env);
-            pred
-        });
+        let fresh_trait_pred = stack.fresh_trait_pred;
+        let param_env = obligation.param_env;
 
         debug!(?fresh_trait_pred);
 
@@ -1386,8 +1380,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         (result, dep_node)
     }
 
-    /// filter_impls filters constant trait obligations and candidates that have a positive impl
-    /// for a negative goal and a negative impl for a positive goal
+    /// filter_impls filters candidates that have a positive impl for a negative
+    /// goal and a negative impl for a positive goal
     #[instrument(level = "debug", skip(self, candidates))]
     fn filter_impls(
         &mut self,
@@ -1399,42 +1393,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         let mut result = Vec::with_capacity(candidates.len());
 
         for candidate in candidates {
-            // Respect const trait obligations
-            if obligation.is_const() {
-                match candidate {
-                    // const impl
-                    ImplCandidate(def_id) if tcx.constness(def_id) == hir::Constness::Const => {}
-                    // const param
-                    ParamCandidate(trait_pred) if trait_pred.is_const_if_const() => {}
-                    // const projection
-                    ProjectionCandidate(_, ty::BoundConstness::ConstIfConst)
-                    // auto trait impl
-                    | AutoImplCandidate
-                    // generator / future, this will raise error in other places
-                    // or ignore error with const_async_blocks feature
-                    | GeneratorCandidate
-                    | FutureCandidate
-                    // FnDef where the function is const
-                    | FnPointerCandidate { is_const: true }
-                    | ConstDestructCandidate(_)
-                    | ClosureCandidate { is_const: true } => {}
-
-                    FnPointerCandidate { is_const: false } => {
-                        if let ty::FnDef(def_id, _) = obligation.self_ty().skip_binder().kind() && tcx.trait_of_item(*def_id).is_some() {
-                            // Trait methods are not seen as const unless the trait is implemented as const.
-                            // We do not filter that out in here, but nested obligations will be needed to confirm this.
-                        } else {
-                            continue
-                        }
-                    }
-
-                    _ => {
-                        // reject all other types of candidates
-                        continue;
-                    }
-                }
-            }
-
             if let ImplCandidate(def_id) = candidate {
                 if ty::ImplPolarity::Reservation == tcx.impl_polarity(def_id)
                     || obligation.polarity() == tcx.impl_polarity(def_id)
@@ -1487,7 +1445,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> {
         debug!("is_knowable(intercrate={:?})", self.is_intercrate());
 
-        if !self.is_intercrate() || stack.obligation.polarity() == ty::ImplPolarity::Negative {
+        if !self.is_intercrate() {
             return Ok(());
         }
 
@@ -1528,7 +1486,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
 
     fn check_candidate_cache(
         &mut self,
-        mut param_env: ty::ParamEnv<'tcx>,
+        param_env: ty::ParamEnv<'tcx>,
         cache_fresh_trait_pred: ty::PolyTraitPredicate<'tcx>,
     ) -> Option<SelectionResult<'tcx, SelectionCandidate<'tcx>>> {
         // Neither the global nor local cache is aware of intercrate
@@ -1539,8 +1497,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
             return None;
         }
         let tcx = self.tcx();
-        let mut pred = cache_fresh_trait_pred.skip_binder();
-        pred.remap_constness(&mut param_env);
+        let pred = cache_fresh_trait_pred.skip_binder();
 
         if self.can_use_global_caches(param_env) {
             if let Some(res) = tcx.selection_cache.get(&(param_env, pred), tcx) {
@@ -1586,15 +1543,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     #[instrument(skip(self, param_env, cache_fresh_trait_pred, dep_node), level = "debug")]
     fn insert_candidate_cache(
         &mut self,
-        mut param_env: ty::ParamEnv<'tcx>,
+        param_env: ty::ParamEnv<'tcx>,
         cache_fresh_trait_pred: ty::PolyTraitPredicate<'tcx>,
         dep_node: DepNodeIndex,
         candidate: SelectionResult<'tcx, SelectionCandidate<'tcx>>,
     ) {
         let tcx = self.tcx();
-        let mut pred = cache_fresh_trait_pred.skip_binder();
-
-        pred.remap_constness(&mut param_env);
+        let pred = cache_fresh_trait_pred.skip_binder();
 
         if !self.can_cache_candidate(&candidate) {
             debug!(?pred, ?candidate, "insert_candidate_cache - candidate is not cacheable");
@@ -1827,6 +1782,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
     /// candidates and prefer where-clause candidates.
     ///
     /// See the comment for "SelectionCandidate" for more details.
+    #[instrument(level = "debug", skip(self))]
     fn candidate_should_be_dropped_in_favor_of(
         &mut self,
         victim: &EvaluatedCandidate<'tcx>,
@@ -1850,13 +1806,6 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
         // This is a fix for #53123 and prevents winnowing from accidentally extending the
         // lifetime of a variable.
         match (&other.candidate, &victim.candidate) {
-            (_, AutoImplCandidate) | (AutoImplCandidate, _) => {
-                bug!(
-                    "default implementations shouldn't be recorded \
-                    when there are other valid candidates"
-                );
-            }
-
             // FIXME(@jswrenn): this should probably be more sophisticated
             (TransmutabilityCandidate, _) | (_, TransmutabilityCandidate) => DropVictim::No,
 
@@ -1898,6 +1847,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
             (
                 ParamCandidate(ref other_cand),
                 ImplCandidate(..)
+                | AutoImplCandidate
                 | ClosureCandidate { .. }
                 | GeneratorCandidate
                 | FutureCandidate
@@ -1925,6 +1875,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
             }
             (
                 ImplCandidate(_)
+                | AutoImplCandidate
                 | ClosureCandidate { .. }
                 | GeneratorCandidate
                 | FutureCandidate
@@ -1958,6 +1909,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
             (
                 ObjectCandidate(_) | ProjectionCandidate(..),
                 ImplCandidate(..)
+                | AutoImplCandidate
                 | ClosureCandidate { .. }
                 | GeneratorCandidate
                 | FutureCandidate
@@ -1971,6 +1923,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
 
             (
                 ImplCandidate(..)
+                | AutoImplCandidate
                 | ClosureCandidate { .. }
                 | GeneratorCandidate
                 | FutureCandidate
@@ -2061,6 +2014,19 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
                 }
             }
 
+            (AutoImplCandidate, ImplCandidate(_)) | (ImplCandidate(_), AutoImplCandidate) => {
+                DropVictim::No
+            }
+
+            (AutoImplCandidate, _) | (_, AutoImplCandidate) => {
+                bug!(
+                    "default implementations shouldn't be recorded \
+                    when there are other global candidates: {:?} {:?}",
+                    other,
+                    victim
+                );
+            }
+
             // Everything else is ambiguous
             (
                 ImplCandidate(_)
@@ -2443,8 +2409,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
                 let guar = self.infcx.tcx.sess.delay_span_bug(
                     obligation.cause.span,
                     format!(
-                        "Impl {:?} was matchable against {:?} but now is not",
-                        impl_def_id, obligation
+                        "Impl {impl_def_id:?} was matchable against {obligation:?} but now is not"
                     ),
                 );
                 let value = self.infcx.fresh_args_for_item(obligation.cause.span, impl_def_id);
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
index b61b209654c..61e631c438d 100644
--- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
@@ -388,16 +388,16 @@ fn report_conflicting_impls<'tcx>(
                     impl_span,
                     format!(
                         "conflicting implementation{}",
-                        overlap.self_ty.map_or_else(String::new, |ty| format!(" for `{}`", ty))
+                        overlap.self_ty.map_or_else(String::new, |ty| format!(" for `{ty}`"))
                     ),
                 );
             }
             Err(cname) => {
                 let msg = match to_pretty_impl_header(tcx, overlap.with_impl) {
                     Some(s) => {
-                        format!("conflicting implementation in crate `{}`:\n- {}", cname, s)
+                        format!("conflicting implementation in crate `{cname}`:\n- {s}")
                     }
-                    None => format!("conflicting implementation in crate `{}`", cname),
+                    None => format!("conflicting implementation in crate `{cname}`"),
                 };
                 err.note(msg);
             }
@@ -514,8 +514,7 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
         pretty_predicates.push(p.to_string());
     }
 
-    pretty_predicates
-        .extend(types_without_default_bounds.iter().map(|ty| format!("{}: ?Sized", ty)));
+    pretty_predicates.extend(types_without_default_bounds.iter().map(|ty| format!("{ty}: ?Sized")));
 
     if !pretty_predicates.is_empty() {
         write!(w, "\n  where {}", pretty_predicates.join(", ")).unwrap();
diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs
index 3eab885a089..4c27fe8b29b 100644
--- a/compiler/rustc_trait_selection/src/traits/util.rs
+++ b/compiler/rustc_trait_selection/src/traits/util.rs
@@ -50,7 +50,7 @@ impl<'tcx> TraitAliasExpansionInfo<'tcx> {
         diag.span_label(self.top().1, top_label);
         if self.path.len() > 1 {
             for (_, sp) in self.path.iter().rev().skip(1).take(self.path.len() - 2) {
-                diag.span_label(*sp, format!("referenced here ({})", use_desc));
+                diag.span_label(*sp, format!("referenced here ({use_desc})"));
             }
         }
         if self.top().1 != self.bottom().1 {
@@ -58,7 +58,7 @@ impl<'tcx> TraitAliasExpansionInfo<'tcx> {
             // redundant labels.
             diag.span_label(
                 self.bottom().1,
-                format!("trait alias used in trait object type ({})", use_desc),
+                format!("trait alias used in trait object type ({use_desc})"),
             );
         }
     }
diff --git a/compiler/rustc_trait_selection/src/traits/vtable.rs b/compiler/rustc_trait_selection/src/traits/vtable.rs
index c4cc89aa907..3964dda1fdb 100644
--- a/compiler/rustc_trait_selection/src/traits/vtable.rs
+++ b/compiler/rustc_trait_selection/src/traits/vtable.rs
@@ -195,11 +195,7 @@ fn dump_vtable_entries<'tcx>(
     trait_ref: ty::PolyTraitRef<'tcx>,
     entries: &[VtblEntry<'tcx>],
 ) {
-    tcx.sess.emit_err(DumpVTableEntries {
-        span: sp,
-        trait_ref,
-        entries: format!("{:#?}", entries),
-    });
+    tcx.sess.emit_err(DumpVTableEntries { span: sp, trait_ref, entries: format!("{entries:#?}") });
 }
 
 fn has_own_existential_vtable_entries(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs
index 8bd26818256..e8ddb0a4396 100644
--- a/compiler/rustc_transmute/src/layout/tree.rs
+++ b/compiler/rustc_transmute/src/layout/tree.rs
@@ -195,7 +195,7 @@ pub(crate) mod rustc {
     impl<'tcx> From<&LayoutError<'tcx>> for Err {
         fn from(err: &LayoutError<'tcx>) -> Self {
             match err {
-                LayoutError::Unknown(..) => Self::UnknownLayout,
+                LayoutError::Unknown(..) | LayoutError::ReferencesError(..) => Self::UnknownLayout,
                 err => unimplemented!("{:?}", err),
             }
         }
diff --git a/compiler/rustc_ty_utils/src/assoc.rs b/compiler/rustc_ty_utils/src/assoc.rs
index 4a544232174..780f7ea426f 100644
--- a/compiler/rustc_ty_utils/src/assoc.rs
+++ b/compiler/rustc_ty_utils/src/assoc.rs
@@ -346,8 +346,16 @@ fn associated_type_for_impl_trait_in_impl(
 ) -> LocalDefId {
     let impl_local_def_id = tcx.local_parent(impl_fn_def_id);
 
-    // FIXME fix the span, we probably want the def_id of the return type of the function
-    let span = tcx.def_span(impl_fn_def_id);
+    let decl = tcx
+        .hir()
+        .find_by_def_id(impl_fn_def_id)
+        .expect("expected item")
+        .fn_decl()
+        .expect("expected decl");
+    let span = match decl.output {
+        hir::FnRetTy::DefaultReturn(_) => tcx.def_span(impl_fn_def_id),
+        hir::FnRetTy::Return(ty) => ty.span,
+    };
     let impl_assoc_ty = tcx.at(span).create_def(impl_local_def_id, DefPathData::ImplTraitAssocTy);
 
     let local_def_id = impl_assoc_ty.def_id();
diff --git a/compiler/rustc_ty_utils/src/implied_bounds.rs b/compiler/rustc_ty_utils/src/implied_bounds.rs
index fa1976510cf..7eb1042d2f8 100644
--- a/compiler/rustc_ty_utils/src/implied_bounds.rs
+++ b/compiler/rustc_ty_utils/src/implied_bounds.rs
@@ -1,13 +1,22 @@
+use rustc_data_structures::fx::FxHashMap;
 use rustc_hir as hir;
 use rustc_hir::def::DefKind;
 use rustc_hir::def_id::LocalDefId;
+use rustc_middle::middle::resolve_bound_vars as rbv;
 use rustc_middle::query::Providers;
 use rustc_middle::ty::{self, Ty, TyCtxt};
 use rustc_span::Span;
 use std::iter;
 
 pub fn provide(providers: &mut Providers) {
-    *providers = Providers { assumed_wf_types, ..*providers };
+    *providers = Providers {
+        assumed_wf_types,
+        assumed_wf_types_for_rpitit: |tcx, def_id| {
+            assert!(tcx.is_impl_trait_in_trait(def_id.to_def_id()));
+            tcx.assumed_wf_types(def_id)
+        },
+        ..*providers
+    };
 }
 
 fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<'tcx>, Span)] {
@@ -42,6 +51,81 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<'
             let mut impl_spans = impl_spans(tcx, def_id);
             tcx.arena.alloc_from_iter(tys.into_iter().map(|ty| (ty, impl_spans.next().unwrap())))
         }
+        DefKind::AssocTy if let Some(data) = tcx.opt_rpitit_info(def_id.to_def_id()) => match data {
+            ty::ImplTraitInTraitData::Trait { fn_def_id, opaque_def_id } => {
+                let hir::OpaqueTy { lifetime_mapping, .. } =
+                    *tcx.hir().expect_item(opaque_def_id.expect_local()).expect_opaque_ty();
+                // We need to remap all of the late-bound lifetimes in theassumed wf types
+                // of the fn (which are represented as ReFree) to the early-bound lifetimes
+                // of the RPITIT (which are represented by ReEarlyBound owned by the opaque).
+                // Luckily, this is very easy to do because we already have that mapping
+                // stored in the HIR of this RPITIT.
+                //
+                // Side-note: We don't really need to do this remapping for early-bound
+                // lifetimes because they're already "linked" by the bidirectional outlives
+                // predicates we insert in the `explicit_predicates_of` query for RPITITs.
+                let mut mapping = FxHashMap::default();
+                let generics = tcx.generics_of(def_id);
+                for &(lifetime, new_early_bound_def_id) in
+                    lifetime_mapping.expect("expected lifetime mapping for RPITIT")
+                {
+                    if let Some(rbv::ResolvedArg::LateBound(_, _, def_id)) =
+                        tcx.named_bound_var(lifetime.hir_id)
+                    {
+                        let name = tcx.hir().name(lifetime.hir_id);
+                        let index = generics
+                            .param_def_id_to_index(tcx, new_early_bound_def_id.to_def_id())
+                            .unwrap();
+                        mapping.insert(
+                            ty::Region::new_free(
+                                tcx,
+                                fn_def_id,
+                                ty::BoundRegionKind::BrNamed(def_id, name),
+                            ),
+                            ty::Region::new_early_bound(
+                                tcx,
+                                ty::EarlyBoundRegion {
+                                    def_id: new_early_bound_def_id.to_def_id(),
+                                    index,
+                                    name,
+                                },
+                            ),
+                        );
+                    }
+                }
+                // FIXME: This could use a real folder, I guess.
+                let remapped_wf_tys = tcx.fold_regions(
+                    tcx.assumed_wf_types(fn_def_id.expect_local()).to_vec(),
+                    |region, _| {
+                        // If `region` is a `ReFree` that is captured by the
+                        // opaque, remap it to its corresponding the early-
+                        // bound region.
+                        if let Some(remapped_region) = mapping.get(&region) {
+                            *remapped_region
+                        } else {
+                            region
+                        }
+                    },
+                );
+                tcx.arena.alloc_from_iter(remapped_wf_tys)
+            }
+            // Assumed wf types for RPITITs in an impl just inherit (and instantiate)
+            // the assumed wf types of the trait's RPITIT GAT.
+            ty::ImplTraitInTraitData::Impl { .. } => {
+                let impl_def_id = tcx.local_parent(def_id);
+                let rpitit_def_id = tcx.associated_item(def_id).trait_item_def_id.unwrap();
+                let args = ty::GenericArgs::identity_for_item(tcx, def_id).rebase_onto(
+                    tcx,
+                    impl_def_id.to_def_id(),
+                    tcx.impl_trait_ref(impl_def_id).unwrap().instantiate_identity().args,
+                );
+                tcx.arena.alloc_from_iter(
+                    ty::EarlyBinder::bind(tcx.assumed_wf_types_for_rpitit(rpitit_def_id))
+                        .iter_instantiated_copied(tcx, args)
+                        .chain(tcx.assumed_wf_types(impl_def_id).into_iter().copied()),
+                )
+            }
+        },
         DefKind::AssocConst | DefKind::AssocTy => tcx.assumed_wf_types(tcx.local_parent(def_id)),
         DefKind::OpaqueTy => match tcx.def_kind(tcx.local_parent(def_id)) {
             DefKind::TyAlias => ty::List::empty(),
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index b840ff184e0..3500c2cc370 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -96,6 +96,13 @@ fn layout_of_uncached<'tcx>(
     cx: &LayoutCx<'tcx, TyCtxt<'tcx>>,
     ty: Ty<'tcx>,
 ) -> Result<Layout<'tcx>, &'tcx LayoutError<'tcx>> {
+    // Types that reference `ty::Error` pessimistically don't have a meaningful layout.
+    // The only side-effect of this is possibly worse diagnostics in case the layout
+    // was actually computable (like if the `ty::Error` showed up only in a `PhantomData`).
+    if let Err(guar) = ty.error_reported() {
+        return Err(error(cx, LayoutError::ReferencesError(guar)));
+    }
+
     let tcx = cx.tcx;
     let param_env = cx.param_env;
     let dl = cx.data_layout();
@@ -564,11 +571,15 @@ fn layout_of_uncached<'tcx>(
             return Err(error(cx, LayoutError::Unknown(ty)));
         }
 
-        ty::Bound(..) | ty::GeneratorWitness(..) | ty::GeneratorWitnessMIR(..) | ty::Infer(_) => {
+        ty::Bound(..)
+        | ty::GeneratorWitness(..)
+        | ty::GeneratorWitnessMIR(..)
+        | ty::Infer(_)
+        | ty::Error(_) => {
             bug!("Layout::compute: unexpected type `{}`", ty)
         }
 
-        ty::Placeholder(..) | ty::Param(_) | ty::Error(_) => {
+        ty::Placeholder(..) | ty::Param(_) => {
             return Err(error(cx, LayoutError::Unknown(ty)));
         }
     })
diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs
index 55b8857ed39..147b600f7ba 100644
--- a/compiler/rustc_ty_utils/src/lib.rs
+++ b/compiler/rustc_ty_utils/src/lib.rs
@@ -8,6 +8,7 @@
 #![feature(assert_matches)]
 #![feature(iterator_try_collect)]
 #![feature(let_chains)]
+#![feature(if_let_guard)]
 #![feature(never_type)]
 #![feature(box_patterns)]
 #![recursion_limit = "256"]
diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs
index e173bba49be..f89558a4599 100644
--- a/compiler/rustc_ty_utils/src/needs_drop.rs
+++ b/compiler/rustc_ty_utils/src/needs_drop.rs
@@ -133,7 +133,7 @@ where
                             _ => {
                                 tcx.sess.delay_span_bug(
                                     tcx.hir().span_if_local(def_id).unwrap_or(DUMMY_SP),
-                                    format!("unexpected generator witness type {:?}", witness),
+                                    format!("unexpected generator witness type {witness:?}"),
                                 );
                                 return Some(Err(AlwaysRequiresDrop));
                             }
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index 505f78d0e5f..791a1f4fa99 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -129,7 +129,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
     // sure that this will succeed without errors anyway.
 
     if tcx.def_kind(def_id) == DefKind::AssocFn
-        && tcx.associated_item(def_id).container == ty::AssocItemContainer::TraitContainer
+        && let assoc_item = tcx.associated_item(def_id)
+        && assoc_item.container == ty::AssocItemContainer::TraitContainer
+        && assoc_item.defaultness(tcx).has_value()
     {
         let sig = tcx.fn_sig(def_id).instantiate_identity();
         // We accounted for the binder of the fn sig, so skip the binder.
@@ -144,85 +146,9 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
     }
 
     let local_did = def_id.as_local();
-    // FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty): This isn't correct for
-    // RPITITs in const trait fn.
-    let hir_id = local_did.and_then(|def_id| tcx.opt_local_def_id_to_hir_id(def_id));
-
-    // FIXME(consts): This is not exactly in line with the constness query.
-    let constness = match hir_id {
-        Some(hir_id) => match tcx.hir().get(hir_id) {
-            hir::Node::TraitItem(hir::TraitItem { kind: hir::TraitItemKind::Fn(..), .. })
-                if tcx.is_const_default_method(def_id) =>
-            {
-                hir::Constness::Const
-            }
-
-            hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(..), .. })
-            | hir::Node::Item(hir::Item { kind: hir::ItemKind::Static(..), .. })
-            | hir::Node::TraitItem(hir::TraitItem {
-                kind: hir::TraitItemKind::Const(..), ..
-            })
-            | hir::Node::AnonConst(_)
-            | hir::Node::ConstBlock(_)
-            | hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Const(..), .. })
-            | hir::Node::ImplItem(hir::ImplItem {
-                kind:
-                    hir::ImplItemKind::Fn(
-                        hir::FnSig {
-                            header: hir::FnHeader { constness: hir::Constness::Const, .. },
-                            ..
-                        },
-                        ..,
-                    ),
-                ..
-            }) => hir::Constness::Const,
-
-            hir::Node::ImplItem(hir::ImplItem {
-                kind: hir::ImplItemKind::Type(..) | hir::ImplItemKind::Fn(..),
-                ..
-            }) => {
-                let parent_hir_id = tcx.hir().parent_id(hir_id);
-                match tcx.hir().get(parent_hir_id) {
-                    hir::Node::Item(hir::Item {
-                        kind: hir::ItemKind::Impl(hir::Impl { constness, .. }),
-                        ..
-                    }) => *constness,
-                    _ => span_bug!(
-                        tcx.def_span(parent_hir_id.owner),
-                        "impl item's parent node is not an impl",
-                    ),
-                }
-            }
-
-            hir::Node::Item(hir::Item {
-                kind:
-                    hir::ItemKind::Fn(hir::FnSig { header: hir::FnHeader { constness, .. }, .. }, ..),
-                ..
-            })
-            | hir::Node::TraitItem(hir::TraitItem {
-                kind:
-                    hir::TraitItemKind::Fn(
-                        hir::FnSig { header: hir::FnHeader { constness, .. }, .. },
-                        ..,
-                    ),
-                ..
-            })
-            | hir::Node::Item(hir::Item {
-                kind: hir::ItemKind::Impl(hir::Impl { constness, .. }),
-                ..
-            }) => *constness,
-
-            _ => hir::Constness::NotConst,
-        },
-        // FIXME(consts): It's suspicious that a param-env for a foreign item
-        // will always have NotConst param-env, though we don't typically use
-        // that param-env for anything meaningful right now, so it's likely
-        // not an issue.
-        None => hir::Constness::NotConst,
-    };
 
     let unnormalized_env =
-        ty::ParamEnv::new(tcx.mk_clauses(&predicates), traits::Reveal::UserFacing, constness);
+        ty::ParamEnv::new(tcx.mk_clauses(&predicates), traits::Reveal::UserFacing);
 
     let body_id = local_did.unwrap_or(CRATE_DEF_ID);
     let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id);
@@ -255,8 +181,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
 
     fn visit_ty(&mut self, ty: Ty<'tcx>) -> std::ops::ControlFlow<Self::BreakTy> {
         if let ty::Alias(ty::Projection, unshifted_alias_ty) = *ty.kind()
-            && self.tcx.is_impl_trait_in_trait(unshifted_alias_ty.def_id)
-            && self.tcx.impl_trait_in_trait_parent_fn(unshifted_alias_ty.def_id) == self.fn_def_id
+            && let Some(ty::ImplTraitInTraitData::Trait { fn_def_id, .. }
+                    | ty::ImplTraitInTraitData::Impl { fn_def_id, .. })
+                = self.tcx.opt_rpitit_info(unshifted_alias_ty.def_id)
+            && fn_def_id == self.fn_def_id
             && self.seen.insert(unshifted_alias_ty.def_id)
         {
             // We have entered some binders as we've walked into the
diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs
index a7cd7aa2c4f..c2655d68b79 100644
--- a/compiler/rustc_type_ir/src/lib.rs
+++ b/compiler/rustc_type_ir/src/lib.rs
@@ -408,7 +408,7 @@ pub fn debug_bound_var<T: std::fmt::Write>(
     var: impl std::fmt::Debug,
 ) -> Result<(), std::fmt::Error> {
     if debruijn == INNERMOST {
-        write!(fmt, "^{:?}", var)
+        write!(fmt, "^{var:?}")
     } else {
         write!(fmt, "^{}_{:?}", debruijn.index(), var)
     }
diff --git a/config.example.toml b/config.example.toml
index 367f95b156f..b10922f8d04 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -690,10 +690,6 @@ changelog-seen = 2
 # Build compiler with the optimization enabled and -Zvalidate-mir, currently only for `std`
 #validate-mir-opts = 3
 
-# Copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain.
-# Only applies when the host or target is pc-windows-gnu.
-#include-mingw-linker = true
-
 # =============================================================================
 # Options for specific targets
 #
@@ -844,3 +840,7 @@ changelog-seen = 2
 #
 # Available options: fast, balanced, best
 #compression-profile = "fast"
+
+# Copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain.
+# Only applies when the host or target is pc-windows-gnu.
+#include-mingw-linker = true
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs
index ff908ec12ec..5481b327d69 100644
--- a/library/alloc/src/collections/btree/map.rs
+++ b/library/alloc/src/collections/btree/map.rs
@@ -613,8 +613,6 @@ impl<K, V> BTreeMap<K, V> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -636,8 +634,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -661,8 +657,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// # #![feature(allocator_api)]
     /// # #![feature(btreemap_alloc)]
@@ -688,8 +682,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -744,8 +736,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -830,8 +820,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -917,8 +905,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -943,8 +929,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -982,8 +966,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -1017,8 +999,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// #![feature(map_try_insert)]
     ///
@@ -1051,8 +1031,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -1078,8 +1056,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -1208,8 +1184,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     /// use std::ops::Bound::Included;
@@ -1251,8 +1225,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -1283,8 +1255,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -1336,8 +1306,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2388,8 +2356,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2420,8 +2386,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2453,8 +2417,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2474,8 +2436,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2495,8 +2455,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2521,8 +2479,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2546,8 +2502,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// use std::collections::BTreeMap;
     ///
@@ -2578,8 +2532,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// #![feature(btree_cursors)]
     ///
@@ -2591,6 +2543,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     /// a.insert(2, "b");
     /// a.insert(3, "c");
     /// a.insert(4, "c");
+    /// let cursor = a.lower_bound(Bound::Included(&2));
+    /// assert_eq!(cursor.key(), Some(&2));
     /// let cursor = a.lower_bound(Bound::Excluded(&2));
     /// assert_eq!(cursor.key(), Some(&3));
     /// ```
@@ -2619,8 +2573,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// #![feature(btree_cursors)]
     ///
@@ -2632,6 +2584,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     /// a.insert(2, "b");
     /// a.insert(3, "c");
     /// a.insert(4, "c");
+    /// let cursor = a.lower_bound_mut(Bound::Included(&2));
+    /// assert_eq!(cursor.key(), Some(&2));
     /// let cursor = a.lower_bound_mut(Bound::Excluded(&2));
     /// assert_eq!(cursor.key(), Some(&3));
     /// ```
@@ -2673,8 +2627,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// #![feature(btree_cursors)]
     ///
@@ -2686,6 +2638,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     /// a.insert(2, "b");
     /// a.insert(3, "c");
     /// a.insert(4, "c");
+    /// let cursor = a.upper_bound(Bound::Included(&3));
+    /// assert_eq!(cursor.key(), Some(&3));
     /// let cursor = a.upper_bound(Bound::Excluded(&3));
     /// assert_eq!(cursor.key(), Some(&2));
     /// ```
@@ -2714,8 +2668,6 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     ///
     /// # Examples
     ///
-    /// Basic usage:
-    ///
     /// ```
     /// #![feature(btree_cursors)]
     ///
@@ -2727,6 +2679,8 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
     /// a.insert(2, "b");
     /// a.insert(3, "c");
     /// a.insert(4, "c");
+    /// let cursor = a.upper_bound_mut(Bound::Included(&3));
+    /// assert_eq!(cursor.key(), Some(&3));
     /// let cursor = a.upper_bound_mut(Bound::Excluded(&3));
     /// assert_eq!(cursor.key(), Some(&2));
     /// ```
diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs
index c4461040b20..9da230915b8 100644
--- a/library/alloc/src/collections/btree/set.rs
+++ b/library/alloc/src/collections/btree/set.rs
@@ -1121,19 +1121,6 @@ impl<T, A: Allocator + Clone> BTreeSet<T, A> {
     /// ```
     /// use std::collections::BTreeSet;
     ///
-    /// let set = BTreeSet::from([1, 2, 3]);
-    /// let mut set_iter = set.iter();
-    /// assert_eq!(set_iter.next(), Some(&1));
-    /// assert_eq!(set_iter.next(), Some(&2));
-    /// assert_eq!(set_iter.next(), Some(&3));
-    /// assert_eq!(set_iter.next(), None);
-    /// ```
-    ///
-    /// Values returned by the iterator are returned in ascending order:
-    ///
-    /// ```
-    /// use std::collections::BTreeSet;
-    ///
     /// let set = BTreeSet::from([3, 1, 2]);
     /// let mut set_iter = set.iter();
     /// assert_eq!(set_iter.next(), Some(&1));
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index bf01b2082ed..60b07485c3a 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -2719,7 +2719,7 @@ impl<T> Weak<T> {
     /// ```
     #[inline]
     #[stable(feature = "downgraded_weak", since = "1.10.0")]
-    #[rustc_const_unstable(feature = "const_weak_new", issue = "95091", reason = "recently added")]
+    #[rustc_const_stable(feature = "const_weak_new", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     pub const fn new() -> Weak<T> {
         Weak {
diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs
index c2202f2fce5..6c701225a84 100644
--- a/library/alloc/src/sync.rs
+++ b/library/alloc/src/sync.rs
@@ -2503,7 +2503,7 @@ impl<T> Weak<T> {
     /// ```
     #[inline]
     #[stable(feature = "downgraded_weak", since = "1.10.0")]
-    #[rustc_const_unstable(feature = "const_weak_new", issue = "95091", reason = "recently added")]
+    #[rustc_const_stable(feature = "const_weak_new", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     pub const fn new() -> Weak<T> {
         Weak {
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 1b24c637550..e45ddc7896b 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -213,7 +213,7 @@ mod spec_extend;
 ///
 /// # Indexing
 ///
-/// The `Vec` type allows to access values by index, because it implements the
+/// The `Vec` type allows access to values by index, because it implements the
 /// [`Index`] trait. An example will be more explicit:
 ///
 /// ```
diff --git a/library/core/benches/iter.rs b/library/core/benches/iter.rs
index 5ec22e5147b..05fec0c4b9d 100644
--- a/library/core/benches/iter.rs
+++ b/library/core/benches/iter.rs
@@ -473,6 +473,7 @@ fn bench_next_chunk_copied(b: &mut Bencher) {
 
 /// Exercises the TrustedRandomAccess specialization in ArrayChunks
 #[bench]
+#[allow(noop_method_call)]
 fn bench_next_chunk_trusted_random_access(b: &mut Bencher) {
     let v = vec![1u8; 1024];
 
diff --git a/library/core/src/borrow.rs b/library/core/src/borrow.rs
index efc9ada3891..bc026d0a446 100644
--- a/library/core/src/borrow.rs
+++ b/library/core/src/borrow.rs
@@ -22,7 +22,7 @@
 /// Types express that they can be borrowed as some type `T` by implementing
 /// `Borrow<T>`, providing a reference to a `T` in the trait’s
 /// [`borrow`] method. A type is free to borrow as several different types.
-/// If it wishes to mutably borrow as the type – allowing the underlying data
+/// If it wishes to mutably borrow as the type, allowing the underlying data
 /// to be modified, it can additionally implement [`BorrowMut<T>`].
 ///
 /// Further, when providing implementations for additional traits, it needs
diff --git a/library/core/src/fmt/builders.rs b/library/core/src/fmt/builders.rs
index 36f49d51ca6..d2c9f980042 100644
--- a/library/core/src/fmt/builders.rs
+++ b/library/core/src/fmt/builders.rs
@@ -518,7 +518,7 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
     ///     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
     ///         fmt.debug_set()
     ///            .entries(self.0.iter())
-    ///            .finish() // Ends the struct formatting.
+    ///            .finish() // Ends the set formatting.
     ///     }
     /// }
     ///
@@ -648,7 +648,7 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
     ///     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
     ///         fmt.debug_list()
     ///            .entries(self.0.iter())
-    ///            .finish() // Ends the struct formatting.
+    ///            .finish() // Ends the list formatting.
     ///     }
     /// }
     ///
@@ -905,7 +905,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
     ///     fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
     ///         fmt.debug_map()
     ///            .entries(self.0.iter().map(|&(ref k, ref v)| (k, v)))
-    ///            .finish() // Ends the struct formatting.
+    ///            .finish() // Ends the map formatting.
     ///     }
     /// }
     ///
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 741de3221ee..37216d6a721 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -399,7 +399,8 @@ pub mod primitive;
     missing_debug_implementations,
     dead_code,
     unused_imports,
-    unsafe_op_in_unsafe_fn
+    unsafe_op_in_unsafe_fn,
+    ambiguous_glob_reexports
 )]
 #[allow(rustdoc::bare_urls)]
 // FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 9b6ff76b240..1020e655579 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -1125,6 +1125,7 @@ impl<T> Option<T> {
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[must_use = "if you don't need the returned value, use `if let` instead"]
     pub fn map_or<U, F>(self, default: U, f: F) -> U
     where
         F: FnOnce(T) -> U,
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index a8074c8659b..9582ca9e0be 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -367,13 +367,14 @@ impl<T: ?Sized> NonNull<T> {
     ///
     /// [the module documentation]: crate::ptr#safety
     #[stable(feature = "nonnull", since = "1.25.0")]
-    #[rustc_const_unstable(feature = "const_ptr_as_ref", issue = "91822")]
+    #[rustc_const_stable(feature = "const_nonnull_as_ref", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     #[inline(always)]
     pub const unsafe fn as_ref<'a>(&self) -> &'a T {
         // SAFETY: the caller must guarantee that `self` meets all the
         // requirements for a reference.
-        unsafe { &*self.as_ptr() }
+        // `cast_const` avoids a mutable raw pointer deref.
+        unsafe { &*self.as_ptr().cast_const() }
     }
 
     /// Returns a unique reference to the value. If the value may be uninitialized, [`as_uninit_mut`]
diff --git a/library/core/src/result.rs b/library/core/src/result.rs
index 51b7616ffec..6981abc9be1 100644
--- a/library/core/src/result.rs
+++ b/library/core/src/result.rs
@@ -768,6 +768,7 @@ impl<T, E> Result<T, E> {
     /// ```
     #[inline]
     #[stable(feature = "result_map_or", since = "1.41.0")]
+    #[must_use = "if you don't need the returned value, use `if let` instead"]
     pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
         match self {
             Ok(t) => f(t),
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index 9a93bb72903..71c03f7bfc5 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -952,6 +952,10 @@ impl str {
     ///
     /// Line terminators are not included in the lines returned by the iterator.
     ///
+    /// Note that any carriage return (`\r`) not immediately followed by a
+    /// line feed (`\n`) does not split a line. These carriage returns are
+    /// thereby included in the produced lines.
+    ///
     /// The final line ending is optional. A string that ends with a final line
     /// ending will return the same lines as an otherwise identical string
     /// without a final line ending.
@@ -961,18 +965,19 @@ impl str {
     /// Basic usage:
     ///
     /// ```
-    /// let text = "foo\r\nbar\n\nbaz\n";
+    /// let text = "foo\r\nbar\n\nbaz\r";
     /// let mut lines = text.lines();
     ///
     /// assert_eq!(Some("foo"), lines.next());
     /// assert_eq!(Some("bar"), lines.next());
     /// assert_eq!(Some(""), lines.next());
-    /// assert_eq!(Some("baz"), lines.next());
+    /// // Trailing carriage return is included in the last line
+    /// assert_eq!(Some("baz\r"), lines.next());
     ///
     /// assert_eq!(None, lines.next());
     /// ```
     ///
-    /// The final line ending isn't required:
+    /// The final line does not require any ending:
     ///
     /// ```
     /// let text = "foo\nbar\n\r\nbaz";
@@ -1666,7 +1671,7 @@ impl str {
     /// If the pattern allows a reverse search but its results might differ
     /// from a forward search, the [`rmatches`] method can be used.
     ///
-    /// [`rmatches`]: str::matches
+    /// [`rmatches`]: str::rmatches
     ///
     /// # Examples
     ///
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
index 092b097c396..22a1c09782c 100644
--- a/library/core/src/sync/atomic.rs
+++ b/library/core/src/sync/atomic.rs
@@ -131,6 +131,17 @@ use crate::intrinsics;
 
 use crate::hint::spin_loop;
 
+// Some architectures don't have byte-sized atomics, which results in LLVM
+// emulating them using a LL/SC loop. However for AtomicBool we can take
+// advantage of the fact that it only ever contains 0 or 1 and use atomic OR/AND
+// instead, which LLVM can emulate using a larger atomic OR/AND operation.
+//
+// This list should only contain architectures which have word-sized atomic-or/
+// atomic-and instructions but don't natively support byte-sized atomics.
+#[cfg(target_has_atomic = "8")]
+const EMULATE_ATOMIC_BOOL: bool =
+    cfg!(any(target_arch = "riscv32", target_arch = "riscv64", target_arch = "loongarch64"));
+
 /// A boolean type which can be safely shared between threads.
 ///
 /// This type has the same in-memory representation as a [`bool`].
@@ -553,8 +564,12 @@ impl AtomicBool {
     #[cfg(target_has_atomic = "8")]
     #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
     pub fn swap(&self, val: bool, order: Ordering) -> bool {
-        // SAFETY: data races are prevented by atomic intrinsics.
-        unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 }
+        if EMULATE_ATOMIC_BOOL {
+            if val { self.fetch_or(true, order) } else { self.fetch_and(false, order) }
+        } else {
+            // SAFETY: data races are prevented by atomic intrinsics.
+            unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 }
+        }
     }
 
     /// Stores a value into the [`bool`] if the current value is the same as the `current` value.
@@ -664,12 +679,39 @@ impl AtomicBool {
         success: Ordering,
         failure: Ordering,
     ) -> Result<bool, bool> {
-        // SAFETY: data races are prevented by atomic intrinsics.
-        match unsafe {
-            atomic_compare_exchange(self.v.get(), current as u8, new as u8, success, failure)
-        } {
-            Ok(x) => Ok(x != 0),
-            Err(x) => Err(x != 0),
+        if EMULATE_ATOMIC_BOOL {
+            // Pick the strongest ordering from success and failure.
+            let order = match (success, failure) {
+                (SeqCst, _) => SeqCst,
+                (_, SeqCst) => SeqCst,
+                (AcqRel, _) => AcqRel,
+                (_, AcqRel) => {
+                    panic!("there is no such thing as an acquire-release failure ordering")
+                }
+                (Release, Acquire) => AcqRel,
+                (Acquire, _) => Acquire,
+                (_, Acquire) => Acquire,
+                (Release, Relaxed) => Release,
+                (_, Release) => panic!("there is no such thing as a release failure ordering"),
+                (Relaxed, Relaxed) => Relaxed,
+            };
+            let old = if current == new {
+                // This is a no-op, but we still need to perform the operation
+                // for memory ordering reasons.
+                self.fetch_or(false, order)
+            } else {
+                // This sets the value to the new one and returns the old one.
+                self.swap(new, order)
+            };
+            if old == current { Ok(old) } else { Err(old) }
+        } else {
+            // SAFETY: data races are prevented by atomic intrinsics.
+            match unsafe {
+                atomic_compare_exchange(self.v.get(), current as u8, new as u8, success, failure)
+            } {
+                Ok(x) => Ok(x != 0),
+                Err(x) => Err(x != 0),
+            }
         }
     }
 
@@ -719,6 +761,10 @@ impl AtomicBool {
         success: Ordering,
         failure: Ordering,
     ) -> Result<bool, bool> {
+        if EMULATE_ATOMIC_BOOL {
+            return self.compare_exchange(current, new, success, failure);
+        }
+
         // SAFETY: data races are prevented by atomic intrinsics.
         match unsafe {
             atomic_compare_exchange_weak(self.v.get(), current as u8, new as u8, success, failure)
diff --git a/library/portable-simd/crates/core_simd/examples/dot_product.rs b/library/portable-simd/crates/core_simd/examples/dot_product.rs
index 391f08f55a0..a7973ec7404 100644
--- a/library/portable-simd/crates/core_simd/examples/dot_product.rs
+++ b/library/portable-simd/crates/core_simd/examples/dot_product.rs
@@ -130,7 +130,7 @@ pub fn dot_prod_simd_4(a: &[f32], b: &[f32]) -> f32 {
 }
 
 // This version allocates a single `XMM` register for accumulation, and the folds don't allocate on top of that.
-// Notice the the use of `mul_add`, which can do a multiply and an add operation ber iteration.
+// Notice the use of `mul_add`, which can do a multiply and an add operation ber iteration.
 pub fn dot_prod_simd_5(a: &[f32], b: &[f32]) -> f32 {
     a.array_chunks::<4>()
         .map(|&a| f32x4::from_array(a))
diff --git a/library/std/src/backtrace.rs b/library/std/src/backtrace.rs
index 7543ffadd41..f0e199fac73 100644
--- a/library/std/src/backtrace.rs
+++ b/library/std/src/backtrace.rs
@@ -89,12 +89,11 @@ mod tests;
 // a backtrace or actually symbolizing it.
 
 use crate::backtrace_rs::{self, BytesOrWideString};
-use crate::cell::UnsafeCell;
 use crate::env;
 use crate::ffi::c_void;
 use crate::fmt;
 use crate::sync::atomic::{AtomicUsize, Ordering::Relaxed};
-use crate::sync::Once;
+use crate::sync::LazyLock;
 use crate::sys_common::backtrace::{lock, output_filename};
 use crate::vec::Vec;
 
@@ -133,12 +132,11 @@ pub enum BacktraceStatus {
 enum Inner {
     Unsupported,
     Disabled,
-    Captured(LazilyResolvedCapture),
+    Captured(LazyLock<Capture, LazyResolve>),
 }
 
 struct Capture {
     actual_start: usize,
-    resolved: bool,
     frames: Vec<BacktraceFrame>,
 }
 
@@ -179,7 +177,7 @@ impl fmt::Debug for Backtrace {
         let capture = match &self.inner {
             Inner::Unsupported => return fmt.write_str("<unsupported>"),
             Inner::Disabled => return fmt.write_str("<disabled>"),
-            Inner::Captured(c) => c.force(),
+            Inner::Captured(c) => &**c,
         };
 
         let frames = &capture.frames[capture.actual_start..];
@@ -347,11 +345,10 @@ impl Backtrace {
         let inner = if frames.is_empty() {
             Inner::Unsupported
         } else {
-            Inner::Captured(LazilyResolvedCapture::new(Capture {
+            Inner::Captured(LazyLock::new(lazy_resolve(Capture {
                 actual_start: actual_start.unwrap_or(0),
                 frames,
-                resolved: false,
-            }))
+            })))
         };
 
         Backtrace { inner }
@@ -376,7 +373,7 @@ impl<'a> Backtrace {
     #[must_use]
     #[unstable(feature = "backtrace_frames", issue = "79676")]
     pub fn frames(&'a self) -> &'a [BacktraceFrame] {
-        if let Inner::Captured(c) = &self.inner { &c.force().frames } else { &[] }
+        if let Inner::Captured(c) = &self.inner { &c.frames } else { &[] }
     }
 }
 
@@ -386,7 +383,7 @@ impl fmt::Display for Backtrace {
         let capture = match &self.inner {
             Inner::Unsupported => return fmt.write_str("unsupported backtrace"),
             Inner::Disabled => return fmt.write_str("disabled backtrace"),
-            Inner::Captured(c) => c.force(),
+            Inner::Captured(c) => &**c,
         };
 
         let full = fmt.alternate();
@@ -430,46 +427,15 @@ impl fmt::Display for Backtrace {
     }
 }
 
-struct LazilyResolvedCapture {
-    sync: Once,
-    capture: UnsafeCell<Capture>,
-}
-
-impl LazilyResolvedCapture {
-    fn new(capture: Capture) -> Self {
-        LazilyResolvedCapture { sync: Once::new(), capture: UnsafeCell::new(capture) }
-    }
-
-    fn force(&self) -> &Capture {
-        self.sync.call_once(|| {
-            // SAFETY: This exclusive reference can't overlap with any others
-            // `Once` guarantees callers will block until this closure returns
-            // `Once` also guarantees only a single caller will enter this closure
-            unsafe { &mut *self.capture.get() }.resolve();
-        });
-
-        // SAFETY: This shared reference can't overlap with the exclusive reference above
-        unsafe { &*self.capture.get() }
-    }
-}
-
-// SAFETY: Access to the inner value is synchronized using a thread-safe `Once`
-// So long as `Capture` is `Sync`, `LazilyResolvedCapture` is too
-unsafe impl Sync for LazilyResolvedCapture where Capture: Sync {}
-
-impl Capture {
-    fn resolve(&mut self) {
-        // If we're already resolved, nothing to do!
-        if self.resolved {
-            return;
-        }
-        self.resolved = true;
+type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync;
 
+fn lazy_resolve(mut capture: Capture) -> LazyResolve {
+    move || {
         // Use the global backtrace lock to synchronize this as it's a
         // requirement of the `backtrace` crate, and then actually resolve
         // everything.
         let _lock = lock();
-        for frame in self.frames.iter_mut() {
+        for frame in capture.frames.iter_mut() {
             let symbols = &mut frame.symbols;
             let frame = match &frame.frame {
                 RawFrame::Actual(frame) => frame,
@@ -490,6 +456,8 @@ impl Capture {
                 });
             }
         }
+
+        capture
     }
 }
 
diff --git a/library/std/src/backtrace/tests.rs b/library/std/src/backtrace/tests.rs
index 4dfbf88e83e..ef419806dcc 100644
--- a/library/std/src/backtrace/tests.rs
+++ b/library/std/src/backtrace/tests.rs
@@ -43,9 +43,8 @@ fn generate_fake_frames() -> Vec<BacktraceFrame> {
 #[test]
 fn test_debug() {
     let backtrace = Backtrace {
-        inner: Inner::Captured(LazilyResolvedCapture::new(Capture {
+        inner: Inner::Captured(LazyLock::preinit(Capture {
             actual_start: 1,
-            resolved: true,
             frames: generate_fake_frames(),
         })),
     };
@@ -66,9 +65,8 @@ fn test_debug() {
 #[test]
 fn test_frames() {
     let backtrace = Backtrace {
-        inner: Inner::Captured(LazilyResolvedCapture::new(Capture {
+        inner: Inner::Captured(LazyLock::preinit(Capture {
             actual_start: 1,
-            resolved: true,
             frames: generate_fake_frames(),
         })),
     };
diff --git a/library/std/src/io/util.rs b/library/std/src/io/util.rs
index f076ee0923c..3840ffe7eec 100644
--- a/library/std/src/io/util.rs
+++ b/library/std/src/io/util.rs
@@ -8,24 +8,41 @@ use crate::io::{
     self, BorrowedCursor, BufRead, IoSlice, IoSliceMut, Read, Seek, SeekFrom, SizeHint, Write,
 };
 
-/// A reader which is always at EOF.
+/// `Empty` ignores any data written via [`Write`], and will always be empty
+/// (returning zero bytes) when read via [`Read`].
 ///
-/// This struct is generally created by calling [`empty()`]. Please see
-/// the documentation of [`empty()`] for more details.
+/// This struct is generally created by calling [`empty()`]. Please
+/// see the documentation of [`empty()`] for more details.
 #[stable(feature = "rust1", since = "1.0.0")]
 #[non_exhaustive]
-#[derive(Copy, Clone, Default)]
+#[derive(Copy, Clone, Debug, Default)]
 pub struct Empty;
 
-/// Constructs a new handle to an empty reader.
+/// Creates a value that is always at EOF for reads, and ignores all data written.
 ///
-/// All reads from the returned reader will return <code>[Ok]\(0)</code>.
+/// All calls to [`write`] on the returned instance will return [`Ok(buf.len())`]
+/// and the contents of the buffer will not be inspected.
+///
+/// All calls to [`read`] from the returned reader will return [`Ok(0)`].
+///
+/// [`Ok(buf.len())`]: Ok
+/// [`Ok(0)`]: Ok
+///
+/// [`write`]: Write::write
+/// [`read`]: Read::read
 ///
 /// # Examples
 ///
-/// A slightly sad example of not reading anything into a buffer:
+/// ```rust
+/// use std::io::{self, Write};
 ///
+/// let buffer = vec![1, 2, 3, 5, 8];
+/// let num_bytes = io::empty().write(&buffer).unwrap();
+/// assert_eq!(num_bytes, 5);
 /// ```
+///
+///
+/// ```rust
 /// use std::io::{self, Read};
 ///
 /// let mut buffer = String::new();
@@ -76,13 +93,6 @@ impl Seek for Empty {
     }
 }
 
-#[stable(feature = "std_debug", since = "1.16.0")]
-impl fmt::Debug for Empty {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_struct("Empty").finish_non_exhaustive()
-    }
-}
-
 impl SizeHint for Empty {
     #[inline]
     fn upper_bound(&self) -> Option<usize> {
@@ -90,6 +100,54 @@ impl SizeHint for Empty {
     }
 }
 
+#[stable(feature = "empty_write", since = "CURRENT_RUSTC_VERSION")]
+impl Write for Empty {
+    #[inline]
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        Ok(buf.len())
+    }
+
+    #[inline]
+    fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
+        let total_len = bufs.iter().map(|b| b.len()).sum();
+        Ok(total_len)
+    }
+
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
+    #[inline]
+    fn flush(&mut self) -> io::Result<()> {
+        Ok(())
+    }
+}
+
+#[stable(feature = "empty_write", since = "CURRENT_RUSTC_VERSION")]
+impl Write for &Empty {
+    #[inline]
+    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
+        Ok(buf.len())
+    }
+
+    #[inline]
+    fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
+        let total_len = bufs.iter().map(|b| b.len()).sum();
+        Ok(total_len)
+    }
+
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
+    #[inline]
+    fn flush(&mut self) -> io::Result<()> {
+        Ok(())
+    }
+}
+
 /// A reader which yields one byte over and over and over and over and over and...
 ///
 /// This struct is generally created by calling [`repeat()`]. Please
@@ -182,19 +240,20 @@ impl fmt::Debug for Repeat {
 
 /// A writer which will move data into the void.
 ///
-/// This struct is generally created by calling [`sink`]. Please
+/// This struct is generally created by calling [`sink()`]. Please
 /// see the documentation of [`sink()`] for more details.
 #[stable(feature = "rust1", since = "1.0.0")]
 #[non_exhaustive]
-#[derive(Copy, Clone, Default)]
+#[derive(Copy, Clone, Debug, Default)]
 pub struct Sink;
 
 /// Creates an instance of a writer which will successfully consume all data.
 ///
-/// All calls to [`write`] on the returned instance will return `Ok(buf.len())`
+/// All calls to [`write`] on the returned instance will return [`Ok(buf.len())`]
 /// and the contents of the buffer will not be inspected.
 ///
 /// [`write`]: Write::write
+/// [`Ok(buf.len())`]: Ok
 ///
 /// # Examples
 ///
@@ -259,10 +318,3 @@ impl Write for &Sink {
         Ok(())
     }
 }
-
-#[stable(feature = "std_debug", since = "1.16.0")]
-impl fmt::Debug for Sink {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        f.debug_struct("Sink").finish_non_exhaustive()
-    }
-}
diff --git a/library/std/src/io/util/tests.rs b/library/std/src/io/util/tests.rs
index 1baa94e64c9..6de91e29c77 100644
--- a/library/std/src/io/util/tests.rs
+++ b/library/std/src/io/util/tests.rs
@@ -18,7 +18,7 @@ fn empty_reads() {
     assert_eq!(e.read(&mut []).unwrap(), 0);
     assert_eq!(e.read(&mut [0]).unwrap(), 0);
     assert_eq!(e.read(&mut [0; 1024]).unwrap(), 0);
-    assert_eq!(e.by_ref().read(&mut [0; 1024]).unwrap(), 0);
+    assert_eq!(Read::by_ref(&mut e).read(&mut [0; 1024]).unwrap(), 0);
 
     let buf: &mut [MaybeUninit<_>] = &mut [];
     let mut buf: BorrowedBuf<'_> = buf.into();
@@ -40,7 +40,7 @@ fn empty_reads() {
 
     let buf: &mut [_] = &mut [MaybeUninit::uninit(); 1024];
     let mut buf: BorrowedBuf<'_> = buf.into();
-    e.by_ref().read_buf(buf.unfilled()).unwrap();
+    Read::by_ref(&mut e).read_buf(buf.unfilled()).unwrap();
     assert_eq!(buf.len(), 0);
     assert_eq!(buf.init_len(), 0);
 }
@@ -66,6 +66,15 @@ fn empty_seeks() {
 }
 
 #[test]
+fn empty_sinks() {
+    let mut e = empty();
+    assert_eq!(e.write(&[]).unwrap(), 0);
+    assert_eq!(e.write(&[0]).unwrap(), 1);
+    assert_eq!(e.write(&[0; 1024]).unwrap(), 1024);
+    assert_eq!(Write::by_ref(&mut e).write(&[0; 1024]).unwrap(), 1024);
+}
+
+#[test]
 fn repeat_repeats() {
     let mut r = repeat(4);
     let mut b = [0; 1024];
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 4cd251d0ac2..238c74229cc 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -272,6 +272,7 @@
 #![feature(staged_api)]
 #![feature(thread_local)]
 #![feature(try_blocks)]
+#![feature(type_alias_impl_trait)]
 #![feature(utf8_chunks)]
 // tidy-alphabetical-end
 //
diff --git a/library/std/src/os/android/raw.rs b/library/std/src/os/android/raw.rs
index daaf3d3eac6..175f8eac971 100644
--- a/library/std/src/os/android/raw.rs
+++ b/library/std/src/os/android/raw.rs
@@ -89,7 +89,7 @@ mod arch {
     }
 }
 
-#[cfg(target_arch = "aarch64")]
+#[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))]
 mod arch {
     use crate::os::raw::{c_int, c_long, c_uint, c_ulong};
     use crate::os::unix::raw::{gid_t, uid_t};
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 0e90d618ad4..15285465c71 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -300,7 +300,7 @@ pub fn panic_hook_with_disk_dump(info: &PanicInfo<'_>, path: Option<&crate::path
     };
 
     if let Some(path) = path
-        && let Ok(mut out) = crate::fs::File::options().create(true).write(true).open(&path)
+        && let Ok(mut out) = crate::fs::File::options().create(true).append(true).open(&path)
     {
         write(&mut out, BacktraceStyle::full());
     }
diff --git a/library/std/src/sync/condvar.rs b/library/std/src/sync/condvar.rs
index 76a1b4a2a86..9c4b926b7ec 100644
--- a/library/std/src/sync/condvar.rs
+++ b/library/std/src/sync/condvar.rs
@@ -21,11 +21,11 @@ impl WaitTimeoutResult {
     ///
     /// # Examples
     ///
-    /// This example spawns a thread which will update the boolean value and
-    /// then wait 100 milliseconds before notifying the condvar.
+    /// This example spawns a thread which will sleep 20 milliseconds before
+    /// updating a boolean value and then notifying the condvar.
     ///
-    /// The main thread will wait with a timeout on the condvar and then leave
-    /// once the boolean has been updated and notified.
+    /// The main thread will wait with a 10 millisecond timeout on the condvar
+    /// and will leave the loop upon timeout.
     ///
     /// ```
     /// use std::sync::{Arc, Condvar, Mutex};
@@ -49,14 +49,12 @@ impl WaitTimeoutResult {
     ///
     /// // Wait for the thread to start up.
     /// let (lock, cvar) = &*pair;
-    /// let mut started = lock.lock().unwrap();
     /// loop {
     ///     // Let's put a timeout on the condvar's wait.
-    ///     let result = cvar.wait_timeout(started, Duration::from_millis(10)).unwrap();
-    ///     // 10 milliseconds have passed, or maybe the value changed!
-    ///     started = result.0;
-    ///     if *started == true {
-    ///         // We received the notification and the value has been updated, we can leave.
+    ///     let result = cvar.wait_timeout(lock.lock().unwrap(), Duration::from_millis(10)).unwrap();
+    ///     // 10 milliseconds have passed.
+    ///     if result.1.timed_out() {
+    ///         // timed out now and we can leave.
     ///         break
     ///     }
     /// }
diff --git a/library/std/src/sync/lazy_lock.rs b/library/std/src/sync/lazy_lock.rs
index 37bdec5abcc..1aeed406562 100644
--- a/library/std/src/sync/lazy_lock.rs
+++ b/library/std/src/sync/lazy_lock.rs
@@ -89,6 +89,15 @@ impl<T, F: FnOnce() -> T> LazyLock<T, F> {
         LazyLock { once: Once::new(), data: UnsafeCell::new(Data { f: ManuallyDrop::new(f) }) }
     }
 
+    /// Creates a new lazy value that is already initialized.
+    #[inline]
+    #[cfg(test)]
+    pub(crate) fn preinit(value: T) -> LazyLock<T, F> {
+        let once = Once::new();
+        once.call_once(|| {});
+        LazyLock { once, data: UnsafeCell::new(Data { value: ManuallyDrop::new(value) }) }
+    }
+
     /// Consumes this `LazyLock` returning the stored value.
     ///
     /// Returns `Ok(value)` if `Lazy` is initialized and `Err(f)` otherwise.
diff --git a/library/std/src/sys_common/backtrace.rs b/library/std/src/sys_common/backtrace.rs
index 6f020940df1..84e2c5d8d7f 100644
--- a/library/std/src/sys_common/backtrace.rs
+++ b/library/std/src/sys_common/backtrace.rs
@@ -60,6 +60,8 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
     bt_fmt.add_context()?;
     let mut idx = 0;
     let mut res = Ok(());
+    let mut omitted_count: usize = 0;
+    let mut first_omit = true;
     // Start immediately if we're not using a short backtrace.
     let mut start = print_fmt != PrintFmt::Short;
     backtrace_rs::trace_unsynchronized(|frame| {
@@ -85,10 +87,27 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
                         start = true;
                         return;
                     }
+                    if !start {
+                        omitted_count += 1;
+                    }
                 }
             }
 
             if start {
+                if omitted_count > 0 {
+                    debug_assert!(print_fmt == PrintFmt::Short);
+                    // only print the message between the middle of frames
+                    if !first_omit {
+                        let _ = writeln!(
+                            bt_fmt.formatter(),
+                            "      [... omitted {} frame{} ...]",
+                            omitted_count,
+                            if omitted_count > 1 { "s" } else { "" }
+                        );
+                    }
+                    first_omit = false;
+                    omitted_count = 0;
+                }
                 res = bt_fmt.frame().symbol(frame, symbol);
             }
         });
diff --git a/tests/ui/std/issue-15149.rs b/library/std/tests/process_spawning.rs
index 064472f5785..46dc9ff00bd 100644
--- a/tests/ui/std/issue-15149.rs
+++ b/library/std/tests/process_spawning.rs
@@ -1,38 +1,19 @@
-// run-pass
-
-#![allow(unused_variables)]
-// no-prefer-dynamic
-// ignore-cross-compile
+#![cfg(not(target_env="sgx"))]
 
 use std::env;
-use std::ffi::OsStr;
 use std::fs;
-use std::path::PathBuf;
 use std::process;
 use std::str;
 
-fn main() {
-    // If we're the child, make sure we were invoked correctly
-    let args: Vec<String> = env::args().collect();
-    if args.len() > 1 && args[1] == "child" {
-        // FIXME: This should check the whole `args[0]` instead of just
-        // checking that it ends_with the executable name. This
-        // is needed because of Windows, which has a different behavior.
-        // See #15149 for more info.
-        let my_path = env::current_exe().unwrap();
-        return assert_eq!(my_path.file_stem(), Some(OsStr::new("mytest")));
-    }
-
-    test();
-}
+mod common;
 
-fn test() {
+#[test]
+fn issue_15149() {
     // If we're the parent, copy our own binary to a new directory.
     let my_path = env::current_exe().unwrap();
-    let my_dir = my_path.parent().unwrap();
 
-    let child_dir = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
-    let child_dir = child_dir.join("issue-15140-child");
+    let temp = common::tmpdir();
+    let child_dir = temp.join("issue-15140-child");
     fs::create_dir_all(&child_dir).unwrap();
 
     let child_path = child_dir.join(&format!("mytest{}", env::consts::EXE_SUFFIX));
diff --git a/tests/ui/std/switch-stdout.rs b/library/std/tests/switch-stdout.rs
index 2d936d96b05..2605664d289 100644
--- a/tests/ui/std/switch-stdout.rs
+++ b/library/std/tests/switch-stdout.rs
@@ -1,10 +1,9 @@
-// run-pass
-// ignore-wasm (needs file descriptors and env variables)
+#![cfg(any(target_family = "unix", target_family = "windows"))]
 
-use std::env;
 use std::fs::File;
 use std::io::{Read, Write};
-use std::path::PathBuf;
+
+mod common;
 
 #[cfg(unix)]
 fn switch_stdout_to(file: File) {
@@ -35,16 +34,18 @@ fn switch_stdout_to(file: File) {
     }
 }
 
-fn main() {
-    let path = PathBuf::from(env::var_os("RUST_TEST_TMPDIR").unwrap());
-    let path = path.join("switch-stdout-output");
+#[test]
+fn switch_stdout() {
+    let temp = common::tmpdir();
+    let path = temp.join("switch-stdout-output");
     let f = File::create(&path).unwrap();
 
-    println!("foo");
-    std::io::stdout().flush().unwrap();
+    let mut stdout = std::io::stdout();
+    stdout.write(b"foo\n").unwrap();
+    stdout.flush().unwrap();
     switch_stdout_to(f);
-    println!("bar");
-    std::io::stdout().flush().unwrap();
+    stdout.write(b"bar\n").unwrap();
+    stdout.flush().unwrap();
 
     let mut contents = String::new();
     File::open(&path).unwrap().read_to_string(&mut contents).unwrap();
diff --git a/library/test/src/types.rs b/library/test/src/types.rs
index 504ceee7fce..1a8ae889c8c 100644
--- a/library/test/src/types.rs
+++ b/library/test/src/types.rs
@@ -224,7 +224,7 @@ impl TestDesc {
         }
     }
 
-    /// Returns None for ignored test or that that are just run, otherwise give a description of the type of test.
+    /// Returns None for ignored test or tests that are just run, otherwise returns a description of the type of test.
     /// Descriptions include "should panic", "compile fail" and "compile".
     pub fn test_mode(&self) -> Option<&'static str> {
         if self.ignore {
diff --git a/src/bootstrap/bin/main.rs b/src/bootstrap/bin/main.rs
index 30dfa81c6f7..c497cabbd69 100644
--- a/src/bootstrap/bin/main.rs
+++ b/src/bootstrap/bin/main.rs
@@ -67,7 +67,7 @@ fn main() {
             `cp config.example.toml config.toml`"
         );
     } else if let Some(suggestion) = &changelog_suggestion {
-        println!("{}", suggestion);
+        println!("{suggestion}");
     }
 
     let pre_commit = config.src.join(".git").join("hooks").join("pre-commit");
@@ -80,7 +80,7 @@ fn main() {
             `cp config.example.toml config.toml`"
         );
     } else if let Some(suggestion) = &changelog_suggestion {
-        println!("{}", suggestion);
+        println!("{suggestion}");
     }
 
     // Give a warning if the pre-commit script is in pre-commit and not pre-push.
@@ -107,13 +107,13 @@ fn check_version(config: &Config) -> Option<String> {
     let suggestion = if let Some(seen) = config.changelog_seen {
         if seen != VERSION {
             msg.push_str("warning: there have been changes to x.py since you last updated.\n");
-            format!("update `config.toml` to use `changelog-seen = {}` instead", VERSION)
+            format!("update `config.toml` to use `changelog-seen = {VERSION}` instead")
         } else {
             return None;
         }
     } else {
         msg.push_str("warning: x.py has made several changes recently you may want to look at\n");
-        format!("add `changelog-seen = {}` at the top of `config.toml`", VERSION)
+        format!("add `changelog-seen = {VERSION}` at the top of `config.toml`")
     };
 
     msg.push_str("help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`\n");
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index e87125a49a6..10718aeb89f 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -120,7 +120,7 @@ fn main() {
 
         // Override linker if necessary.
         if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
-            cmd.arg(format!("-Clinker={}", host_linker));
+            cmd.arg(format!("-Clinker={host_linker}"));
         }
         if env::var_os("RUSTC_HOST_FUSE_LD_LLD").is_some() {
             cmd.arg("-Clink-args=-fuse-ld=lld");
@@ -206,11 +206,11 @@ fn main() {
             env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO"));
         let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" };
         let prefix = match crate_name {
-            Some(crate_name) => format!("{} {}", prefix, crate_name),
+            Some(crate_name) => format!("{prefix} {crate_name}"),
             None => prefix.to_string(),
         };
         for (i, (k, v)) in rust_env_vars.enumerate() {
-            eprintln!("{} env[{}]: {:?}={:?}", prefix, i, k, v);
+            eprintln!("{prefix} env[{i}]: {k:?}={v:?}");
         }
         eprintln!("{} working directory: {}", prefix, env::current_dir().unwrap().display());
         eprintln!(
@@ -220,13 +220,13 @@ fn main() {
             env::join_paths(&dylib_path).unwrap(),
             cmd,
         );
-        eprintln!("{} sysroot: {:?}", prefix, sysroot);
-        eprintln!("{} libdir: {:?}", prefix, libdir);
+        eprintln!("{prefix} sysroot: {sysroot:?}");
+        eprintln!("{prefix} libdir: {libdir:?}");
     }
 
     let start = Instant::now();
     let (child, status) = {
-        let errmsg = format!("\nFailed to run:\n{:?}\n-------------", cmd);
+        let errmsg = format!("\nFailed to run:\n{cmd:?}\n-------------");
         let mut child = cmd.spawn().expect(&errmsg);
         let status = child.wait().expect(&errmsg);
         (child, status)
@@ -259,7 +259,7 @@ fn main() {
         // should run on success, after this block.
     }
     if verbose > 0 {
-        println!("\nDid not run successfully: {}\n{:?}\n-------------", status, cmd);
+        println!("\nDid not run successfully: {status}\n{cmd:?}\n-------------");
     }
 
     if let Some(mut on_fail) = on_fail {
@@ -271,7 +271,7 @@ fn main() {
     match status.code() {
         Some(i) => std::process::exit(i),
         None => {
-            eprintln!("rustc exited with {}", status);
+            eprintln!("rustc exited with {status}");
             std::process::exit(0xfe);
         }
     }
@@ -396,21 +396,20 @@ fn format_rusage_data(_child: Child) -> Option<String> {
     let minflt = rusage.ru_minflt;
     let majflt = rusage.ru_majflt;
     if minflt != 0 || majflt != 0 {
-        init_str.push_str(&format!(" page reclaims: {} page faults: {}", minflt, majflt));
+        init_str.push_str(&format!(" page reclaims: {minflt} page faults: {majflt}"));
     }
 
     let inblock = rusage.ru_inblock;
     let oublock = rusage.ru_oublock;
     if inblock != 0 || oublock != 0 {
-        init_str.push_str(&format!(" fs block inputs: {} fs block outputs: {}", inblock, oublock));
+        init_str.push_str(&format!(" fs block inputs: {inblock} fs block outputs: {oublock}"));
     }
 
     let nvcsw = rusage.ru_nvcsw;
     let nivcsw = rusage.ru_nivcsw;
     if nvcsw != 0 || nivcsw != 0 {
         init_str.push_str(&format!(
-            " voluntary ctxt switches: {} involuntary ctxt switches: {}",
-            nvcsw, nivcsw
+            " voluntary ctxt switches: {nvcsw} involuntary ctxt switches: {nivcsw}"
         ));
     }
 
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
index d2b85f7a629..4ecb3349816 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -62,7 +62,7 @@ fn main() {
     }
     if let Ok(no_threads) = env::var("RUSTDOC_LLD_NO_THREADS") {
         cmd.arg("-Clink-arg=-fuse-ld=lld");
-        cmd.arg(format!("-Clink-arg=-Wl,{}", no_threads));
+        cmd.arg(format!("-Clink-arg=-Wl,{no_threads}"));
     }
     // Cargo doesn't pass RUSTDOCFLAGS to proc_macros:
     // https://github.com/rust-lang/cargo/issues/4423
@@ -82,12 +82,12 @@ fn main() {
             env::join_paths(&dylib_path).unwrap(),
             cmd,
         );
-        eprintln!("sysroot: {:?}", sysroot);
-        eprintln!("libdir: {:?}", libdir);
+        eprintln!("sysroot: {sysroot:?}");
+        eprintln!("libdir: {libdir:?}");
     }
 
     std::process::exit(match cmd.status() {
         Ok(s) => s.code().unwrap_or(1),
-        Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
+        Err(e) => panic!("\n\nfailed to run {cmd:?}: {e}\n\n"),
     })
 }
diff --git a/src/bootstrap/bolt.rs b/src/bootstrap/bolt.rs
deleted file mode 100644
index 5384181ea68..00000000000
--- a/src/bootstrap/bolt.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-use std::path::Path;
-use std::process::Command;
-
-/// Uses the `llvm-bolt` binary to instrument the artifact at the given `path` with BOLT.
-/// When the instrumented artifact is executed, it will generate BOLT profiles into
-/// `/tmp/prof.fdata.<pid>.fdata`.
-/// Creates the instrumented artifact at `output_path`.
-pub fn instrument_with_bolt(path: &Path, output_path: &Path) {
-    let status = Command::new("llvm-bolt")
-        .arg("-instrument")
-        .arg(&path)
-        // Make sure that each process will write its profiles into a separate file
-        .arg("--instrumentation-file-append-pid")
-        .arg("-o")
-        .arg(output_path)
-        .status()
-        .expect("Could not instrument artifact using BOLT");
-
-    if !status.success() {
-        panic!("Could not instrument {} with BOLT, exit code {:?}", path.display(), status.code());
-    }
-}
-
-/// Uses the `llvm-bolt` binary to optimize the artifact at the given `path` with BOLT,
-/// using merged profiles from `profile_path`.
-///
-/// The recorded profiles have to be merged using the `merge-fdata` tool from LLVM and the merged
-/// profile path should be then passed to this function.
-///
-/// Creates the optimized artifact at `output_path`.
-pub fn optimize_with_bolt(path: &Path, profile_path: &Path, output_path: &Path) {
-    let status = Command::new("llvm-bolt")
-        .arg(&path)
-        .arg("-data")
-        .arg(&profile_path)
-        .arg("-o")
-        .arg(output_path)
-        // Reorder basic blocks within functions
-        .arg("-reorder-blocks=ext-tsp")
-        // Reorder functions within the binary
-        .arg("-reorder-functions=hfsort+")
-        // Split function code into hot and code regions
-        .arg("-split-functions")
-        // Split as many basic blocks as possible
-        .arg("-split-all-cold")
-        // Move jump tables to a separate section
-        .arg("-jump-tables=move")
-        // Fold functions with identical code
-        .arg("-icf=1")
-        // Update DWARF debug info in the final binary
-        .arg("-update-debug-sections")
-        // Print optimization statistics
-        .arg("-dyno-stats")
-        .status()
-        .expect("Could not optimize artifact using BOLT");
-
-    if !status.success() {
-        panic!("Could not optimize {} with BOLT, exit code {:?}", path.display(), status.code());
-    }
-}
diff --git a/src/bootstrap/build.rs b/src/bootstrap/build.rs
index cd1f418028c..e0e32d31353 100644
--- a/src/bootstrap/build.rs
+++ b/src/bootstrap/build.rs
@@ -3,5 +3,5 @@ use std::env;
 fn main() {
     let host = env::var("HOST").unwrap();
     println!("cargo:rerun-if-changed=build.rs");
-    println!("cargo:rustc-env=BUILD_TRIPLE={}", host);
+    println!("cargo:rustc-env=BUILD_TRIPLE={host}");
 }
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 1707dafb11a..d369e8eeda9 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -319,7 +319,7 @@ impl StepDescription {
     fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
         if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
             if !matches!(builder.config.dry_run, DryRun::SelfCheck) {
-                println!("Skipping {:?} because it is excluded", pathset);
+                println!("Skipping {pathset:?} because it is excluded");
             }
             return true;
         }
@@ -473,8 +473,7 @@ impl<'a> ShouldRun<'a> {
         // `compiler` and `library` folders respectively.
         assert!(
             self.kind == Kind::Setup || !self.builder.src.join(alias).exists(),
-            "use `builder.path()` for real paths: {}",
-            alias
+            "use `builder.path()` for real paths: {alias}"
         );
         self.paths.insert(PathSet::Set(
             std::iter::once(TaskPath { path: alias.into(), kind: Some(self.kind) }).collect(),
@@ -1283,7 +1282,7 @@ impl<'a> Builder<'a> {
                         out_dir.join(target.triple).join("doc")
                     }
                 }
-                _ => panic!("doc mode {:?} not expected", mode),
+                _ => panic!("doc mode {mode:?} not expected"),
             };
             let rustdoc = self.rustdoc(compiler);
             self.clear_if_dirty(&my_out, &rustdoc);
@@ -1637,15 +1636,15 @@ impl<'a> Builder<'a> {
                 // so. Note that this is definitely a hack, and we should likely
                 // flesh out rpath support more fully in the future.
                 rustflags.arg("-Zosx-rpath-install-name");
-                Some(format!("-Wl,-rpath,@loader_path/../{}", libdir))
+                Some(format!("-Wl,-rpath,@loader_path/../{libdir}"))
             } else if !target.contains("windows") && !target.contains("aix") {
                 rustflags.arg("-Clink-args=-Wl,-z,origin");
-                Some(format!("-Wl,-rpath,$ORIGIN/../{}", libdir))
+                Some(format!("-Wl,-rpath,$ORIGIN/../{libdir}"))
             } else {
                 None
             };
             if let Some(rpath) = rpath {
-                rustflags.arg(&format!("-Clink-args={}", rpath));
+                rustflags.arg(&format!("-Clink-args={rpath}"));
             }
         }
 
@@ -1659,7 +1658,7 @@ impl<'a> Builder<'a> {
 
         if let Some(target_linker) = self.linker(target) {
             let target = crate::envify(&target.triple);
-            cargo.env(&format!("CARGO_TARGET_{}_LINKER", target), target_linker);
+            cargo.env(&format!("CARGO_TARGET_{target}_LINKER"), target_linker);
         }
         if self.is_fuse_ld_lld(target) {
             rustflags.arg("-Clink-args=-fuse-ld=lld");
@@ -1895,24 +1894,24 @@ impl<'a> Builder<'a> {
             };
             let triple_underscored = target.triple.replace("-", "_");
             let cc = ccacheify(&self.cc(target));
-            cargo.env(format!("CC_{}", triple_underscored), &cc);
+            cargo.env(format!("CC_{triple_underscored}"), &cc);
 
             let cflags = self.cflags(target, GitRepo::Rustc, CLang::C).join(" ");
-            cargo.env(format!("CFLAGS_{}", triple_underscored), &cflags);
+            cargo.env(format!("CFLAGS_{triple_underscored}"), &cflags);
 
             if let Some(ar) = self.ar(target) {
                 let ranlib = format!("{} s", ar.display());
                 cargo
-                    .env(format!("AR_{}", triple_underscored), ar)
-                    .env(format!("RANLIB_{}", triple_underscored), ranlib);
+                    .env(format!("AR_{triple_underscored}"), ar)
+                    .env(format!("RANLIB_{triple_underscored}"), ranlib);
             }
 
             if let Ok(cxx) = self.cxx(target) {
                 let cxx = ccacheify(&cxx);
                 let cxxflags = self.cflags(target, GitRepo::Rustc, CLang::Cxx).join(" ");
                 cargo
-                    .env(format!("CXX_{}", triple_underscored), &cxx)
-                    .env(format!("CXXFLAGS_{}", triple_underscored), cxxflags);
+                    .env(format!("CXX_{triple_underscored}"), &cxx)
+                    .env(format!("CXXFLAGS_{triple_underscored}"), cxxflags);
             }
         }
 
@@ -2025,7 +2024,7 @@ impl<'a> Builder<'a> {
             if let Some(limit) = limit {
                 if stage == 0 || self.config.default_codegen_backend().unwrap_or_default() == "llvm"
                 {
-                    rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit));
+                    rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={limit}"));
                 }
             }
         }
@@ -2033,7 +2032,7 @@ impl<'a> Builder<'a> {
         if matches!(mode, Mode::Std) {
             if let Some(mir_opt_level) = self.config.rust_validate_mir_opts {
                 rustflags.arg("-Zvalidate-mir");
-                rustflags.arg(&format!("-Zmir-opt-level={}", mir_opt_level));
+                rustflags.arg(&format!("-Zmir-opt-level={mir_opt_level}"));
             }
             // Always enable inlining MIR when building the standard library.
             // Without this flag, MIR inlining is disabled when incremental compilation is enabled.
@@ -2065,9 +2064,9 @@ impl<'a> Builder<'a> {
                     continue;
                 }
                 let mut out = String::new();
-                out += &format!("\n\nCycle in build detected when adding {:?}\n", step);
+                out += &format!("\n\nCycle in build detected when adding {step:?}\n");
                 for el in stack.iter().rev() {
-                    out += &format!("\t{:?}\n", el);
+                    out += &format!("\t{el:?}\n");
                 }
                 panic!("{}", out);
             }
@@ -2094,7 +2093,7 @@ impl<'a> Builder<'a> {
         };
 
         if self.config.print_step_timings && !self.config.dry_run() {
-            let step_string = format!("{:?}", step);
+            let step_string = format!("{step:?}");
             let brace_index = step_string.find("{").unwrap_or(0);
             let type_string = type_name::<S>();
             println!(
@@ -2174,7 +2173,7 @@ impl<'a> Builder<'a> {
         let path = path.as_ref();
         self.info(&format!("Opening doc {}", path.display()));
         if let Err(err) = opener::open(path) {
-            self.info(&format!("{}\n", err));
+            self.info(&format!("{err}\n"));
         }
     }
 }
diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
index 5376c4ec9c3..53e4ff03431 100644
--- a/src/bootstrap/cache.rs
+++ b/src/bootstrap/cache.rs
@@ -75,7 +75,7 @@ where
 {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let s: &U = &*self;
-        f.write_fmt(format_args!("{:?}", s))
+        f.write_fmt(format_args!("{s:?}"))
     }
 }
 
@@ -236,7 +236,7 @@ impl Cache {
             .or_insert_with(|| Box::new(HashMap::<S, S::Output>::new()))
             .downcast_mut::<HashMap<S, S::Output>>()
             .expect("invalid type mapped");
-        assert!(!stepcache.contains_key(&step), "processing {:?} a second time", step);
+        assert!(!stepcache.contains_key(&step), "processing {step:?} a second time");
         stepcache.insert(step, value);
     }
 
diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
index ade3bfed11f..2496c2a9db5 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
@@ -196,7 +196,7 @@ fn set_compiler(
                 '0'..='6' => {}
                 _ => return,
             }
-            let alternative = format!("e{}", gnu_compiler);
+            let alternative = format!("e{gnu_compiler}");
             if Command::new(&alternative).output().is_ok() {
                 cfg.compiler(alternative);
             }
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 9795f22e2b5..2c51ed5408e 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -322,7 +322,7 @@ impl Step for CodegenBackend {
         );
         cargo
             .arg("--manifest-path")
-            .arg(builder.src.join(format!("compiler/rustc_codegen_{}/Cargo.toml", backend)));
+            .arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml")));
         rustc_cargo_env(builder, &mut cargo, target, compiler.stage);
 
         let _guard = builder.msg_check(&backend, target);
@@ -525,5 +525,5 @@ fn codegen_backend_stamp(
 ) -> PathBuf {
     builder
         .cargo_out(compiler, Mode::Codegen, target)
-        .join(format!(".librustc_codegen_{}-check.stamp", backend))
+        .join(format!(".librustc_codegen_{backend}-check.stamp"))
 }
diff --git a/src/bootstrap/clean.rs b/src/bootstrap/clean.rs
index ea8334eaeb6..7389816b44c 100644
--- a/src/bootstrap/clean.rs
+++ b/src/bootstrap/clean.rs
@@ -26,10 +26,15 @@ impl Step for CleanAll {
     }
 
     fn run(self, builder: &Builder<'_>) -> Self::Output {
-        let Subcommand::Clean { all, .. } = builder.config.cmd else {
+        let Subcommand::Clean { all, stage } = builder.config.cmd else {
             unreachable!("wrong subcommand?")
         };
-        clean_default(builder.build, all)
+
+        if all && stage.is_some() {
+            panic!("--all and --stage can't be used at the same time for `x clean`");
+        }
+
+        clean(builder.build, all, stage)
     }
 
     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
@@ -86,35 +91,70 @@ clean_crate_tree! {
     Std, Mode::Std, "sysroot";
 }
 
-fn clean_default(build: &Build, all: bool) {
+fn clean(build: &Build, all: bool, stage: Option<u32>) {
     if build.config.dry_run() {
         return;
     }
 
     rm_rf("tmp".as_ref());
 
+    // Clean the entire build directory
     if all {
         rm_rf(&build.out);
-    } else {
-        rm_rf(&build.out.join("tmp"));
-        rm_rf(&build.out.join("dist"));
-        rm_rf(&build.out.join("bootstrap"));
-        rm_rf(&build.out.join("rustfmt.stamp"));
-
-        for host in &build.hosts {
-            let entries = match build.out.join(host.triple).read_dir() {
-                Ok(iter) => iter,
-                Err(_) => continue,
-            };
-
-            for entry in entries {
-                let entry = t!(entry);
-                if entry.file_name().to_str() == Some("llvm") {
-                    continue;
-                }
-                let path = t!(entry.path().canonicalize());
-                rm_rf(&path);
+        return;
+    }
+
+    // Clean the target stage artifacts
+    if let Some(stage) = stage {
+        clean_specific_stage(build, stage);
+        return;
+    }
+
+    // Follow the default behaviour
+    clean_default(build);
+}
+
+fn clean_specific_stage(build: &Build, stage: u32) {
+    for host in &build.hosts {
+        let entries = match build.out.join(host.triple).read_dir() {
+            Ok(iter) => iter,
+            Err(_) => continue,
+        };
+
+        for entry in entries {
+            let entry = t!(entry);
+            let stage_prefix = format!("stage{}", stage);
+
+            // if current entry is not related with the target stage, continue
+            if !entry.file_name().to_str().unwrap_or("").contains(&stage_prefix) {
+                continue;
+            }
+
+            let path = t!(entry.path().canonicalize());
+            rm_rf(&path);
+        }
+    }
+}
+
+fn clean_default(build: &Build) {
+    rm_rf(&build.out.join("tmp"));
+    rm_rf(&build.out.join("dist"));
+    rm_rf(&build.out.join("bootstrap"));
+    rm_rf(&build.out.join("rustfmt.stamp"));
+
+    for host in &build.hosts {
+        let entries = match build.out.join(host.triple).read_dir() {
+            Ok(iter) => iter,
+            Err(_) => continue,
+        };
+
+        for entry in entries {
+            let entry = t!(entry);
+            if entry.file_name().to_str() == Some("llvm") {
+                continue;
             }
+            let path = t!(entry.path().canonicalize());
+            rm_rf(&path);
         }
     }
 }
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 400b07b1882..841288c5118 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -815,7 +815,7 @@ impl Step for Rustc {
 
         let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
             if compiler.stage == 1 {
-                cargo.rustflag(&format!("-Cprofile-generate={}", path));
+                cargo.rustflag(&format!("-Cprofile-generate={path}"));
                 // Apparently necessary to avoid overflowing the counters during
                 // a Cargo build profile
                 cargo.rustflag("-Cllvm-args=-vp-counters-per-site=4");
@@ -825,7 +825,7 @@ impl Step for Rustc {
             }
         } else if let Some(path) = &builder.config.rust_profile_use {
             if compiler.stage == 1 {
-                cargo.rustflag(&format!("-Cprofile-use={}", path));
+                cargo.rustflag(&format!("-Cprofile-use={path}"));
                 cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
                 true
             } else {
@@ -858,7 +858,7 @@ impl Step for Rustc {
                         RustcLto::Fat => "fat",
                         _ => unreachable!(),
                     };
-                    cargo.rustflag(&format!("-Clto={}", lto_type));
+                    cargo.rustflag(&format!("-Clto={lto_type}"));
                     cargo.rustflag("-Cembed-bitcode=yes");
                 }
                 RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
@@ -1192,7 +1192,7 @@ impl Step for CodegenBackend {
         let mut cargo = builder.cargo(compiler, Mode::Codegen, SourceType::InTree, target, "build");
         cargo
             .arg("--manifest-path")
-            .arg(builder.src.join(format!("compiler/rustc_codegen_{}/Cargo.toml", backend)));
+            .arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml")));
         rustc_cargo_env(builder, &mut cargo, target, compiler.stage);
 
         let tmp_stamp = out_dir.join(".tmp.stamp");
@@ -1297,7 +1297,7 @@ fn codegen_backend_stamp(
 ) -> PathBuf {
     builder
         .cargo_out(compiler, Mode::Codegen, target)
-        .join(format!(".librustc_codegen_{}.stamp", backend))
+        .join(format!(".librustc_codegen_{backend}.stamp"))
 }
 
 pub fn compiler_file(
@@ -1312,7 +1312,7 @@ pub fn compiler_file(
     }
     let mut cmd = Command::new(compiler);
     cmd.args(builder.cflags(target, GitRepo::Rustc, c));
-    cmd.arg(format!("-print-file-name={}", file));
+    cmd.arg(format!("-print-file-name={file}"));
     let out = output(&mut cmd);
     PathBuf::from(out.trim())
 }
@@ -1836,10 +1836,10 @@ pub fn run_cargo(
         });
         let path_to_add = match max {
             Some(triple) => triple.0.to_str().unwrap(),
-            None => panic!("no output generated for {:?} {:?}", prefix, extension),
+            None => panic!("no output generated for {prefix:?} {extension:?}"),
         };
         if is_dylib(path_to_add) {
-            let candidate = format!("{}.lib", path_to_add);
+            let candidate = format!("{path_to_add}.lib");
             let candidate = PathBuf::from(candidate);
             if candidate.exists() {
                 deps.push((candidate, DependencyType::Target));
@@ -1891,10 +1891,10 @@ pub fn stream_cargo(
         cargo.arg(arg);
     }
 
-    builder.verbose(&format!("running: {:?}", cargo));
+    builder.verbose(&format!("running: {cargo:?}"));
     let mut child = match cargo.spawn() {
         Ok(child) => child,
-        Err(e) => panic!("failed to execute command: {:?}\nerror: {}", cargo, e),
+        Err(e) => panic!("failed to execute command: {cargo:?}\nerror: {e}"),
     };
 
     // Spawn Cargo slurping up its JSON output. We'll start building up the
@@ -1907,12 +1907,12 @@ pub fn stream_cargo(
             Ok(msg) => {
                 if builder.config.json_output {
                     // Forward JSON to stdout.
-                    println!("{}", line);
+                    println!("{line}");
                 }
                 cb(msg)
             }
             // If this was informational, just print it out and continue
-            Err(_) => println!("{}", line),
+            Err(_) => println!("{line}"),
         }
     }
 
@@ -1920,9 +1920,8 @@ pub fn stream_cargo(
     let status = t!(child.wait());
     if builder.is_verbose() && !status.success() {
         eprintln!(
-            "command did not execute successfully: {:?}\n\
-                  expected success, got: {}",
-            cargo, status
+            "command did not execute successfully: {cargo:?}\n\
+                  expected success, got: {status}"
         );
     }
     status.success()
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 856a73a22b5..45bea9608fc 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -232,8 +232,8 @@ pub struct Config {
     pub llvm_profile_use: Option<String>,
     pub llvm_profile_generate: bool,
     pub llvm_libunwind_default: Option<LlvmLibunwind>,
-    pub llvm_bolt_profile_generate: bool,
-    pub llvm_bolt_profile_use: Option<String>,
+
+    pub reproducible_artifacts: Vec<String>,
 
     pub build: TargetSelection,
     pub hosts: Vec<TargetSelection>,
@@ -356,7 +356,7 @@ impl FromStr for LlvmLibunwind {
             "no" => Ok(Self::No),
             "in-tree" => Ok(Self::InTree),
             "system" => Ok(Self::System),
-            invalid => Err(format!("Invalid value '{}' for rust.llvm-libunwind config.", invalid)),
+            invalid => Err(format!("Invalid value '{invalid}' for rust.llvm-libunwind config.")),
         }
     }
 }
@@ -420,7 +420,7 @@ impl std::str::FromStr for RustcLto {
             "thin" => Ok(RustcLto::Thin),
             "fat" => Ok(RustcLto::Fat),
             "off" => Ok(RustcLto::Off),
-            _ => Err(format!("Invalid value for rustc LTO: {}", s)),
+            _ => Err(format!("Invalid value for rustc LTO: {s}")),
         }
     }
 }
@@ -498,7 +498,7 @@ impl fmt::Display for TargetSelection {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", self.triple)?;
         if let Some(file) = self.file {
-            write!(f, "({})", file)?;
+            write!(f, "({file})")?;
         }
         Ok(())
     }
@@ -506,7 +506,7 @@ impl fmt::Display for TargetSelection {
 
 impl fmt::Debug for TargetSelection {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        write!(f, "{}", self)
+        write!(f, "{self}")
     }
 }
 
@@ -938,8 +938,7 @@ impl<'de> serde::de::Visitor<'de> for OptimizeVisitor {
 
 fn format_optimize_error_msg(v: impl std::fmt::Display) -> String {
     format!(
-        r#"unrecognized option for rust optimize: "{}", expected one of 0, 1, 2, 3, "s", "z", true, false"#,
-        v
+        r#"unrecognized option for rust optimize: "{v}", expected one of 0, 1, 2, 3, "s", "z", true, false"#
     )
 }
 
@@ -1128,15 +1127,6 @@ impl Config {
         config.free_args = std::mem::take(&mut flags.free_args);
         config.llvm_profile_use = flags.llvm_profile_use;
         config.llvm_profile_generate = flags.llvm_profile_generate;
-        config.llvm_bolt_profile_generate = flags.llvm_bolt_profile_generate;
-        config.llvm_bolt_profile_use = flags.llvm_bolt_profile_use;
-
-        if config.llvm_bolt_profile_generate && config.llvm_bolt_profile_use.is_some() {
-            eprintln!(
-                "Cannot use both `llvm_bolt_profile_generate` and `llvm_bolt_profile_use` at the same time"
-            );
-            exit!(1);
-        }
 
         // Infer the rest of the configuration.
 
@@ -1226,7 +1216,7 @@ impl Config {
             include_path.push("src");
             include_path.push("bootstrap");
             include_path.push("defaults");
-            include_path.push(format!("config.{}.toml", include));
+            include_path.push(format!("config.{include}.toml"));
             let included_toml = get_toml(&include_path);
             toml.merge(included_toml, ReplaceOpt::IgnoreDuplicate);
         }
@@ -1472,6 +1462,8 @@ impl Config {
             config.rust_profile_generate = flags.rust_profile_generate;
         }
 
+        config.reproducible_artifacts = flags.reproducible_artifact;
+
         // rust_info must be set before is_ci_llvm_available() is called.
         let default = config.channel == "dev";
         config.omit_git_hash = omit_git_hash.unwrap_or(default);
@@ -1516,7 +1508,7 @@ impl Config {
             let asserts = llvm_assertions.unwrap_or(false);
             config.llvm_from_ci = match llvm.download_ci_llvm {
                 Some(StringOrBool::String(s)) => {
-                    assert!(s == "if-available", "unknown option `{}` for download-ci-llvm", s);
+                    assert!(s == "if-available", "unknown option `{s}` for download-ci-llvm");
                     crate::llvm::is_ci_llvm_available(&config, asserts)
                 }
                 Some(StringOrBool::Bool(b)) => b,
@@ -1750,7 +1742,7 @@ impl Config {
         if self.dry_run() {
             return Ok(());
         }
-        self.verbose(&format!("running: {:?}", cmd));
+        self.verbose(&format!("running: {cmd:?}"));
         build_helper::util::try_run(cmd, self.is_verbose())
     }
 
@@ -1790,10 +1782,10 @@ impl Config {
     pub(crate) fn artifact_version_part(&self, commit: &str) -> String {
         let (channel, version) = if self.rust_info.is_managed_git_subrepository() {
             let mut channel = self.git();
-            channel.arg("show").arg(format!("{}:src/ci/channel", commit));
+            channel.arg("show").arg(format!("{commit}:src/ci/channel"));
             let channel = output(&mut channel);
             let mut version = self.git();
-            version.arg("show").arg(format!("{}:src/version", commit));
+            version.arg("show").arg(format!("{commit}:src/version"));
             let version = output(&mut version);
             (channel.trim().to_owned(), version.trim().to_owned())
         } else {
@@ -1810,10 +1802,10 @@ impl Config {
                         "help: consider using a git checkout or ensure these files are readable"
                     );
                     if let Err(channel) = channel {
-                        eprintln!("reading {}/src/ci/channel failed: {:?}", src, channel);
+                        eprintln!("reading {src}/src/ci/channel failed: {channel:?}");
                     }
                     if let Err(version) = version {
-                        eprintln!("reading {}/src/version failed: {:?}", src, version);
+                        eprintln!("reading {src}/src/version failed: {version:?}");
                     }
                     panic!();
                 }
@@ -1939,7 +1931,7 @@ impl Config {
 
     pub fn verbose(&self, msg: &str) {
         if self.verbose > 0 {
-            println!("{}", msg);
+            println!("{msg}");
         }
     }
 
@@ -2016,8 +2008,7 @@ impl Config {
         {
             let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
             eprintln!(
-                "Unexpected rustc version: {}, we should use {}/{} to build source with {}",
-                rustc_version, prev_version, source_version, source_version
+                "Unexpected rustc version: {rustc_version}, we should use {prev_version}/{source_version} to build source with {source_version}"
             );
             exit!(1);
         }
@@ -2031,7 +2022,7 @@ impl Config {
             Some(StringOrBool::Bool(true)) => false,
             Some(StringOrBool::String(s)) if s == "if-unchanged" => true,
             Some(StringOrBool::String(other)) => {
-                panic!("unrecognized option for download-rustc: {}", other)
+                panic!("unrecognized option for download-rustc: {other}")
             }
         };
 
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index c8750c19388..32da4ac29a4 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -18,9 +18,7 @@ use std::process::Command;
 
 use object::read::archive::ArchiveFile;
 use object::BinaryFormat;
-use sha2::Digest;
 
-use crate::bolt::{instrument_with_bolt, optimize_with_bolt};
 use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
 use crate::cache::{Interned, INTERNER};
 use crate::channel;
@@ -162,7 +160,7 @@ fn find_files(files: &[&str], path: &[PathBuf]) -> Vec<PathBuf> {
         if let Some(file_path) = file_path {
             found.push(file_path);
         } else {
-            panic!("Could not find '{}' in {:?}", file, path);
+            panic!("Could not find '{file}' in {path:?}");
         }
     }
 
@@ -1480,8 +1478,8 @@ impl Step for Extended {
         rtf.push('}');
 
         fn filter(contents: &str, marker: &str) -> String {
-            let start = format!("tool-{}-start", marker);
-            let end = format!("tool-{}-end", marker);
+            let start = format!("tool-{marker}-start");
+            let end = format!("tool-{marker}-end");
             let mut lines = Vec::new();
             let mut omitted = false;
             for line in contents.lines() {
@@ -1862,7 +1860,7 @@ impl Step for Extended {
             builder.install(&etc.join("gfx/banner.bmp"), &exe, 0o644);
             builder.install(&etc.join("gfx/dialogbg.bmp"), &exe, 0o644);
 
-            builder.info(&format!("building `msi` installer with {:?}", light));
+            builder.info(&format!("building `msi` installer with {light:?}"));
             let filename = format!("{}-{}.msi", pkgname(builder, "rust"), target.triple);
             let mut cmd = Command::new(&light);
             cmd.arg("-nologo")
@@ -1941,19 +1939,7 @@ fn install_llvm_file(builder: &Builder<'_>, source: &Path, destination: &Path) {
         return;
     }
 
-    // After LLVM is built, we modify (instrument or optimize) the libLLVM.so library file.
-    // This is not done in-place so that the built LLVM files are not "tainted" with BOLT.
-    // We perform the instrumentation/optimization here, on the fly, just before they are being
-    // packaged into some destination directory.
-    let postprocessed = if builder.config.llvm_bolt_profile_generate {
-        builder.ensure(BoltInstrument::new(source.to_path_buf()))
-    } else if let Some(path) = &builder.config.llvm_bolt_profile_use {
-        builder.ensure(BoltOptimize::new(source.to_path_buf(), path.into()))
-    } else {
-        source.to_path_buf()
-    };
-
-    builder.install(&postprocessed, destination, 0o644);
+    builder.install(&source, destination, 0o644);
 }
 
 /// Maybe add LLVM object files to the given destination lib-dir. Allows either static or dynamic linking.
@@ -1996,7 +1982,7 @@ fn maybe_install_llvm(builder: &Builder<'_>, target: TargetSelection, dst_libdir
     {
         let mut cmd = Command::new(llvm_config);
         cmd.arg("--libfiles");
-        builder.verbose(&format!("running {:?}", cmd));
+        builder.verbose(&format!("running {cmd:?}"));
         let files = if builder.config.dry_run() { "".into() } else { output(&mut cmd) };
         let build_llvm_out = &builder.llvm_out(builder.config.build);
         let target_llvm_out = &builder.llvm_out(target);
@@ -2038,117 +2024,6 @@ pub fn maybe_install_llvm_runtime(builder: &Builder<'_>, target: TargetSelection
     }
 }
 
-/// Creates an output path to a BOLT-manipulated artifact for the given `file`.
-/// The hash of the file is used to make sure that we don't mix BOLT artifacts amongst different
-/// files with the same name.
-///
-/// We need to keep the file-name the same though, to make sure that copying the manipulated file
-/// to a directory will not change the final file path.
-fn create_bolt_output_path(builder: &Builder<'_>, file: &Path, hash: &str) -> PathBuf {
-    let directory = builder.out.join("bolt").join(hash);
-    t!(fs::create_dir_all(&directory));
-    directory.join(file.file_name().unwrap())
-}
-
-/// Instrument the provided file with BOLT.
-/// Returns a path to the instrumented artifact.
-#[derive(Clone, Debug, Eq, Hash, PartialEq)]
-pub struct BoltInstrument {
-    file: PathBuf,
-    hash: String,
-}
-
-impl BoltInstrument {
-    fn new(file: PathBuf) -> Self {
-        let mut hasher = sha2::Sha256::new();
-        hasher.update(t!(fs::read(&file)));
-        let hash = hex::encode(hasher.finalize().as_slice());
-
-        Self { file, hash }
-    }
-}
-
-impl Step for BoltInstrument {
-    type Output = PathBuf;
-
-    const ONLY_HOSTS: bool = false;
-    const DEFAULT: bool = false;
-
-    fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.never()
-    }
-
-    fn run(self, builder: &Builder<'_>) -> PathBuf {
-        if builder.build.config.dry_run() {
-            return self.file.clone();
-        }
-
-        if builder.build.config.llvm_from_ci {
-            println!("warning: trying to use BOLT with LLVM from CI, this will probably not work");
-        }
-
-        println!("Instrumenting {} with BOLT", self.file.display());
-
-        let output_path = create_bolt_output_path(builder, &self.file, &self.hash);
-        if !output_path.is_file() {
-            instrument_with_bolt(&self.file, &output_path);
-        }
-        output_path
-    }
-}
-
-/// Optimize the provided file with BOLT.
-/// Returns a path to the optimized artifact.
-///
-/// The hash is stored in the step to make sure that we don't optimize the same file
-/// twice (even under  different file paths).
-#[derive(Clone, Debug, Eq, Hash, PartialEq)]
-pub struct BoltOptimize {
-    file: PathBuf,
-    profile: PathBuf,
-    hash: String,
-}
-
-impl BoltOptimize {
-    fn new(file: PathBuf, profile: PathBuf) -> Self {
-        let mut hasher = sha2::Sha256::new();
-        hasher.update(t!(fs::read(&file)));
-        hasher.update(t!(fs::read(&profile)));
-        let hash = hex::encode(hasher.finalize().as_slice());
-
-        Self { file, profile, hash }
-    }
-}
-
-impl Step for BoltOptimize {
-    type Output = PathBuf;
-
-    const ONLY_HOSTS: bool = false;
-    const DEFAULT: bool = false;
-
-    fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.never()
-    }
-
-    fn run(self, builder: &Builder<'_>) -> PathBuf {
-        if builder.build.config.dry_run() {
-            return self.file.clone();
-        }
-
-        if builder.build.config.llvm_from_ci {
-            println!("warning: trying to use BOLT with LLVM from CI, this will probably not work");
-        }
-
-        println!("Optimizing {} with BOLT", self.file.display());
-
-        let output_path = create_bolt_output_path(builder, &self.file, &self.hash);
-        if !output_path.is_file() {
-            optimize_with_bolt(&self.file, &self.profile, &output_path);
-        }
-        output_path
-    }
-}
-
 #[derive(Clone, Debug, Eq, Hash, PartialEq)]
 pub struct LlvmTools {
     pub target: TargetSelection,
@@ -2175,7 +2050,7 @@ impl Step for LlvmTools {
         /* run only if llvm-config isn't used */
         if let Some(config) = builder.config.target_config.get(&target) {
             if let Some(ref _s) = config.llvm_config {
-                builder.info(&format!("Skipping LlvmTools ({}): external LLVM", target));
+                builder.info(&format!("Skipping LlvmTools ({target}): external LLVM"));
                 return None;
             }
         }
@@ -2231,7 +2106,7 @@ impl Step for RustDev {
         /* run only if llvm-config isn't used */
         if let Some(config) = builder.config.target_config.get(&target) {
             if let Some(ref _s) = config.llvm_config {
-                builder.info(&format!("Skipping RustDev ({}): external LLVM", target));
+                builder.info(&format!("Skipping RustDev ({target}): external LLVM"));
                 return None;
             }
         }
@@ -2390,8 +2265,8 @@ impl Step for ReproducibleArtifacts {
             tarball.add_file(path, ".", 0o644);
             added_anything = true;
         }
-        if let Some(path) = builder.config.llvm_bolt_profile_use.as_ref() {
-            tarball.add_file(path, ".", 0o644);
+        for profile in &builder.config.reproducible_artifacts {
+            tarball.add_file(profile, ".", 0o644);
             added_anything = true;
         }
         if added_anything { Some(tarball.generate()) } else { None }
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index 2ccbf179cca..9cb3546ba0a 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -147,7 +147,7 @@ impl<P: Step> Step for RustbookSrc<P> {
 
         if !builder.config.dry_run() && !(up_to_date(&src, &index) || up_to_date(&rustbook, &index))
         {
-            builder.info(&format!("Rustbook ({}) - {}", target, name));
+            builder.info(&format!("Rustbook ({target}) - {name}"));
             let _ = fs::remove_dir_all(&out);
 
             builder.run(rustbook_cmd.arg("build").arg(&src).arg("-d").arg(out));
@@ -219,7 +219,7 @@ impl Step for TheBook {
         for edition in &["first-edition", "second-edition", "2018-edition"] {
             builder.ensure(RustbookSrc {
                 target,
-                name: INTERNER.intern_string(format!("book/{}", edition)),
+                name: INTERNER.intern_string(format!("book/{edition}")),
                 src: INTERNER.intern_path(absolute_path.join(edition)),
                 // There should only be one book that is marked as the parent for each target, so
                 // treat the other editions as not having a parent.
@@ -966,7 +966,7 @@ impl Step for UnstableBookGen {
     fn run(self, builder: &Builder<'_>) {
         let target = self.target;
 
-        builder.info(&format!("Generating unstable book md files ({})", target));
+        builder.info(&format!("Generating unstable book md files ({target})"));
         let out = builder.md_doc_out(target).join("unstable-book");
         builder.create_dir(&out);
         builder.remove_dir(&out);
diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs
index 1316461fde0..a4135b06e9d 100644
--- a/src/bootstrap/download.rs
+++ b/src/bootstrap/download.rs
@@ -64,7 +64,7 @@ impl Config {
         if self.dry_run() {
             return true;
         }
-        self.verbose(&format!("running: {:?}", cmd));
+        self.verbose(&format!("running: {cmd:?}"));
         check_run(cmd, self.is_verbose())
     }
 
@@ -206,7 +206,7 @@ impl Config {
     }
 
     fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
-        println!("downloading {}", url);
+        println!("downloading {url}");
         // Try curl. If that fails and we are on windows, fallback to PowerShell.
         let mut curl = Command::new("curl");
         curl.args(&[
@@ -248,7 +248,7 @@ impl Config {
                 }
             }
             if !help_on_error.is_empty() {
-                eprintln!("{}", help_on_error);
+                eprintln!("{help_on_error}");
             }
             crate::exit!(1);
         }
@@ -646,7 +646,7 @@ download-rustc = false
     fn download_ci_llvm(&self, llvm_sha: &str) {
         let llvm_assertions = self.llvm_assertions;
 
-        let cache_prefix = format!("llvm-{}-{}", llvm_sha, llvm_assertions);
+        let cache_prefix = format!("llvm-{llvm_sha}-{llvm_assertions}");
         let cache_dst = self.out.join("cache");
         let rustc_cache = cache_dst.join(cache_prefix);
         if !rustc_cache.exists() {
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index d67aafff841..a1e0a440729 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -149,12 +149,9 @@ pub struct Flags {
     /// generate PGO profile with llvm built for rustc
     #[arg(global(true), long)]
     pub llvm_profile_generate: bool,
-    /// generate BOLT profile for LLVM build
+    /// Additional reproducible artifacts that should be added to the reproducible artifacts archive.
     #[arg(global(true), long)]
-    pub llvm_bolt_profile_generate: bool,
-    /// use BOLT profile for LLVM build
-    #[arg(global(true), value_hint = clap::ValueHint::FilePath, long, value_name = "PROFILE")]
-    pub llvm_bolt_profile_use: Option<String>,
+    pub reproducible_artifact: Vec<String>,
     #[arg(global(true))]
     /// paths for the subcommand
     pub paths: Vec<PathBuf>,
@@ -189,7 +186,7 @@ impl Flags {
             let build = Build::new(config);
             let paths = Builder::get_help(&build, subcommand);
             if let Some(s) = paths {
-                println!("{}", s);
+                println!("{s}");
             } else {
                 panic!("No paths available for subcommand `{}`", subcommand.as_str());
             }
@@ -366,7 +363,11 @@ pub enum Subcommand {
     /// Clean out build directories
     Clean {
         #[arg(long)]
+        /// Clean the entire build directory (not used by default)
         all: bool,
+        #[arg(long, value_name = "N")]
+        /// Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used.
+        stage: Option<u32>,
     },
     /// Build distribution artifacts
     Dist,
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index cfc9c4de60f..3f9230aa5d5 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -22,7 +22,7 @@ fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> impl F
         cmd.arg("--check");
     }
     cmd.args(paths);
-    let cmd_debug = format!("{:?}", cmd);
+    let cmd_debug = format!("{cmd:?}");
     let mut cmd = cmd.spawn().expect("running rustfmt");
     // poor man's async: return a closure that'll wait for rustfmt's completion
     move |block: bool| -> bool {
@@ -115,7 +115,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
     let rustfmt_config: RustfmtConfig = t!(toml::from_str(&rustfmt_config));
     let mut ignore_fmt = ignore::overrides::OverrideBuilder::new(&build.src);
     for ignore in rustfmt_config.ignore {
-        ignore_fmt.add(&format!("!{}", ignore)).expect(&ignore);
+        ignore_fmt.add(&format!("!{ignore}")).expect(&ignore);
     }
     let git_available = match Command::new("git")
         .arg("--version")
@@ -153,13 +153,13 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
                     entry.split(' ').nth(1).expect("every git status entry should list a path")
                 });
             for untracked_path in untracked_paths {
-                println!("skip untracked path {} during rustfmt invocations", untracked_path);
+                println!("skip untracked path {untracked_path} during rustfmt invocations");
                 // The leading `/` makes it an exact match against the
                 // repository root, rather than a glob. Without that, if you
                 // have `foo.rs` in the repository root it will also match
                 // against anything like `compiler/rustc_foo/src/foo.rs`,
                 // preventing the latter from being formatted.
-                ignore_fmt.add(&format!("!/{}", untracked_path)).expect(&untracked_path);
+                ignore_fmt.add(&format!("!/{untracked_path}")).expect(&untracked_path);
             }
             // Only check modified files locally to speed up runtime.
             // We still check all files in CI to avoid bugs in `get_modified_rs_files` letting regressions slip through;
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 365deb8e155..8c674d075b8 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -39,7 +39,6 @@ use crate::util::{
     dir_is_empty, exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed,
 };
 
-mod bolt;
 mod builder;
 mod cache;
 mod cc_detect;
@@ -484,7 +483,7 @@ impl Build {
             .unwrap()
             .trim();
         if local_release.split('.').take(2).eq(version.split('.').take(2)) {
-            build.verbose(&format!("auto-detected local-rebuild {}", local_release));
+            build.verbose(&format!("auto-detected local-rebuild {local_release}"));
             build.local_rebuild = true;
         }
 
@@ -713,7 +712,7 @@ impl Build {
         if failures.len() > 0 {
             eprintln!("\n{} command(s) did not execute successfully:\n", failures.len());
             for failure in failures.iter() {
-                eprintln!("  - {}\n", failure);
+                eprintln!("  - {failure}\n");
             }
             exit!(1);
         }
@@ -959,7 +958,7 @@ impl Build {
         if self.config.dry_run() {
             return;
         }
-        self.verbose(&format!("running: {:?}", cmd));
+        self.verbose(&format!("running: {cmd:?}"));
         run(cmd, self.is_verbose())
     }
 
@@ -968,7 +967,7 @@ impl Build {
         if self.config.dry_run() {
             return;
         }
-        self.verbose(&format!("running: {:?}", cmd));
+        self.verbose(&format!("running: {cmd:?}"));
         run_suppressed(cmd)
     }
 
@@ -980,10 +979,10 @@ impl Build {
             return true;
         }
         if !self.fail_fast {
-            self.verbose(&format!("running: {:?}", cmd));
+            self.verbose(&format!("running: {cmd:?}"));
             if !try_run_suppressed(cmd) {
                 let mut failures = self.delayed_failures.borrow_mut();
-                failures.push(format!("{:?}", cmd));
+                failures.push(format!("{cmd:?}"));
                 return false;
             }
         } else {
@@ -998,7 +997,7 @@ impl Build {
             #[allow(deprecated)] // can't use Build::try_run, that's us
             if self.config.try_run(cmd).is_err() {
                 let mut failures = self.delayed_failures.borrow_mut();
-                failures.push(format!("{:?}", cmd));
+                failures.push(format!("{cmd:?}"));
                 return false;
             }
         } else {
@@ -1014,7 +1013,7 @@ impl Build {
     /// Prints a message if this build is configured in more verbose mode than `level`.
     fn verbose_than(&self, level: usize, msg: &str) {
         if self.is_verbose_than(level) {
-            println!("{}", msg);
+            println!("{msg}");
         }
     }
 
@@ -1022,7 +1021,7 @@ impl Build {
         match self.config.dry_run {
             DryRun::SelfCheck => return,
             DryRun::Disabled | DryRun::UserSelected => {
-                println!("{}", msg);
+                println!("{msg}");
             }
         }
     }
@@ -1147,7 +1146,7 @@ impl Build {
         match which {
             GitRepo::Rustc => {
                 let sha = self.rust_sha().unwrap_or(&self.version);
-                Some(format!("/rustc/{}", sha))
+                Some(format!("/rustc/{sha}"))
             }
             GitRepo::Llvm => Some(String::from("/rustc/llvm")),
         }
@@ -1200,10 +1199,10 @@ impl Build {
             let map = format!("{}={}", self.src.display(), map_to);
             let cc = self.cc(target);
             if cc.ends_with("clang") || cc.ends_with("gcc") {
-                base.push(format!("-fdebug-prefix-map={}", map));
+                base.push(format!("-fdebug-prefix-map={map}"));
             } else if cc.ends_with("clang-cl.exe") {
                 base.push("-Xclang".into());
-                base.push(format!("-fdebug-prefix-map={}", map));
+                base.push(format!("-fdebug-prefix-map={map}"));
             }
         }
         base
@@ -1232,9 +1231,7 @@ impl Build {
         }
         match self.cxx.borrow().get(&target) {
             Some(p) => Ok(p.path().into()),
-            None => {
-                Err(format!("target `{}` is not configured as a host, only as a target", target))
-            }
+            None => Err(format!("target `{target}` is not configured as a host, only as a target")),
         }
     }
 
@@ -1277,7 +1274,7 @@ impl Build {
             }
 
             let no_threads = util::lld_flag_no_threads(target.contains("windows"));
-            options[1] = Some(format!("-Clink-arg=-Wl,{}", no_threads));
+            options[1] = Some(format!("-Clink-arg=-Wl,{no_threads}"));
         }
 
         IntoIterator::into_iter(options).flatten()
@@ -1404,11 +1401,11 @@ impl Build {
                 if !self.config.omit_git_hash {
                     format!("{}-beta.{}", num, self.beta_prerelease_version())
                 } else {
-                    format!("{}-beta", num)
+                    format!("{num}-beta")
                 }
             }
-            "nightly" => format!("{}-nightly", num),
-            _ => format!("{}-dev", num),
+            "nightly" => format!("{num}-nightly"),
+            _ => format!("{num}-dev"),
         }
     }
 
@@ -1456,7 +1453,7 @@ impl Build {
             "stable" => num.to_string(),
             "beta" => "beta".to_string(),
             "nightly" => "nightly".to_string(),
-            _ => format!("{}-dev", num),
+            _ => format!("{num}-dev"),
         }
     }
 
@@ -1487,7 +1484,7 @@ impl Build {
 
     /// Returns the `a.b.c` version that the given package is at.
     fn release_num(&self, package: &str) -> String {
-        let toml_file_name = self.src.join(&format!("src/tools/{}/Cargo.toml", package));
+        let toml_file_name = self.src.join(&format!("src/tools/{package}/Cargo.toml"));
         let toml = t!(fs::read_to_string(&toml_file_name));
         for line in toml.lines() {
             if let Some(stripped) =
@@ -1497,7 +1494,7 @@ impl Build {
             }
         }
 
-        panic!("failed to find version in {}'s Cargo.toml", package)
+        panic!("failed to find version in {package}'s Cargo.toml")
     }
 
     /// Returns `true` if unstable features should be enabled for the compiler
@@ -1589,7 +1586,7 @@ impl Build {
         if self.config.dry_run() {
             return;
         }
-        self.verbose_than(1, &format!("Copy {:?} to {:?}", src, dst));
+        self.verbose_than(1, &format!("Copy {src:?} to {dst:?}"));
         if src == dst {
             return;
         }
@@ -1680,7 +1677,7 @@ impl Build {
             return;
         }
         let dst = dstdir.join(src.file_name().unwrap());
-        self.verbose_than(1, &format!("Install {:?} to {:?}", src, dst));
+        self.verbose_than(1, &format!("Install {src:?} to {dst:?}"));
         t!(fs::create_dir_all(dstdir));
         if !src.exists() {
             panic!("Error: File \"{}\" not found!", src.display());
@@ -1714,7 +1711,7 @@ impl Build {
         let iter = match fs::read_dir(dir) {
             Ok(v) => v,
             Err(_) if self.config.dry_run() => return vec![].into_iter(),
-            Err(err) => panic!("could not read dir {:?}: {:?}", dir, err),
+            Err(err) => panic!("could not read dir {dir:?}: {err:?}"),
         };
         iter.map(|e| t!(e)).collect::<Vec<_>>().into_iter()
     }
diff --git a/src/bootstrap/llvm.rs b/src/bootstrap/llvm.rs
index 02fef4b3e83..81b88d5de98 100644
--- a/src/bootstrap/llvm.rs
+++ b/src/bootstrap/llvm.rs
@@ -342,12 +342,6 @@ impl Step for Llvm {
         if let Some(path) = builder.config.llvm_profile_use.as_ref() {
             cfg.define("LLVM_PROFDATA_FILE", &path);
         }
-        if builder.config.llvm_bolt_profile_generate
-            || builder.config.llvm_bolt_profile_use.is_some()
-        {
-            // Relocations are required for BOLT to work.
-            ldflags.push_all("-Wl,-q");
-        }
 
         // Disable zstd to avoid a dependency on libzstd.so.
         cfg.define("LLVM_ENABLE_ZSTD", "OFF");
@@ -500,8 +494,8 @@ impl Step for Llvm {
             let version = output(cmd.arg("--version"));
             let major = version.split('.').next().unwrap();
             let lib_name = match llvm_version_suffix {
-                Some(s) => format!("libLLVM-{}{}.dylib", major, s),
-                None => format!("libLLVM-{}.dylib", major),
+                Some(s) => format!("libLLVM-{major}{s}.dylib"),
+                None => format!("libLLVM-{major}.dylib"),
             };
 
             let lib_llvm = out_dir.join("build").join("lib").join(lib_name);
@@ -525,11 +519,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
     let version = output(cmd.arg("--version"));
     let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
     if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
-        if major >= 14 {
+        if major >= 15 {
             return;
         }
     }
-    panic!("\n\nbad LLVM version: {}, need >=14.0\n\n", version)
+    panic!("\n\nbad LLVM version: {version}, need >=15.0\n\n")
 }
 
 fn configure_cmake(
@@ -686,10 +680,10 @@ fn configure_cmake(
         }
     }
     if builder.config.llvm_clang_cl.is_some() {
-        cflags.push(&format!(" --target={}", target));
+        cflags.push(&format!(" --target={target}"));
     }
     for flag in extra_compiler_flags {
-        cflags.push(&format!(" {}", flag));
+        cflags.push(&format!(" {flag}"));
     }
     cfg.define("CMAKE_C_FLAGS", cflags);
     let mut cxxflags: OsString = builder.cflags(target, GitRepo::Llvm, CLang::Cxx).join(" ").into();
@@ -698,10 +692,10 @@ fn configure_cmake(
         cxxflags.push(s);
     }
     if builder.config.llvm_clang_cl.is_some() {
-        cxxflags.push(&format!(" --target={}", target));
+        cxxflags.push(&format!(" --target={target}"));
     }
     for flag in extra_compiler_flags {
-        cxxflags.push(&format!(" {}", flag));
+        cxxflags.push(&format!(" {flag}"));
     }
     cfg.define("CMAKE_CXX_FLAGS", cxxflags);
     if let Some(ar) = builder.ar(target) {
@@ -772,7 +766,7 @@ fn configure_llvm(builder: &Builder<'_>, target: TargetSelection, cfg: &mut cmak
 fn get_var(var_base: &str, host: &str, target: &str) -> Option<OsString> {
     let kind = if host == target { "HOST" } else { "TARGET" };
     let target_u = target.replace("-", "_");
-    env::var_os(&format!("{}_{}", var_base, target))
+    env::var_os(&format!("{var_base}_{target}"))
         .or_else(|| env::var_os(&format!("{}_{}", var_base, target_u)))
         .or_else(|| env::var_os(&format!("{}_{}", kind, var_base)))
         .or_else(|| env::var_os(var_base))
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 145ae6f44da..7e83b508e94 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -188,7 +188,7 @@ than building it.
         // Externally configured LLVM requires FileCheck to exist
         let filecheck = build.llvm_filecheck(build.build);
         if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
-            panic!("FileCheck executable {:?} does not exist", filecheck);
+            panic!("FileCheck executable {filecheck:?} does not exist");
         }
     }
 
diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs
index 2075c58598d..30730f50491 100644
--- a/src/bootstrap/setup.rs
+++ b/src/bootstrap/setup.rs
@@ -32,6 +32,7 @@ static SETTINGS_HASHES: &[&str] = &[
     "56e7bf011c71c5d81e0bf42e84938111847a810eee69d906bba494ea90b51922",
     "af1b5efe196aed007577899db9dae15d6dbc923d6fa42fa0934e68617ba9bbe0",
     "3468fea433c25fff60be6b71e8a215a732a7b1268b6a83bf10d024344e140541",
+    "47d227f424bf889b0d899b9cc992d5695e1b78c406e183cd78eafefbe5488923",
 ];
 static RUST_ANALYZER_SETTINGS: &str = include_str!("../etc/rust_analyzer_settings.json");
 
@@ -92,7 +93,7 @@ impl FromStr for Profile {
                 Ok(Profile::Tools)
             }
             "none" => Ok(Profile::None),
-            _ => Err(format!("unknown profile: '{}'", s)),
+            _ => Err(format!("unknown profile: '{s}'")),
         }
     }
 }
@@ -167,7 +168,7 @@ pub fn setup(config: &Config, profile: Profile) {
 
     println!("To get started, try one of the following commands:");
     for cmd in suggestions {
-        println!("- `x.py {}`", cmd);
+        println!("- `x.py {cmd}`");
     }
 
     if profile != Profile::Dist {
@@ -208,9 +209,8 @@ fn setup_config_toml(path: &PathBuf, profile: Profile, config: &Config) {
 
     let settings = format!(
         "# Includes one of the default files in src/bootstrap/defaults\n\
-    profile = \"{}\"\n\
-    changelog-seen = {}\n",
-        profile, VERSION
+    profile = \"{profile}\"\n\
+    changelog-seen = {VERSION}\n"
     );
 
     t!(fs::write(path, settings));
@@ -341,7 +341,7 @@ fn ensure_stage1_toolchain_placeholder_exists(stage_path: &str) -> bool {
         return false;
     };
 
-    let pathbuf = pathbuf.join(format!("rustc{}", EXE_SUFFIX));
+    let pathbuf = pathbuf.join(format!("rustc{EXE_SUFFIX}"));
 
     if pathbuf.exists() {
         return true;
@@ -394,7 +394,7 @@ pub fn interactive_path() -> io::Result<Profile> {
         break match parse_with_abbrev(&input) {
             Ok(profile) => profile,
             Err(err) => {
-                eprintln!("error: {}", err);
+                eprintln!("error: {err}");
                 eprintln!("note: press Ctrl+C to exit");
                 continue;
             }
diff --git a/src/bootstrap/tarball.rs b/src/bootstrap/tarball.rs
index 7fa8a4d9d7f..95d909c5730 100644
--- a/src/bootstrap/tarball.rs
+++ b/src/bootstrap/tarball.rs
@@ -309,7 +309,7 @@ impl<'a> Tarball<'a> {
         let mut cmd = self.builder.tool_cmd(crate::tool::Tool::RustInstaller);
 
         let package_name = self.package_name();
-        self.builder.info(&format!("Dist {}", package_name));
+        self.builder.info(&format!("Dist {package_name}"));
         let _time = crate::util::timeit(self.builder);
 
         build_cli(&self, &mut cmd);
@@ -344,7 +344,7 @@ impl<'a> Tarball<'a> {
             .unwrap_or("gz");
 
         GeneratedTarball {
-            path: crate::dist::distdir(self.builder).join(format!("{}.tar.{}", package_name, ext)),
+            path: crate::dist::distdir(self.builder).join(format!("{package_name}.tar.{ext}")),
             decompressed_output,
             work: self.temp_dir,
         }
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 1fe92098fd6..4bfb16928f1 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -126,7 +126,7 @@ You can skip linkcheck with --exclude src/tools/linkchecker"
             );
         }
 
-        builder.info(&format!("Linkcheck ({})", host));
+        builder.info(&format!("Linkcheck ({host})"));
 
         // Test the linkchecker itself.
         let bootstrap_host = builder.config.build;
@@ -430,10 +430,6 @@ impl Step for Rustfmt {
             &[],
         );
 
-        if builder.config.cmd.bless() {
-            cargo.env("BLESS", "1");
-        }
-
         let dir = testdir(builder, compiler.host);
         t!(fs::create_dir_all(&dir));
         cargo.env("RUSTFMT_TEST_DIR", dir);
@@ -561,7 +557,7 @@ impl Miri {
         if builder.config.dry_run() {
             String::new()
         } else {
-            builder.verbose(&format!("running: {:?}", cargo));
+            builder.verbose(&format!("running: {cargo:?}"));
             let out =
                 cargo.output().expect("We already ran `cargo miri setup` before and that worked");
             assert!(out.status.success(), "`cargo miri setup` returned with non-0 exit code");
@@ -569,7 +565,7 @@ impl Miri {
             let stdout = String::from_utf8(out.stdout)
                 .expect("`cargo miri setup` stdout is not valid UTF-8");
             let sysroot = stdout.trim_end();
-            builder.verbose(&format!("`cargo miri setup --print-sysroot` said: {:?}", sysroot));
+            builder.verbose(&format!("`cargo miri setup --print-sysroot` said: {sysroot:?}"));
             sysroot.to_owned()
         }
     }
@@ -633,10 +629,6 @@ impl Step for Miri {
         cargo.env("MIRI_SYSROOT", &miri_sysroot);
         cargo.env("MIRI_HOST_SYSROOT", sysroot);
         cargo.env("MIRI", &miri);
-        // propagate --bless
-        if builder.config.cmd.bless() {
-            cargo.env("MIRI_BLESS", "Gesundheit");
-        }
 
         // Set the target.
         cargo.env("MIRI_TEST_TARGET", target.rustc_target_arg());
@@ -654,8 +646,8 @@ impl Step for Miri {
             cargo.env("MIRIFLAGS", "-O -Zmir-opt-level=4 -Cdebug-assertions=yes");
             // Optimizations can change backtraces
             cargo.env("MIRI_SKIP_UI_CHECKS", "1");
-            // `MIRI_SKIP_UI_CHECKS` and `MIRI_BLESS` are incompatible
-            cargo.env_remove("MIRI_BLESS");
+            // `MIRI_SKIP_UI_CHECKS` and `RUSTC_BLESS` are incompatible
+            cargo.env_remove("RUSTC_BLESS");
             // Optimizations can change error locations and remove UB so don't run `fail` tests.
             cargo.args(&["tests/pass", "tests/panic"]);
 
@@ -799,11 +791,6 @@ impl Step for Clippy {
         cargo.add_rustc_lib_path(builder, compiler);
         let mut cargo = prepare_cargo_test(cargo, &[], &[], "clippy", compiler, host, builder);
 
-        // propagate --bless
-        if builder.config.cmd.bless() {
-            cargo.env("BLESS", "Gesundheit");
-        }
-
         let _guard = builder.msg_sysroot_tool(Kind::Test, compiler.stage, "clippy", host, host);
 
         #[allow(deprecated)] // Clippy reports errors if it blessed the outputs
@@ -2245,9 +2232,11 @@ fn prepare_cargo_test(
 ) -> Command {
     let mut cargo = cargo.into();
 
-    // If bless is passed, give downstream crates a way to use it
-    if builder.config.cmd.bless() {
-        cargo.env("RUSTC_BLESS", "1");
+    // Propegate `--bless` if it has not already been set/unset
+    // Any tools that want to use this should bless if `RUSTC_BLESS` is set to
+    // anything other than `0`.
+    if builder.config.cmd.bless() && !cargo.get_envs().any(|v| v.0 == "RUSTC_BLESS") {
+        cargo.env("RUSTC_BLESS", "Gesundheit");
     }
 
     // Pass in some standard flags then iterate over the graph we've discovered
@@ -2591,7 +2580,7 @@ impl Step for RemoteCopyLibs {
 
         builder.ensure(compile::Std::new(compiler, target));
 
-        builder.info(&format!("REMOTE copy libs to emulator ({})", target));
+        builder.info(&format!("REMOTE copy libs to emulator ({target})"));
 
         let server = builder.ensure(tool::RemoteTestServer { compiler, target });
 
diff --git a/src/bootstrap/toolstate.rs b/src/bootstrap/toolstate.rs
index eb65c8bee09..308023537d5 100644
--- a/src/bootstrap/toolstate.rs
+++ b/src/bootstrap/toolstate.rs
@@ -83,13 +83,13 @@ static NIGHTLY_TOOLS: &[(&str, &str)] = &[
 
 fn print_error(tool: &str, submodule: &str) {
     eprintln!();
-    eprintln!("We detected that this PR updated '{}', but its tests failed.", tool);
+    eprintln!("We detected that this PR updated '{tool}', but its tests failed.");
     eprintln!();
-    eprintln!("If you do intend to update '{}', please check the error messages above and", tool);
+    eprintln!("If you do intend to update '{tool}', please check the error messages above and");
     eprintln!("commit another update.");
     eprintln!();
-    eprintln!("If you do NOT intend to update '{}', please ensure you did not accidentally", tool);
-    eprintln!("change the submodule at '{}'. You may ask your reviewer for the", submodule);
+    eprintln!("If you do NOT intend to update '{tool}', please ensure you did not accidentally");
+    eprintln!("change the submodule at '{submodule}'. You may ask your reviewer for the");
     eprintln!("proper steps.");
     crate::exit!(3);
 }
@@ -105,7 +105,7 @@ fn check_changed_files(toolstates: &HashMap<Box<str>, ToolState>) {
     let output = match output {
         Ok(o) => o,
         Err(e) => {
-            eprintln!("Failed to get changed files: {:?}", e);
+            eprintln!("Failed to get changed files: {e:?}");
             crate::exit!(1);
         }
     };
@@ -114,12 +114,12 @@ fn check_changed_files(toolstates: &HashMap<Box<str>, ToolState>) {
 
     for (tool, submodule) in STABLE_TOOLS.iter().chain(NIGHTLY_TOOLS.iter()) {
         let changed = output.lines().any(|l| l.starts_with('M') && l.ends_with(submodule));
-        eprintln!("Verifying status of {}...", tool);
+        eprintln!("Verifying status of {tool}...");
         if !changed {
             continue;
         }
 
-        eprintln!("This PR updated '{}', verifying if status is 'test-pass'...", submodule);
+        eprintln!("This PR updated '{submodule}', verifying if status is 'test-pass'...");
         if toolstates[*tool] != ToolState::TestPass {
             print_error(tool, submodule);
         }
@@ -172,7 +172,7 @@ impl Step for ToolStateCheck {
         for (tool, _) in STABLE_TOOLS.iter().chain(NIGHTLY_TOOLS.iter()) {
             if !toolstates.contains_key(*tool) {
                 did_error = true;
-                eprintln!("error: Tool `{}` was not recorded in tool state.", tool);
+                eprintln!("error: Tool `{tool}` was not recorded in tool state.");
             }
         }
 
@@ -190,7 +190,7 @@ impl Step for ToolStateCheck {
             if state != ToolState::TestPass {
                 if !is_nightly {
                     did_error = true;
-                    eprintln!("error: Tool `{}` should be test-pass but is {}", tool, state);
+                    eprintln!("error: Tool `{tool}` should be test-pass but is {state}");
                 } else if in_beta_week {
                     let old_state = old_toolstate
                         .iter()
@@ -200,17 +200,15 @@ impl Step for ToolStateCheck {
                     if state < old_state {
                         did_error = true;
                         eprintln!(
-                            "error: Tool `{}` has regressed from {} to {} during beta week.",
-                            tool, old_state, state
+                            "error: Tool `{tool}` has regressed from {old_state} to {state} during beta week."
                         );
                     } else {
                         // This warning only appears in the logs, which most
                         // people won't read. It's mostly here for testing and
                         // debugging.
                         eprintln!(
-                            "warning: Tool `{}` is not test-pass (is `{}`), \
-                            this should be fixed before beta is branched.",
-                            tool, state
+                            "warning: Tool `{tool}` is not test-pass (is `{state}`), \
+                            this should be fixed before beta is branched."
                         );
                     }
                 }
@@ -323,7 +321,7 @@ fn checkout_toolstate_repo() {
         Err(_) => false,
     };
     if !success {
-        panic!("git clone unsuccessful (status: {:?})", status);
+        panic!("git clone unsuccessful (status: {status:?})");
     }
 }
 
@@ -336,7 +334,7 @@ fn prepare_toolstate_config(token: &str) {
             Err(_) => false,
         };
         if !success {
-            panic!("git config key={} value={} failed (status: {:?})", key, value, status);
+            panic!("git config key={key} value={value} failed (status: {status:?})");
         }
     }
 
@@ -346,7 +344,7 @@ fn prepare_toolstate_config(token: &str) {
     git_config("user.name", "Rust Toolstate Update");
     git_config("credential.helper", "store");
 
-    let credential = format!("https://{}:x-oauth-basic@github.com\n", token,);
+    let credential = format!("https://{token}:x-oauth-basic@github.com\n",);
     let git_credential_path = PathBuf::from(t!(env::var("HOME"))).join(".git-credentials");
     t!(fs::write(&git_credential_path, credential));
 }
diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs
index 84ed2985464..3c4a21434c0 100644
--- a/src/bootstrap/util.rs
+++ b/src/bootstrap/util.rs
@@ -46,9 +46,9 @@ pub use t;
 /// executable for a particular target.
 pub fn exe(name: &str, target: TargetSelection) -> String {
     if target.contains("windows") {
-        format!("{}.exe", name)
+        format!("{name}.exe")
     } else if target.contains("uefi") {
-        format!("{}.efi", name)
+        format!("{name}.efi")
     } else {
         name.to_string()
     }
@@ -161,9 +161,8 @@ pub fn forcing_clang_based_tests() -> bool {
             other => {
                 // Let's make sure typos don't go unnoticed
                 panic!(
-                    "Unrecognized option '{}' set in \
-                        RUSTBUILD_FORCE_CLANG_BASED_TESTS",
-                    other
+                    "Unrecognized option '{other}' set in \
+                        RUSTBUILD_FORCE_CLANG_BASED_TESTS"
                 )
             }
         }
@@ -227,15 +226,14 @@ pub fn check_run(cmd: &mut Command, print_cmd_on_fail: bool) -> bool {
     let status = match cmd.status() {
         Ok(status) => status,
         Err(e) => {
-            println!("failed to execute command: {:?}\nerror: {}", cmd, e);
+            println!("failed to execute command: {cmd:?}\nerror: {e}");
             return false;
         }
     };
     if !status.success() && print_cmd_on_fail {
         println!(
-            "\n\ncommand did not execute successfully: {:?}\n\
-             expected success, got: {}\n\n",
-            cmd, status
+            "\n\ncommand did not execute successfully: {cmd:?}\n\
+             expected success, got: {status}\n\n"
         );
     }
     status.success()
@@ -250,7 +248,7 @@ pub fn run_suppressed(cmd: &mut Command) {
 pub fn try_run_suppressed(cmd: &mut Command) -> bool {
     let output = match cmd.output() {
         Ok(status) => status,
-        Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}", cmd, e)),
+        Err(e) => fail(&format!("failed to execute command: {cmd:?}\nerror: {e}")),
     };
     if !output.status.success() {
         println!(
@@ -283,7 +281,7 @@ pub fn make(host: &str) -> PathBuf {
 pub fn output(cmd: &mut Command) -> String {
     let output = match cmd.stderr(Stdio::inherit()).output() {
         Ok(status) => status,
-        Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}", cmd, e)),
+        Err(e) => fail(&format!("failed to execute command: {cmd:?}\nerror: {e}")),
     };
     if !output.status.success() {
         panic!(
@@ -298,7 +296,7 @@ pub fn output(cmd: &mut Command) -> String {
 pub fn output_result(cmd: &mut Command) -> Result<String, String> {
     let output = match cmd.stderr(Stdio::inherit()).output() {
         Ok(status) => status,
-        Err(e) => return Err(format!("failed to run command: {:?}: {}", cmd, e)),
+        Err(e) => return Err(format!("failed to run command: {cmd:?}: {e}")),
     };
     if !output.status.success() {
         return Err(format!(
@@ -328,7 +326,7 @@ pub fn up_to_date(src: &Path, dst: &Path) -> bool {
     let threshold = mtime(dst);
     let meta = match fs::metadata(src) {
         Ok(meta) => meta,
-        Err(e) => panic!("source {:?} failed to get metadata: {}", src, e),
+        Err(e) => panic!("source {src:?} failed to get metadata: {e}"),
     };
     if meta.is_dir() {
         dir_up_to_date(src, threshold)
diff --git a/src/ci/docker/host-aarch64/aarch64-gnu/Dockerfile b/src/ci/docker/host-aarch64/aarch64-gnu/Dockerfile
index f8701044ec4..85b0f3b1081 100644
--- a/src/ci/docker/host-aarch64/aarch64-gnu/Dockerfile
+++ b/src/ci/docker/host-aarch64/aarch64-gnu/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   g++ \
   make \
   ninja-build \
@@ -17,9 +18,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
   xz-utils \
   && rm -rf /var/lib/apt/lists/*
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
index 2d92d23d7b2..015caafc5bd 100644
--- a/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
+++ b/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update -y && apt-get install -y --no-install-recommends \
       bc \
       bzip2 \
       ca-certificates \
@@ -34,14 +35,14 @@ WORKDIR /build
 # the kernel. This file was generated by running `make vexpress_defconfig`
 # followed by `make menuconfig` and then enabling the IPv6 protocol page.
 COPY host-x86_64/armhf-gnu/vexpress_config /build/.config
-RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.253.tar.xz | \
+RUN curl https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.320.tar.xz | \
       tar xJf - && \
-      cd /build/linux-4.4.253 && \
+      cd /build/linux-4.14.320 && \
       cp /build/.config . && \
       make -j$(nproc) all && \
       cp arch/arm/boot/zImage /tmp && \
       cd /build &&  \
-      rm -rf linux-4.4.253
+      rm -rf linux-4.14.320
 
 # Compile an instance of busybox as this provides a lightweight system and init
 # binary which we will boot into. Only trick here is configuring busybox to
@@ -59,7 +60,7 @@ RUN curl https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2 | tar xjf - &&
 # Download the ubuntu rootfs, which we'll use as a chroot for all our tests.
 WORKDIR /tmp
 RUN mkdir rootfs/ubuntu
-RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.1-base-armhf.tar.gz | \
+RUN curl https://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04.2-base-armhf.tar.gz | \
       tar xzf - -C rootfs/ubuntu && \
       cd rootfs && mkdir proc sys dev etc etc/init.d
 
@@ -76,9 +77,6 @@ RUN arm-linux-gnueabihf-gcc addentropy.c -o rootfs/addentropy -static
 # Source of the file: https://github.com/vfdev-5/qemu-rpi2-vexpress/raw/master/vexpress-v2p-ca15-tc1.dtb
 RUN curl -O https://ci-mirrors.rust-lang.org/rustc/vexpress-v2p-ca15-tc1.dtb
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/armhf-gnu/vexpress_config b/src/ci/docker/host-x86_64/armhf-gnu/vexpress_config
index b39e5dcf38d..54c3ae18d60 100644
--- a/src/ci/docker/host-x86_64/armhf-gnu/vexpress_config
+++ b/src/ci/docker/host-x86_64/armhf-gnu/vexpress_config
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 4.4.253 Kernel Configuration
+# Linux/arm 4.14.320 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_ARM_HAS_SG_CHAIN=y
@@ -49,8 +49,8 @@ CONFIG_SYSVIPC=y
 CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_CROSS_MEMORY_ATTACH=y
-# CONFIG_FHANDLE is not set
-CONFIG_USELIB=y
+CONFIG_FHANDLE=y
+# CONFIG_USELIB is not set
 # CONFIG_AUDIT is not set
 CONFIG_HAVE_ARCH_AUDITSYSCALL=y
 
@@ -60,6 +60,7 @@ CONFIG_HAVE_ARCH_AUDITSYSCALL=y
 CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_MIGRATION=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_IRQ_DOMAIN=y
@@ -68,6 +69,8 @@ CONFIG_HANDLE_DOMAIN_IRQ=y
 # CONFIG_IRQ_DOMAIN_DEBUG is not set
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_SPARSE_IRQ=y
+# CONFIG_GENERIC_IRQ_DEBUGFS is not set
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_ARCH_HAS_TICK_BROADCAST=y
@@ -97,28 +100,31 @@ CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TREE_RCU=y
 # CONFIG_RCU_EXPERT is not set
 CONFIG_SRCU=y
+CONFIG_TREE_SRCU=y
 # CONFIG_TASKS_RCU is not set
 CONFIG_RCU_STALL_COMMON=y
-# CONFIG_TREE_RCU_TRACE is not set
-# CONFIG_RCU_EXPEDITE_BOOT is not set
+CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_BUILD_BIN2C=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12
+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13
 CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_CGROUPS=y
-# CONFIG_CGROUP_DEBUG is not set
-# CONFIG_CGROUP_FREEZER is not set
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
 # CONFIG_CGROUP_PIDS is not set
-# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_RDMA is not set
+# CONFIG_CGROUP_FREEZER is not set
 CONFIG_CPUSETS=y
 CONFIG_PROC_PID_CPUSET=y
+# CONFIG_CGROUP_DEVICE is not set
 # CONFIG_CGROUP_CPUACCT is not set
-# CONFIG_MEMCG is not set
 # CONFIG_CGROUP_PERF is not set
-# CONFIG_CGROUP_SCHED is not set
-# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
 # CONFIG_CHECKPOINT_RESTORE is not set
 CONFIG_NAMESPACES=y
 # CONFIG_UTS_NS is not set
@@ -149,13 +155,19 @@ CONFIG_MULTIUSER=y
 # CONFIG_SGETMASK_SYSCALL is not set
 CONFIG_SYSFS_SYSCALL=y
 # CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_POSIX_TIMERS=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
 CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
+CONFIG_FUTEX_PI=y
+CONFIG_HAVE_FUTEX_CMPXCHG=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
 CONFIG_TIMERFD=y
@@ -169,6 +181,7 @@ CONFIG_MEMBARRIER=y
 # CONFIG_EMBEDDED is not set
 CONFIG_HAVE_PERF_EVENTS=y
 CONFIG_PERF_USE_VMALLOC=y
+# CONFIG_PC104 is not set
 
 #
 # Kernel Performance Events And Counters
@@ -180,25 +193,30 @@ CONFIG_SLUB_DEBUG=y
 CONFIG_COMPAT_BRK=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
+CONFIG_SLAB_MERGE_DEFAULT=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SLAB_FREELIST_HARDENED is not set
 CONFIG_SLUB_CPU_PARTIAL=y
 # CONFIG_SYSTEM_DATA_VERIFICATION is not set
 CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
 CONFIG_OPROFILE=y
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
 # CONFIG_JUMP_LABEL is not set
-# CONFIG_UPROBES is not set
+CONFIG_UPROBES=y
 # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_HAVE_KPROBES=y
 CONFIG_HAVE_KRETPROBES=y
 CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_DMA_ATTRS=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_ARCH_HAS_SET_MEMORY=y
 CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_DMA_API_DEBUG=y
@@ -208,20 +226,39 @@ CONFIG_HAVE_PERF_USER_STACK_DUMP=y
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR is not set
 CONFIG_CC_STACKPROTECTOR_NONE=y
 # CONFIG_CC_STACKPROTECTOR_REGULAR is not set
 # CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_THIN_ARCHIVES=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=15
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_OLD_SIGSUSPEND3=y
 CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
+CONFIG_STRICT_KERNEL_RWX=y
+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
+CONFIG_STRICT_MODULE_RWX=y
+# CONFIG_REFCOUNT_FULL is not set
 
 #
 # GCOV-based kernel profiling
@@ -240,13 +277,19 @@ CONFIG_MODULE_UNLOAD=y
 # CONFIG_MODULE_SRCVERSION_ALL is not set
 # CONFIG_MODULE_SIG is not set
 # CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
 CONFIG_MODULES_TREE_LOOKUP=y
 CONFIG_BLOCK=y
 # CONFIG_LBDAF is not set
+CONFIG_BLK_SCSI_REQUEST=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEV_BSGLIB is not set
 # CONFIG_BLK_DEV_INTEGRITY is not set
+# CONFIG_BLK_DEV_ZONED is not set
 # CONFIG_BLK_CMDLINE_PARSER is not set
+# CONFIG_BLK_WBT is not set
+CONFIG_BLK_DEBUG_FS=y
+# CONFIG_BLK_SED_OPAL is not set
 
 #
 # Partition Types
@@ -254,6 +297,7 @@ CONFIG_BLOCK=y
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
 CONFIG_EFI_PARTITION=y
+CONFIG_BLK_MQ_VIRTIO=y
 
 #
 # IO Schedulers
@@ -263,6 +307,9 @@ CONFIG_IOSCHED_NOOP=y
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_MQ_IOSCHED_DEADLINE=y
+CONFIG_MQ_IOSCHED_KYBER=y
+# CONFIG_IOSCHED_BFQ is not set
 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
 CONFIG_INLINE_READ_UNLOCK=y
 CONFIG_INLINE_READ_UNLOCK_IRQ=y
@@ -279,10 +326,6 @@ CONFIG_FREEZER=y
 #
 CONFIG_MMU=y
 CONFIG_ARCH_MULTIPLATFORM=y
-# CONFIG_ARCH_REALVIEW is not set
-# CONFIG_ARCH_VERSATILE is not set
-# CONFIG_ARCH_CLPS711X is not set
-# CONFIG_ARCH_GEMINI is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_EP93XX is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
@@ -292,9 +335,6 @@ CONFIG_ARCH_MULTIPLATFORM=y
 # CONFIG_ARCH_IOP33X is not set
 # CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_DOVE is not set
-# CONFIG_ARCH_MV78XX0 is not set
-# CONFIG_ARCH_ORION5X is not set
-# CONFIG_ARCH_MMP is not set
 # CONFIG_ARCH_KS8695 is not set
 # CONFIG_ARCH_W90X900 is not set
 # CONFIG_ARCH_LPC32XX is not set
@@ -302,7 +342,6 @@ CONFIG_ARCH_MULTIPLATFORM=y
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
 # CONFIG_ARCH_S3C24XX is not set
-# CONFIG_ARCH_S3C64XX is not set
 # CONFIG_ARCH_DAVINCI is not set
 # CONFIG_ARCH_OMAP1 is not set
 
@@ -319,7 +358,9 @@ CONFIG_ARCH_MULTI_V6_V7=y
 # CONFIG_ARCH_MULTI_CPU_AUTO is not set
 # CONFIG_ARCH_VIRT is not set
 # CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ACTIONS is not set
 # CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
 # CONFIG_ARCH_AT91 is not set
 # CONFIG_ARCH_BCM is not set
 # CONFIG_ARCH_BERLIN is not set
@@ -340,16 +381,19 @@ CONFIG_ARCH_MULTI_V6_V7=y
 # CONFIG_SOC_AM33XX is not set
 # CONFIG_SOC_AM43XX is not set
 # CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
 # CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
 # CONFIG_ARCH_ROCKCHIP is not set
 # CONFIG_ARCH_SOCFPGA is not set
 # CONFIG_PLAT_SPEAR is not set
 # CONFIG_ARCH_STI is not set
 # CONFIG_ARCH_S5PV210 is not set
 # CONFIG_ARCH_EXYNOS is not set
-# CONFIG_ARCH_SHMOBILE_MULTI is not set
+# CONFIG_ARCH_RENESAS is not set
 # CONFIG_ARCH_SUNXI is not set
 # CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
 # CONFIG_ARCH_TEGRA is not set
 # CONFIG_ARCH_UNIPHIER is not set
 # CONFIG_ARCH_U8500 is not set
@@ -367,6 +411,7 @@ CONFIG_PLAT_VERSATILE=y
 # Processor Type
 #
 CONFIG_CPU_V7=y
+CONFIG_CPU_THUMB_CAPABLE=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
@@ -393,12 +438,14 @@ CONFIG_SWP_EMULATE=y
 # CONFIG_CPU_BPREDICT_DISABLE is not set
 CONFIG_CPU_SPECTRE=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
+CONFIG_HARDEN_BRANCH_HISTORY=y
 CONFIG_KUSER_HELPERS=y
 CONFIG_VDSO=y
 CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0_PMU is not set
 # CONFIG_PL310_ERRATA_588369 is not set
 # CONFIG_PL310_ERRATA_727915 is not set
 CONFIG_PL310_ERRATA_753970=y
@@ -408,7 +455,7 @@ CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_DMA_MEM_BUFFERABLE=y
 CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
-# CONFIG_ARM_KERNMEM_PERMS is not set
+CONFIG_DEBUG_ALIGN_RODATA=y
 CONFIG_MULTI_IRQ_HANDLER=y
 # CONFIG_ARM_ERRATA_430973 is not set
 CONFIG_ARM_ERRATA_643719=y
@@ -419,7 +466,11 @@ CONFIG_ARM_ERRATA_720789=y
 # CONFIG_ARM_ERRATA_775420 is not set
 # CONFIG_ARM_ERRATA_798181 is not set
 # CONFIG_ARM_ERRATA_773022 is not set
-CONFIG_ICST=y
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
 
 #
 # Bus support
@@ -427,6 +478,15 @@ CONFIG_ICST=y
 # CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS_GENERIC is not set
 # CONFIG_PCI_SYSCALL is not set
+
+#
+# DesignWare PCI Core Support
+#
+
+#
+# PCI Endpoint
+#
+# CONFIG_PCI_ENDPOINT is not set
 # CONFIG_PCCARD is not set
 
 #
@@ -465,6 +525,7 @@ CONFIG_HZ_100=y
 CONFIG_HZ=100
 # CONFIG_SCHED_HRTICK is not set
 # CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
 CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
@@ -487,9 +548,9 @@ CONFIG_BALLOON_COMPACTION=y
 CONFIG_COMPACTION=y
 CONFIG_MIGRATION=y
 # CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
 # CONFIG_KSM is not set
 CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+# CONFIG_ARCH_WANTS_THP_SWAP is not set
 # CONFIG_CLEANCACHE is not set
 # CONFIG_FRONTSWAP is not set
 CONFIG_CMA=y
@@ -499,13 +560,17 @@ CONFIG_CMA_AREAS=7
 # CONFIG_ZPOOL is not set
 # CONFIG_ZBUD is not set
 # CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
 # CONFIG_IDLE_PAGE_TRACKING is not set
+# CONFIG_PERCPU_STATS is not set
 CONFIG_FORCE_MAX_ZONEORDER=11
 CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_UACCESS_WITH_MEMCPY is not set
 # CONFIG_SECCOMP is not set
 CONFIG_SWIOTLB=y
 CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
 # CONFIG_XEN is not set
 
 #
@@ -524,6 +589,7 @@ CONFIG_CMDLINE_FROM_BOOTLOADER=y
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
 CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
 
 #
 # CPU Power Management
@@ -539,7 +605,7 @@ CONFIG_AUTO_ZRELADDR=y
 #
 CONFIG_CPU_IDLE=y
 CONFIG_CPU_IDLE_GOV_LADDER=y
-CONFIG_CPU_IDLE_GOV_MENU=y
+# CONFIG_CPU_IDLE_GOV_MENU is not set
 
 #
 # ARM CPU Idle Drivers
@@ -565,8 +631,10 @@ CONFIG_NEON=y
 # Userspace binary formats
 #
 CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
 # CONFIG_HAVE_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
 CONFIG_COREDUMP=y
@@ -599,7 +667,9 @@ CONFIG_NET=y
 CONFIG_PACKET=y
 # CONFIG_PACKET_DIAG is not set
 CONFIG_UNIX=y
+CONFIG_UNIX_SCM=y
 # CONFIG_UNIX_DIAG is not set
+# CONFIG_TLS is not set
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
@@ -624,15 +694,17 @@ CONFIG_NET_IP_TUNNEL=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+CONFIG_INET_TABLE_PERTURB_ORDER=16
 # CONFIG_INET_XFRM_TUNNEL is not set
 CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
-# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_RAW_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
@@ -644,7 +716,6 @@ CONFIG_IPV6=y
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
 # CONFIG_IPV6_MIP6 is not set
-# CONFIG_IPV6_ILA is not set
 # CONFIG_INET6_XFRM_TUNNEL is not set
 # CONFIG_INET6_TUNNEL is not set
 CONFIG_INET6_XFRM_MODE_TRANSPORT=y
@@ -656,9 +727,12 @@ CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_SIT_6RD is not set
 CONFIG_IPV6_NDISC_NODETYPE=y
 # CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_GRE is not set
+# CONFIG_IPV6_FOU is not set
+# CONFIG_IPV6_FOU_TUNNEL is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_IPV6_MROUTE is not set
+# CONFIG_IPV6_SEG6_LWTUNNEL is not set
+# CONFIG_IPV6_SEG6_HMAC is not set
 # CONFIG_NETWORK_SECMARK is not set
 # CONFIG_NET_PTP_CLASSIFY is not set
 # CONFIG_NETWORK_PHY_TIMESTAMPING is not set
@@ -673,7 +747,6 @@ CONFIG_IPV6_NDISC_NODETYPE=y
 CONFIG_HAVE_NET_DSA=y
 # CONFIG_NET_DSA is not set
 # CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -689,9 +762,11 @@ CONFIG_HAVE_NET_DSA=y
 # CONFIG_VSOCKETS is not set
 # CONFIG_NETLINK_DIAG is not set
 # CONFIG_MPLS is not set
+# CONFIG_NET_NSH is not set
 # CONFIG_HSR is not set
 # CONFIG_NET_SWITCHDEV is not set
 # CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
 CONFIG_RPS=y
 CONFIG_RFS_ACCEL=y
 CONFIG_XPS=y
@@ -706,30 +781,35 @@ CONFIG_NET_FLOW_LIMIT=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_CAN is not set
-# CONFIG_IRDA is not set
 # CONFIG_BT is not set
 # CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
 # CONFIG_WIRELESS is not set
 # CONFIG_WIMAX is not set
 # CONFIG_RFKILL is not set
-# CONFIG_RFKILL_REGULATOR is not set
 CONFIG_NET_9P=y
 CONFIG_NET_9P_VIRTIO=y
 # CONFIG_NET_9P_DEBUG is not set
 # CONFIG_CAIF is not set
 # CONFIG_CEPH_LIB is not set
 # CONFIG_NFC is not set
+# CONFIG_PSAMPLE is not set
+# CONFIG_NET_IFE is not set
 # CONFIG_LWTUNNEL is not set
 CONFIG_DST_CACHE=y
-CONFIG_HAVE_BPF_JIT=y
+CONFIG_GRO_CELLS=y
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_EBPF_JIT=y
 
 #
 # Device Drivers
 #
 CONFIG_ARM_AMBA=y
-# CONFIG_TEGRA_AHB is not set
 
 #
 # Generic Driver Options
@@ -747,12 +827,18 @@ CONFIG_EXTRA_FIRMWARE=""
 CONFIG_ALLOW_DEV_COREDUMP=y
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set
 # CONFIG_SYS_HYPERVISOR is not set
 # CONFIG_GENERIC_CPU_DEVICES is not set
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_MMIO=y
 # CONFIG_DMA_SHARED_BUFFER is not set
 # CONFIG_DMA_CMA is not set
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
 
 #
 # Bus devices
@@ -761,9 +847,10 @@ CONFIG_ARM_CCI=y
 CONFIG_ARM_CCI400_COMMON=y
 # CONFIG_ARM_CCI400_PMU is not set
 CONFIG_ARM_CCI400_PORT_CTRL=y
-# CONFIG_ARM_CCI500_PMU is not set
+# CONFIG_ARM_CCI5xx_PMU is not set
 # CONFIG_ARM_CCN is not set
 # CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_SIMPLE_PM_BUS is not set
 CONFIG_VEXPRESS_CONFIG=y
 # CONFIG_CONNECTOR is not set
 CONFIG_MTD=y
@@ -775,6 +862,10 @@ CONFIG_MTD_OF_PARTS=y
 # CONFIG_MTD_AR7_PARTS is not set
 
 #
+# Partition parsers
+#
+
+#
 # User Modules And Translation Layers
 #
 CONFIG_MTD_BLKDEVS=y
@@ -821,6 +912,8 @@ CONFIG_MTD_RAM=y
 CONFIG_MTD_PHYSMAP=y
 # CONFIG_MTD_PHYSMAP_COMPAT is not set
 CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_PHYSMAP_OF_VERSATILE is not set
+# CONFIG_MTD_PHYSMAP_OF_GEMINI is not set
 CONFIG_MTD_PLATRAM=y
 
 #
@@ -859,7 +952,6 @@ CONFIG_OF_ADDRESS=y
 CONFIG_OF_IRQ=y
 CONFIG_OF_NET=y
 CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
 CONFIG_OF_RESERVED_MEM=y
 # CONFIG_OF_OVERLAY is not set
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -873,9 +965,10 @@ CONFIG_BLK_DEV=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
-# CONFIG_MG_DISK is not set
 CONFIG_VIRTIO_BLK=y
+# CONFIG_VIRTIO_BLK_SCSI is not set
 # CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_FC is not set
 
 #
 # Misc devices
@@ -889,13 +982,10 @@ CONFIG_VIRTIO_BLK=y
 # CONFIG_ISL29003 is not set
 # CONFIG_ISL29020 is not set
 # CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_SENSORS_BH1780 is not set
 # CONFIG_SENSORS_BH1770 is not set
 # CONFIG_SENSORS_APDS990X is not set
 # CONFIG_HMC6352 is not set
 # CONFIG_DS1682 is not set
-# CONFIG_ARM_CHARLCD is not set
-# CONFIG_BMP085_I2C is not set
 # CONFIG_USB_SWITCH_FSA9480 is not set
 # CONFIG_SRAM is not set
 CONFIG_VEXPRESS_SYSCFG=y
@@ -908,6 +998,7 @@ CONFIG_VEXPRESS_SYSCFG=y
 # CONFIG_EEPROM_LEGACY is not set
 # CONFIG_EEPROM_MAX6875 is not set
 # CONFIG_EEPROM_93CX6 is not set
+# CONFIG_EEPROM_IDT_89HPESX is not set
 
 #
 # Texas Instruments shared transport line discipline
@@ -929,6 +1020,10 @@ CONFIG_VEXPRESS_SYSCFG=y
 #
 
 #
+# VOP Bus Driver
+#
+
+#
 # Intel MIC Host Driver
 #
 
@@ -943,10 +1038,14 @@ CONFIG_VEXPRESS_SYSCFG=y
 #
 # Intel MIC Coprocessor State Management (COSM) Drivers
 #
+
+#
+# VOP Driver
+#
 # CONFIG_ECHO is not set
 # CONFIG_CXL_BASE is not set
-# CONFIG_CXL_KERNEL_API is not set
-# CONFIG_CXL_EEH is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+# CONFIG_CXL_LIB is not set
 
 #
 # SCSI device support
@@ -1034,8 +1133,9 @@ CONFIG_NET_CORE=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_NET_TEAM is not set
 # CONFIG_MACVLAN is not set
-# CONFIG_IPVLAN is not set
 # CONFIG_VXLAN is not set
+# CONFIG_GTP is not set
+# CONFIG_MACSEC is not set
 # CONFIG_NETCONSOLE is not set
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
@@ -1052,13 +1152,12 @@ CONFIG_VIRTIO_NET=y
 #
 # Distributed Switch Architecture drivers
 #
-# CONFIG_NET_DSA_MV88E6XXX is not set
-# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
 CONFIG_ETHERNET=y
+CONFIG_NET_VENDOR_ALACRITECH=y
 # CONFIG_ALTERA_TSE is not set
+CONFIG_NET_VENDOR_AMAZON=y
+CONFIG_NET_VENDOR_AQUANTIA=y
 CONFIG_NET_VENDOR_ARC=y
-# CONFIG_ARC_EMAC is not set
-# CONFIG_EMAC_ROCKCHIP is not set
 # CONFIG_NET_VENDOR_AURORA is not set
 CONFIG_NET_CADENCE=y
 # CONFIG_MACB is not set
@@ -1077,26 +1176,36 @@ CONFIG_NET_VENDOR_FARADAY=y
 # CONFIG_FTGMAC100 is not set
 CONFIG_NET_VENDOR_HISILICON=y
 # CONFIG_HIX5HD2_GMAC is not set
+# CONFIG_HISI_FEMAC is not set
 # CONFIG_HIP04_ETH is not set
 # CONFIG_HNS is not set
 # CONFIG_HNS_DSAF is not set
 # CONFIG_HNS_ENET is not set
+CONFIG_NET_VENDOR_HUAWEI=y
 CONFIG_NET_VENDOR_INTEL=y
 CONFIG_NET_VENDOR_I825XX=y
 CONFIG_NET_VENDOR_MARVELL=y
 # CONFIG_MVMDIO is not set
+# CONFIG_MVNETA_BM is not set
+CONFIG_NET_VENDOR_MELLANOX=y
+# CONFIG_MLXSW_CORE is not set
+# CONFIG_MLXFW is not set
 CONFIG_NET_VENDOR_MICREL=y
 # CONFIG_KS8851_MLL is not set
 CONFIG_NET_VENDOR_NATSEMI=y
+CONFIG_NET_VENDOR_NETRONOME=y
 CONFIG_NET_VENDOR_8390=y
 # CONFIG_AX88796 is not set
 # CONFIG_ETHOC is not set
 CONFIG_NET_VENDOR_QUALCOMM=y
+# CONFIG_QCOM_EMAC is not set
+# CONFIG_RMNET is not set
 CONFIG_NET_VENDOR_RENESAS=y
 CONFIG_NET_VENDOR_ROCKER=y
 CONFIG_NET_VENDOR_SAMSUNG=y
 # CONFIG_SXGBE_ETH is not set
 CONFIG_NET_VENDOR_SEEQ=y
+CONFIG_NET_VENDOR_SOLARFLARE=y
 CONFIG_NET_VENDOR_SMSC=y
 CONFIG_SMC91X=y
 # CONFIG_SMC911X is not set
@@ -1104,47 +1213,58 @@ CONFIG_SMSC911X=y
 # CONFIG_SMSC911X_ARCH_HOOKS is not set
 CONFIG_NET_VENDOR_STMICRO=y
 # CONFIG_STMMAC_ETH is not set
-CONFIG_NET_VENDOR_SYNOPSYS=y
-# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set
 CONFIG_NET_VENDOR_VIA=y
 # CONFIG_VIA_RHINE is not set
 # CONFIG_VIA_VELOCITY is not set
 CONFIG_NET_VENDOR_WIZNET=y
 # CONFIG_WIZNET_W5100 is not set
 # CONFIG_WIZNET_W5300 is not set
+CONFIG_NET_VENDOR_SYNOPSYS=y
+# CONFIG_DWC_XLGMAC is not set
+CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_BUS=y
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_GPIO is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_HISI_FEMAC is not set
 CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+# CONFIG_LED_TRIGGER_PHY is not set
 
 #
 # MII PHY device drivers
 #
+# CONFIG_AMD_PHY is not set
 # CONFIG_AQUANTIA_PHY is not set
 # CONFIG_AT803X_PHY is not set
-# CONFIG_AMD_PHY is not set
-# CONFIG_MARVELL_PHY is not set
-# CONFIG_DAVICOM_PHY is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_LXT_PHY is not set
-# CONFIG_CICADA_PHY is not set
-# CONFIG_VITESSE_PHY is not set
-# CONFIG_TERANETICS_PHY is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_BROADCOM_PHY is not set
 # CONFIG_BCM7XXX_PHY is not set
 # CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_CORTINA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
 # CONFIG_ICPLUS_PHY is not set
-# CONFIG_REALTEK_PHY is not set
-# CONFIG_NATIONAL_PHY is not set
-# CONFIG_STE10XP is not set
+# CONFIG_INTEL_XWAY_PHY is not set
 # CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MARVELL_10G_PHY is not set
 # CONFIG_MICREL_PHY is not set
-# CONFIG_DP83848_PHY is not set
-# CONFIG_DP83867_PHY is not set
 # CONFIG_MICROCHIP_PHY is not set
-# CONFIG_FIXED_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
-# CONFIG_MDIO_BUS_MUX_GPIO is not set
-# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
-# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_ROCKCHIP_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 CONFIG_USB_NET_DRIVERS=y
@@ -1163,7 +1283,6 @@ CONFIG_USB_NET_DRIVERS=y
 #
 # CONFIG_WAN is not set
 # CONFIG_ISDN is not set
-# CONFIG_NVM is not set
 
 #
 # Input device support
@@ -1178,10 +1297,7 @@ CONFIG_INPUT_LEDS=y
 #
 # Userland interfaces
 #
-CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_JOYDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
@@ -1195,6 +1311,7 @@ CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_QT1070 is not set
 # CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_DLINK_DIR685 is not set
 # CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_GPIO is not set
 # CONFIG_KEYBOARD_GPIO_POLLED is not set
@@ -1212,20 +1329,24 @@ CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_STOWAWAY is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_CAP11XX is not set
 # CONFIG_KEYBOARD_BCM is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
 CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
 CONFIG_MOUSE_PS2_LOGIPS2PP=y
 CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
 CONFIG_MOUSE_PS2_CYPRESS=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
 # CONFIG_MOUSE_PS2_ELANTECH is not set
 # CONFIG_MOUSE_PS2_SENTELIC is not set
 # CONFIG_MOUSE_PS2_TOUCHKIT is not set
 CONFIG_MOUSE_PS2_FOCALTECH=y
+CONFIG_MOUSE_PS2_SMBUS=y
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_APPLETOUCH is not set
 # CONFIG_MOUSE_BCM5974 is not set
@@ -1239,6 +1360,7 @@ CONFIG_MOUSE_PS2_FOCALTECH=y
 # CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
+# CONFIG_RMI4_CORE is not set
 
 #
 # Hardware I/O ports
@@ -1252,6 +1374,7 @@ CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_PS2MULT is not set
 # CONFIG_SERIO_ARC_PS2 is not set
 # CONFIG_SERIO_APBPS2 is not set
+# CONFIG_SERIO_GPIO_PS2 is not set
 # CONFIG_USERIO is not set
 # CONFIG_GAMEPORT is not set
 
@@ -1266,7 +1389,6 @@ CONFIG_VT_CONSOLE_SLEEP=y
 CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_UNIX98_PTYS=y
-# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=16
 # CONFIG_SERIAL_NONSTANDARD is not set
@@ -1274,7 +1396,7 @@ CONFIG_LEGACY_PTY_COUNT=16
 # CONFIG_TRACE_SINK is not set
 CONFIG_LDISC_AUTOLOAD=y
 CONFIG_DEVMEM=y
-CONFIG_DEVKMEM=y
+# CONFIG_DEVKMEM is not set
 
 #
 # Serial drivers
@@ -1302,7 +1424,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_FSL_LPUART is not set
 # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
 # CONFIG_SERIAL_ST_ASC is not set
-# CONFIG_SERIAL_STM32 is not set
+# CONFIG_SERIAL_DEV_BUS is not set
 CONFIG_HVC_DRIVER=y
 # CONFIG_HVC_DCC is not set
 CONFIG_VIRTIO_CONSOLE=y
@@ -1313,6 +1435,7 @@ CONFIG_HW_RANDOM_VIRTIO=y
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 # CONFIG_XILLYBUS is not set
+CONFIG_RANDOM_TRUST_BOOTLOADER=y
 
 #
 # I2C support
@@ -1365,17 +1488,9 @@ CONFIG_I2C_VERSATILE=y
 # CONFIG_SPI is not set
 # CONFIG_SPMI is not set
 # CONFIG_HSI is not set
-
-#
-# PPS support
-#
 # CONFIG_PPS is not set
 
 #
-# PPS generators support
-#
-
-#
 # PTP clock support
 #
 # CONFIG_PTP_1588_CLOCK is not set
@@ -1384,10 +1499,7 @@ CONFIG_I2C_VERSATILE=y
 # Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
 #
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
 CONFIG_OF_GPIO=y
 # CONFIG_DEBUG_GPIO is not set
 # CONFIG_GPIO_SYSFS is not set
@@ -1399,14 +1511,15 @@ CONFIG_GPIO_GENERIC=y
 # CONFIG_GPIO_74XX_MMIO is not set
 # CONFIG_GPIO_ALTERA is not set
 # CONFIG_GPIO_DWAPB is not set
-# CONFIG_GPIO_EM is not set
+# CONFIG_GPIO_FTGPIO010 is not set
 CONFIG_GPIO_GENERIC_PLATFORM=y
 # CONFIG_GPIO_GRGPIO is not set
+# CONFIG_GPIO_MOCKUP is not set
+# CONFIG_GPIO_MPC8XXX is not set
 # CONFIG_GPIO_PL061 is not set
 # CONFIG_GPIO_SYSCON is not set
 # CONFIG_GPIO_XILINX is not set
 # CONFIG_GPIO_ZEVIO is not set
-# CONFIG_GPIO_ZX is not set
 
 #
 # I2C GPIO expanders
@@ -1417,21 +1530,30 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 # CONFIG_GPIO_MAX732X is not set
 # CONFIG_GPIO_PCA953X is not set
 # CONFIG_GPIO_PCF857X is not set
-# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_TPIC2810 is not set
 
 #
 # MFD GPIO expanders
 #
-
-#
-# SPI or I2C GPIO expanders
-#
-# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_HTC_EGPIO is not set
 
 #
 # USB GPIO expanders
 #
 # CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+# CONFIG_POWER_RESET_BRCMSTB is not set
+# CONFIG_POWER_RESET_GPIO is not set
+# CONFIG_POWER_RESET_GPIO_RESTART is not set
+# CONFIG_POWER_RESET_LTC2952 is not set
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_VERSATILE is not set
+CONFIG_POWER_RESET_VEXPRESS=y
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+# CONFIG_SYSCON_REBOOT_MODE is not set
 CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
 # CONFIG_PDA_POWER is not set
@@ -1440,6 +1562,7 @@ CONFIG_POWER_SUPPLY=y
 # CONFIG_BATTERY_DS2781 is not set
 # CONFIG_BATTERY_DS2782 is not set
 # CONFIG_BATTERY_SBS is not set
+# CONFIG_CHARGER_SBS is not set
 # CONFIG_BATTERY_BQ27XXX is not set
 # CONFIG_BATTERY_MAX17040 is not set
 # CONFIG_BATTERY_MAX17042 is not set
@@ -1447,24 +1570,16 @@ CONFIG_POWER_SUPPLY=y
 # CONFIG_CHARGER_LP8727 is not set
 # CONFIG_CHARGER_GPIO is not set
 # CONFIG_CHARGER_MANAGER is not set
+# CONFIG_CHARGER_LTC3651 is not set
+# CONFIG_CHARGER_DETECTOR_MAX14656 is not set
 # CONFIG_CHARGER_BQ2415X is not set
-# CONFIG_CHARGER_BQ24190 is not set
+# CONFIG_CHARGER_BQ24257 is not set
 # CONFIG_CHARGER_BQ24735 is not set
 # CONFIG_CHARGER_BQ25890 is not set
 # CONFIG_CHARGER_SMB347 is not set
 # CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_BATTERY_RT5033 is not set
 # CONFIG_CHARGER_RT9455 is not set
-CONFIG_POWER_RESET=y
-# CONFIG_POWER_RESET_BRCMSTB is not set
-# CONFIG_POWER_RESET_GPIO is not set
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
-# CONFIG_POWER_RESET_RESTART is not set
-# CONFIG_POWER_RESET_VERSATILE is not set
-CONFIG_POWER_RESET_VEXPRESS=y
-# CONFIG_POWER_RESET_SYSCON is not set
-# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
-# CONFIG_POWER_AVS is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
@@ -1486,6 +1601,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ADT7475 is not set
 # CONFIG_SENSORS_ASC7621 is not set
+# CONFIG_SENSORS_ASPEED is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS620 is not set
 # CONFIG_SENSORS_DS1621 is not set
@@ -1503,6 +1619,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_POWR1220 is not set
 # CONFIG_SENSORS_LINEAGE is not set
 # CONFIG_SENSORS_LTC2945 is not set
+# CONFIG_SENSORS_LTC2990 is not set
 # CONFIG_SENSORS_LTC4151 is not set
 # CONFIG_SENSORS_LTC4215 is not set
 # CONFIG_SENSORS_LTC4222 is not set
@@ -1518,8 +1635,8 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_MAX6650 is not set
 # CONFIG_SENSORS_MAX6697 is not set
 # CONFIG_SENSORS_MAX31790 is not set
-# CONFIG_SENSORS_HTU21 is not set
 # CONFIG_SENSORS_MCP3021 is not set
+# CONFIG_SENSORS_TC654 is not set
 # CONFIG_SENSORS_LM63 is not set
 # CONFIG_SENSORS_LM73 is not set
 # CONFIG_SENSORS_LM75 is not set
@@ -1546,6 +1663,7 @@ CONFIG_HWMON=y
 # CONFIG_PMBUS is not set
 # CONFIG_SENSORS_SHT15 is not set
 # CONFIG_SENSORS_SHT21 is not set
+# CONFIG_SENSORS_SHT3x is not set
 # CONFIG_SENSORS_SHTC1 is not set
 # CONFIG_SENSORS_DME1737 is not set
 # CONFIG_SENSORS_EMC1403 is not set
@@ -1555,6 +1673,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_SMSC47M192 is not set
 # CONFIG_SENSORS_SMSC47B397 is not set
 # CONFIG_SENSORS_SCH56XX_COMMON is not set
+# CONFIG_SENSORS_STTS751 is not set
 # CONFIG_SENSORS_SMM665 is not set
 # CONFIG_SENSORS_ADC128D818 is not set
 # CONFIG_SENSORS_ADS1015 is not set
@@ -1562,10 +1681,12 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_AMC6821 is not set
 # CONFIG_SENSORS_INA209 is not set
 # CONFIG_SENSORS_INA2XX is not set
+# CONFIG_SENSORS_INA3221 is not set
 # CONFIG_SENSORS_TC74 is not set
 # CONFIG_SENSORS_THMC50 is not set
 # CONFIG_SENSORS_TMP102 is not set
 # CONFIG_SENSORS_TMP103 is not set
+# CONFIG_SENSORS_TMP108 is not set
 # CONFIG_SENSORS_TMP401 is not set
 # CONFIG_SENSORS_TMP421 is not set
 CONFIG_SENSORS_VEXPRESS=y
@@ -1588,16 +1709,13 @@ CONFIG_SSB_POSSIBLE=y
 #
 # CONFIG_SSB is not set
 CONFIG_BCMA_POSSIBLE=y
-
-#
-# Broadcom specific AMBA
-#
 # CONFIG_BCMA is not set
 
 #
 # Multifunction device drivers
 #
 CONFIG_MFD_CORE=y
+# CONFIG_MFD_ACT8945A is not set
 # CONFIG_MFD_AS3711 is not set
 # CONFIG_MFD_AS3722 is not set
 # CONFIG_PMIC_ADP5520 is not set
@@ -1605,7 +1723,8 @@ CONFIG_MFD_CORE=y
 # CONFIG_MFD_ATMEL_FLEXCOM is not set
 # CONFIG_MFD_ATMEL_HLCDC is not set
 # CONFIG_MFD_BCM590XX is not set
-# CONFIG_MFD_AXP20X is not set
+# CONFIG_MFD_BD9571MWV is not set
+# CONFIG_MFD_AXP20X_I2C is not set
 # CONFIG_MFD_CROS_EC is not set
 # CONFIG_MFD_ASIC3 is not set
 # CONFIG_PMIC_DA903X is not set
@@ -1617,15 +1736,14 @@ CONFIG_MFD_CORE=y
 # CONFIG_MFD_DLN2 is not set
 # CONFIG_MFD_MC13XXX_I2C is not set
 # CONFIG_MFD_HI6421_PMIC is not set
-# CONFIG_HTC_EGPIO is not set
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_HTC_I2CPLD is not set
-# CONFIG_INTEL_SOC_PMIC is not set
 # CONFIG_MFD_KEMPLD is not set
 # CONFIG_MFD_88PM800 is not set
 # CONFIG_MFD_88PM805 is not set
 # CONFIG_MFD_88PM860X is not set
 # CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
 # CONFIG_MFD_MAX77686 is not set
 # CONFIG_MFD_MAX77693 is not set
 # CONFIG_MFD_MAX77843 is not set
@@ -1639,7 +1757,7 @@ CONFIG_MFD_CORE=y
 # CONFIG_MFD_RETU is not set
 # CONFIG_MFD_PCF50633 is not set
 # CONFIG_UCB1400_CORE is not set
-# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_PM8XXX is not set
 # CONFIG_MFD_RT5033 is not set
 # CONFIG_MFD_RTSX_USB is not set
 # CONFIG_MFD_RC5T583 is not set
@@ -1656,16 +1774,19 @@ CONFIG_MFD_SYSCON=y
 # CONFIG_MFD_TI_AM335X_TSCADC is not set
 # CONFIG_MFD_LP3943 is not set
 # CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_TI_LMU is not set
 # CONFIG_MFD_PALMAS is not set
 # CONFIG_TPS6105X is not set
 # CONFIG_TPS65010 is not set
 # CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
 # CONFIG_MFD_TPS65090 is not set
 # CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TI_LP87565 is not set
 # CONFIG_MFD_TPS65218 is not set
 # CONFIG_MFD_TPS6586X is not set
 # CONFIG_MFD_TPS65910 is not set
-# CONFIG_MFD_TPS65912 is not set
 # CONFIG_MFD_TPS65912_I2C is not set
 # CONFIG_MFD_TPS80031 is not set
 # CONFIG_TWL4030_CORE is not set
@@ -1702,31 +1823,57 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_REGULATOR_LP872X is not set
 # CONFIG_REGULATOR_LP8755 is not set
 # CONFIG_REGULATOR_LTC3589 is not set
+# CONFIG_REGULATOR_LTC3676 is not set
 # CONFIG_REGULATOR_MAX1586 is not set
 # CONFIG_REGULATOR_MAX8649 is not set
 # CONFIG_REGULATOR_MAX8660 is not set
 # CONFIG_REGULATOR_MAX8952 is not set
-# CONFIG_REGULATOR_MAX8973 is not set
 # CONFIG_REGULATOR_MT6311 is not set
 # CONFIG_REGULATOR_PFUZE100 is not set
+# CONFIG_REGULATOR_PV88060 is not set
+# CONFIG_REGULATOR_PV88080 is not set
+# CONFIG_REGULATOR_PV88090 is not set
 # CONFIG_REGULATOR_TPS51632 is not set
 # CONFIG_REGULATOR_TPS62360 is not set
 # CONFIG_REGULATOR_TPS65023 is not set
 # CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_TPS65132 is not set
+# CONFIG_REGULATOR_VCTRL is not set
 CONFIG_REGULATOR_VEXPRESS=y
+CONFIG_RC_CORE=y
+CONFIG_RC_MAP=y
+CONFIG_RC_DECODERS=y
+# CONFIG_LIRC is not set
+CONFIG_IR_NEC_DECODER=y
+CONFIG_IR_RC5_DECODER=y
+CONFIG_IR_RC6_DECODER=y
+CONFIG_IR_JVC_DECODER=y
+CONFIG_IR_SONY_DECODER=y
+CONFIG_IR_SANYO_DECODER=y
+CONFIG_IR_SHARP_DECODER=y
+CONFIG_IR_MCE_KBD_DECODER=y
+CONFIG_IR_XMP_DECODER=y
+# CONFIG_RC_DEVICES is not set
 # CONFIG_MEDIA_SUPPORT is not set
 
 #
 # Graphics support
 #
+# CONFIG_IMX_IPUV3_CORE is not set
 # CONFIG_DRM is not set
 
 #
+# ACP (Audio CoProcessor) Configuration
+#
+# CONFIG_DRM_LIB_RANDOM is not set
+
+#
 # Frame buffer Devices
 #
 CONFIG_FB=y
 # CONFIG_FIRMWARE_EDID is not set
 CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
 # CONFIG_FB_DDC is not set
 # CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
@@ -1736,6 +1883,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 # CONFIG_FB_SYS_FILLRECT is not set
 # CONFIG_FB_SYS_COPYAREA is not set
 # CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set
 # CONFIG_FB_FOREIGN_ENDIAN is not set
 # CONFIG_FB_SYS_FOPS is not set
 # CONFIG_FB_SVGALIB is not set
@@ -1760,7 +1908,19 @@ CONFIG_PLAT_VERSATILE_CLCD=y
 # CONFIG_FB_AUO_K190X is not set
 # CONFIG_FB_SIMPLE is not set
 # CONFIG_FB_SSD1307 is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=m
+# CONFIG_LCD_PLATFORM is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_GENERIC=y
+# CONFIG_BACKLIGHT_PM8941_WLED is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+# CONFIG_BACKLIGHT_ADP8870 is not set
+# CONFIG_BACKLIGHT_LM3639 is not set
+# CONFIG_BACKLIGHT_GPIO is not set
+# CONFIG_BACKLIGHT_LV5207LP is not set
+# CONFIG_BACKLIGHT_BD6107 is not set
+# CONFIG_BACKLIGHT_ARCXCNN is not set
 # CONFIG_VGASTATE is not set
 CONFIG_VIDEOMODE_HELPERS=y
 
@@ -1776,16 +1936,11 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_VGA16 is not set
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_SOUND=y
-CONFIG_SOUND_OSS_CORE=y
-CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+# CONFIG_SOUND_OSS_CORE is not set
 CONFIG_SND=y
 CONFIG_SND_TIMER=y
 CONFIG_SND_PCM=y
-# CONFIG_SND_SEQUENCER is not set
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_OSSEMUL is not set
 CONFIG_SND_PCM_TIMER=y
 # CONFIG_SND_DYNAMIC_MINORS is not set
 CONFIG_SND_SUPPORT_OLD_API=y
@@ -1794,11 +1949,9 @@ CONFIG_SND_VERBOSE_PROCFS=y
 # CONFIG_SND_VERBOSE_PRINTK is not set
 # CONFIG_SND_DEBUG is not set
 CONFIG_SND_VMASTER=y
-# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_SEQUENCER is not set
 # CONFIG_SND_OPL3_LIB_SEQ is not set
 # CONFIG_SND_OPL4_LIB_SEQ is not set
-# CONFIG_SND_SBAWE_SEQ is not set
-# CONFIG_SND_EMU10K1_SEQ is not set
 CONFIG_SND_AC97_CODEC=y
 # CONFIG_SND_DRIVERS is not set
 
@@ -1820,7 +1973,6 @@ CONFIG_SND_USB=y
 # CONFIG_SND_USB_TONEPORT is not set
 # CONFIG_SND_USB_VARIAX is not set
 # CONFIG_SND_SOC is not set
-# CONFIG_SOUND_PRIME is not set
 CONFIG_AC97_BUS=y
 
 #
@@ -1836,9 +1988,11 @@ CONFIG_HID_GENERIC=y
 # Special HID drivers
 #
 CONFIG_HID_A4TECH=y
+# CONFIG_HID_ACCUTOUCH is not set
 # CONFIG_HID_ACRUX is not set
 CONFIG_HID_APPLE=y
 # CONFIG_HID_APPLEIR is not set
+# CONFIG_HID_ASUS is not set
 # CONFIG_HID_AUREAL is not set
 CONFIG_HID_BELKIN=y
 # CONFIG_HID_BETOP_FF is not set
@@ -1846,7 +2000,7 @@ CONFIG_HID_CHERRY=y
 CONFIG_HID_CHICONY=y
 # CONFIG_HID_CORSAIR is not set
 # CONFIG_HID_PRODIKEYS is not set
-# CONFIG_HID_CP2112 is not set
+# CONFIG_HID_CMEDIA is not set
 CONFIG_HID_CYPRESS=y
 CONFIG_HID_DRAGONRISE=y
 # CONFIG_DRAGONRISE_FF is not set
@@ -1864,9 +2018,11 @@ CONFIG_HID_EZKEY=y
 # CONFIG_HID_WALTOP is not set
 CONFIG_HID_GYRATION=y
 # CONFIG_HID_ICADE is not set
+CONFIG_HID_ITE=y
 CONFIG_HID_TWINHAN=y
 CONFIG_HID_KENSINGTON=y
 # CONFIG_HID_LCPOWER is not set
+# CONFIG_HID_LED is not set
 # CONFIG_HID_LENOVO is not set
 CONFIG_HID_LOGITECH=y
 # CONFIG_HID_LOGITECH_HIDPP is not set
@@ -1875,9 +2031,11 @@ CONFIG_HID_LOGITECH=y
 # CONFIG_LOGIG940_FF is not set
 # CONFIG_LOGIWHEELS_FF is not set
 # CONFIG_HID_MAGICMOUSE is not set
+# CONFIG_HID_MAYFLASH is not set
 CONFIG_HID_MICROSOFT=y
 CONFIG_HID_MONTEREY=y
 # CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTI is not set
 CONFIG_HID_NTRIG=y
 # CONFIG_HID_ORTEK is not set
 CONFIG_HID_PANTHERLORD=y
@@ -1887,6 +2045,7 @@ CONFIG_HID_PETALYNX=y
 # CONFIG_HID_PICOLCD is not set
 # CONFIG_HID_PLANTRONICS is not set
 # CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_RETRODE is not set
 # CONFIG_HID_ROCCAT is not set
 # CONFIG_HID_SAITEK is not set
 CONFIG_HID_SAMSUNG=y
@@ -1905,6 +2064,7 @@ CONFIG_HID_TOPSEED=y
 # CONFIG_HID_THINGM is not set
 CONFIG_HID_THRUSTMASTER=y
 # CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_HID_UDRAW_PS3 is not set
 # CONFIG_HID_WACOM is not set
 # CONFIG_HID_WIIMOTE is not set
 # CONFIG_HID_XINMO is not set
@@ -1912,6 +2072,7 @@ CONFIG_HID_ZEROPLUS=y
 # CONFIG_ZEROPLUS_FF is not set
 # CONFIG_HID_ZYDACRON is not set
 # CONFIG_HID_SENSOR_HUB is not set
+# CONFIG_HID_ALPS is not set
 
 #
 # USB HID support
@@ -1938,7 +2099,7 @@ CONFIG_USB_DEFAULT_PERSIST=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
 # CONFIG_USB_OTG is not set
 # CONFIG_USB_OTG_WHITELIST is not set
-# CONFIG_USB_ULPI_BUS is not set
+# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set
 CONFIG_USB_MON=y
 # CONFIG_USB_WUSB_CBAF is not set
 
@@ -2016,7 +2177,6 @@ CONFIG_USB_ISP1760_HOST_ROLE=y
 # CONFIG_USB_SEVSEG is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
-# CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_IDMOUSE is not set
@@ -2030,7 +2190,9 @@ CONFIG_USB_ISP1760_HOST_ROLE=y
 # CONFIG_USB_ISIGHTFW is not set
 # CONFIG_USB_YUREX is not set
 # CONFIG_USB_EZUSB_FX2 is not set
+# CONFIG_USB_HUB_USB251XB is not set
 # CONFIG_USB_HSIC_USB3503 is not set
+# CONFIG_USB_HSIC_USB4604 is not set
 # CONFIG_USB_LINK_LAYER_TEST is not set
 # CONFIG_USB_CHAOSKEY is not set
 
@@ -2039,28 +2201,30 @@ CONFIG_USB_ISP1760_HOST_ROLE=y
 #
 # CONFIG_USB_PHY is not set
 # CONFIG_NOP_USB_XCEIV is not set
-# CONFIG_AM335X_PHY_USB is not set
 # CONFIG_USB_GPIO_VBUS is not set
 # CONFIG_USB_ISP1301 is not set
 # CONFIG_USB_ULPI is not set
 # CONFIG_USB_GADGET is not set
-# CONFIG_USB_LED_TRIG is not set
-# CONFIG_UWB is not set
-CONFIG_MMC=y
-# CONFIG_MMC_DEBUG is not set
 
 #
-# MMC/SD/SDIO Card Drivers
+# USB Power Delivery and Type-C drivers
 #
+# CONFIG_TYPEC_UCSI is not set
+# CONFIG_USB_LED_TRIG is not set
+# CONFIG_USB_ULPI_BUS is not set
+# CONFIG_UWB is not set
+CONFIG_MMC=y
+CONFIG_PWRSEQ_EMMC=y
+CONFIG_PWRSEQ_SIMPLE=y
 CONFIG_MMC_BLOCK=y
 CONFIG_MMC_BLOCK_MINORS=8
-CONFIG_MMC_BLOCK_BOUNCE=y
 # CONFIG_SDIO_UART is not set
 # CONFIG_MMC_TEST is not set
 
 #
 # MMC/SD/SDIO Host Controller Drivers
 #
+# CONFIG_MMC_DEBUG is not set
 CONFIG_MMC_ARMMMCI=y
 # CONFIG_MMC_SDHCI is not set
 # CONFIG_MMC_DW is not set
@@ -2072,6 +2236,7 @@ CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 # CONFIG_LEDS_CLASS_FLASH is not set
+# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set
 
 #
 # LED drivers
@@ -2083,6 +2248,7 @@ CONFIG_LEDS_CLASS=y
 # CONFIG_LEDS_PCA9532 is not set
 CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_LP3952 is not set
 # CONFIG_LEDS_LP5521 is not set
 # CONFIG_LEDS_LP5523 is not set
 # CONFIG_LEDS_LP5562 is not set
@@ -2096,12 +2262,15 @@ CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_TCA6507 is not set
 # CONFIG_LEDS_TLC591XX is not set
 # CONFIG_LEDS_LM355x is not set
+# CONFIG_LEDS_IS31FL319X is not set
+# CONFIG_LEDS_IS31FL32XX is not set
 
 #
 # LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)
 #
 # CONFIG_LEDS_BLINKM is not set
 # CONFIG_LEDS_SYSCON is not set
+# CONFIG_LEDS_USER is not set
 
 #
 # LED Triggers
@@ -2109,6 +2278,8 @@ CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_TRIGGERS=y
 # CONFIG_LEDS_TRIGGER_TIMER is not set
 # CONFIG_LEDS_TRIGGER_ONESHOT is not set
+# CONFIG_LEDS_TRIGGER_DISK is not set
+# CONFIG_LEDS_TRIGGER_MTD is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
 CONFIG_LEDS_TRIGGER_CPU=y
@@ -2120,10 +2291,10 @@ CONFIG_LEDS_TRIGGER_CPU=y
 #
 # CONFIG_LEDS_TRIGGER_TRANSIENT is not set
 # CONFIG_LEDS_TRIGGER_CAMERA is not set
+# CONFIG_LEDS_TRIGGER_PANIC is not set
 # CONFIG_ACCESSIBILITY is not set
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
-# CONFIG_EDAC is not set
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -2131,6 +2302,7 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
 CONFIG_RTC_SYSTOHC=y
 CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
 # CONFIG_RTC_DEBUG is not set
+CONFIG_RTC_NVMEM=y
 
 #
 # RTC interfaces
@@ -2149,32 +2321,37 @@ CONFIG_RTC_INTF_DEV=y
 # CONFIG_RTC_DRV_DS1307 is not set
 # CONFIG_RTC_DRV_DS1374 is not set
 # CONFIG_RTC_DRV_DS1672 is not set
-# CONFIG_RTC_DRV_DS3232 is not set
 # CONFIG_RTC_DRV_HYM8563 is not set
 # CONFIG_RTC_DRV_MAX6900 is not set
 # CONFIG_RTC_DRV_RS5C372 is not set
 # CONFIG_RTC_DRV_ISL1208 is not set
 # CONFIG_RTC_DRV_ISL12022 is not set
-# CONFIG_RTC_DRV_ISL12057 is not set
 # CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF2127 is not set
 # CONFIG_RTC_DRV_PCF8523 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
 # CONFIG_RTC_DRV_PCF85063 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
 # CONFIG_RTC_DRV_PCF8583 is not set
 # CONFIG_RTC_DRV_M41T80 is not set
 # CONFIG_RTC_DRV_BQ32K is not set
 # CONFIG_RTC_DRV_S35390A is not set
 # CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8010 is not set
 # CONFIG_RTC_DRV_RX8581 is not set
 # CONFIG_RTC_DRV_RX8025 is not set
 # CONFIG_RTC_DRV_EM3027 is not set
-# CONFIG_RTC_DRV_RV3029C2 is not set
 # CONFIG_RTC_DRV_RV8803 is not set
 
 #
 # SPI RTC drivers
 #
+CONFIG_RTC_I2C_AND_SPI=y
+
+#
+# SPI and I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS3232 is not set
+# CONFIG_RTC_DRV_PCF2127 is not set
+# CONFIG_RTC_DRV_RV3029C2 is not set
 
 #
 # Platform RTC drivers
@@ -2201,13 +2378,20 @@ CONFIG_RTC_INTF_DEV=y
 #
 # CONFIG_RTC_DRV_PL030 is not set
 CONFIG_RTC_DRV_PL031=y
+# CONFIG_RTC_DRV_FTRTC010 is not set
 # CONFIG_RTC_DRV_SNVS is not set
+# CONFIG_RTC_DRV_R7301 is not set
 
 #
 # HID Sensor RTC drivers
 #
 # CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
 # CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
 # CONFIG_AUXDISPLAY is not set
 # CONFIG_UIO is not set
 # CONFIG_VIRT_DRIVERS is not set
@@ -2224,7 +2408,9 @@ CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
 #
 # Microsoft Hyper-V guest support
 #
+# CONFIG_HYPERV_TSCPAGE is not set
 # CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
 # CONFIG_CHROME_PLATFORMS is not set
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -2233,26 +2419,29 @@ CONFIG_COMMON_CLK=y
 #
 # Common Clock Framework
 #
+CONFIG_ICST=y
 CONFIG_COMMON_CLK_VERSATILE=y
 CONFIG_CLK_SP810=y
 CONFIG_CLK_VEXPRESS_OSC=y
+# CONFIG_CLK_HSDK is not set
 # CONFIG_COMMON_CLK_SI5351 is not set
 # CONFIG_COMMON_CLK_SI514 is not set
 # CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
 # CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
 # CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
 # CONFIG_COMMON_CLK_PXA is not set
-# CONFIG_COMMON_CLK_CDCE706 is not set
-
-#
-# Hardware Spinlock drivers
-#
+# CONFIG_COMMON_CLK_PIC32 is not set
+# CONFIG_COMMON_CLK_VC5 is not set
+# CONFIG_HWSPINLOCK is not set
 
 #
 # Clock Source drivers
 #
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_PROBE=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
@@ -2272,12 +2461,13 @@ CONFIG_IOMMU_SUPPORT=y
 # Generic IOMMU Pagetable Support
 #
 # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
+# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
 # CONFIG_ARM_SMMU is not set
 
 #
 # Remoteproc drivers
 #
-# CONFIG_STE_MODEM_RPROC is not set
+# CONFIG_REMOTEPROC is not set
 
 #
 # Rpmsg drivers
@@ -2286,7 +2476,23 @@ CONFIG_IOMMU_SUPPORT=y
 #
 # SOC (System On Chip) specific Drivers
 #
+
+#
+# Amlogic SoC drivers
+#
+
+#
+# Broadcom SoC drivers
+#
 # CONFIG_SOC_BRCMSTB is not set
+
+#
+# i.MX SoC drivers
+#
+
+#
+# Qualcomm SoC drivers
+#
 # CONFIG_SUNXI_SRAM is not set
 # CONFIG_SOC_TI is not set
 # CONFIG_PM_DEVFREQ is not set
@@ -2296,6 +2502,7 @@ CONFIG_IOMMU_SUPPORT=y
 # CONFIG_PWM is not set
 CONFIG_IRQCHIP=y
 CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
 # CONFIG_IPACK_BUS is not set
 # CONFIG_RESET_CONTROLLER is not set
 # CONFIG_FMC is not set
@@ -2304,9 +2511,9 @@ CONFIG_ARM_GIC=y
 # PHY Subsystem
 #
 # CONFIG_GENERIC_PHY is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
 # CONFIG_PHY_PXA_28NM_HSIC is not set
 # CONFIG_PHY_PXA_28NM_USB2 is not set
-# CONFIG_BCM_KONA_USB2_PHY is not set
 # CONFIG_POWERCAP is not set
 # CONFIG_MCB is not set
 
@@ -2320,21 +2527,30 @@ CONFIG_ARM_PMU=y
 # Android
 #
 # CONFIG_ANDROID is not set
-# CONFIG_NVMEM is not set
+# CONFIG_DAX is not set
+CONFIG_NVMEM=y
 # CONFIG_STM is not set
 # CONFIG_INTEL_TH is not set
+# CONFIG_FPGA is not set
 
 #
-# FPGA Configuration Support
+# FSI support
 #
-# CONFIG_FPGA is not set
+# CONFIG_FSI is not set
+# CONFIG_TEE is not set
 
 #
 # Firmware Drivers
 #
 CONFIG_ARM_PSCI_FW=y
+# CONFIG_ARM_PSCI_CHECKER is not set
 # CONFIG_FIRMWARE_MEMMAP is not set
 CONFIG_HAVE_ARM_SMCCC=y
+# CONFIG_GOOGLE_FIRMWARE is not set
+
+#
+# Tegra firmware driver
+#
 
 #
 # File systems
@@ -2359,7 +2575,11 @@ CONFIG_FS_MBCACHE=y
 # CONFIG_NILFS2_FS is not set
 # CONFIG_F2FS_FS is not set
 # CONFIG_FS_POSIX_ACL is not set
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
 CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
 CONFIG_FSNOTIFY=y
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY_USER=y
@@ -2389,6 +2609,7 @@ CONFIG_FAT_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_FAT_DEFAULT_CODEPAGE=437
 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
 # CONFIG_NTFS_FS is not set
 
 #
@@ -2406,6 +2627,7 @@ CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
 # CONFIG_CONFIGFS_FS is not set
 CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
@@ -2429,7 +2651,8 @@ CONFIG_UBIFS_FS=y
 CONFIG_UBIFS_FS_LZO=y
 CONFIG_UBIFS_FS_ZLIB=y
 # CONFIG_UBIFS_ATIME_SUPPORT is not set
-# CONFIG_LOGFS is not set
+# CONFIG_UBIFS_FS_ENCRYPTION is not set
+CONFIG_UBIFS_FS_SECURITY=y
 CONFIG_CRAMFS=y
 CONFIG_SQUASHFS=y
 CONFIG_SQUASHFS_FILE_CACHE=y
@@ -2442,6 +2665,7 @@ CONFIG_SQUASHFS_ZLIB=y
 # CONFIG_SQUASHFS_LZ4 is not set
 CONFIG_SQUASHFS_LZO=y
 # CONFIG_SQUASHFS_XZ is not set
+# CONFIG_SQUASHFS_ZSTD is not set
 # CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
 # CONFIG_SQUASHFS_EMBEDDED is not set
 CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
@@ -2538,6 +2762,7 @@ CONFIG_NLS_ISO8859_1=y
 # printk and dmesg options
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7
 CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_DYNAMIC_DEBUG is not set
@@ -2564,6 +2789,7 @@ CONFIG_SECTION_MISMATCH_WARN_ONLY=y
 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
+CONFIG_MAGIC_SYSRQ_SERIAL=y
 CONFIG_DEBUG_KERNEL=y
 
 #
@@ -2571,6 +2797,9 @@ CONFIG_DEBUG_KERNEL=y
 #
 # CONFIG_PAGE_EXTENSION is not set
 # CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_PAGE_REF is not set
+# CONFIG_DEBUG_RODATA_TEST is not set
 # CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
 # CONFIG_SLUB_STATS is not set
@@ -2578,6 +2807,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 # CONFIG_DEBUG_KMEMLEAK is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_VM is not set
+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
+# CONFIG_DEBUG_VIRTUAL is not set
 CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_DEBUG_PER_CPU_MAPS is not set
 # CONFIG_DEBUG_SHIRQ is not set
@@ -2585,11 +2816,12 @@ CONFIG_DEBUG_MEMORY_INIT=y
 #
 # Debug Lockups and Hangs
 #
-# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_SOFTLOCKUP_DETECTOR is not set
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
 # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
 CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+# CONFIG_WQ_WATCHDOG is not set
 # CONFIG_PANIC_ON_OOPS is not set
 CONFIG_PANIC_ON_OOPS_VALUE=0
 CONFIG_PANIC_TIMEOUT=0
@@ -2598,7 +2830,6 @@ CONFIG_PANIC_TIMEOUT=0
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_SCHED_STACK_END_CHECK is not set
 # CONFIG_DEBUG_TIMEKEEPING is not set
-# CONFIG_TIMER_STATS is not set
 
 #
 # Lock Debugging (spinlocks, mutexes, etc...)
@@ -2613,7 +2844,9 @@ CONFIG_PANIC_TIMEOUT=0
 # CONFIG_DEBUG_ATOMIC_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_LOCK_TORTURE_TEST is not set
-# CONFIG_STACKTRACE is not set
+# CONFIG_WW_MUTEX_SELFTEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set
 # CONFIG_DEBUG_KOBJECT is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_LIST is not set
@@ -2626,29 +2859,38 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # RCU Debugging
 #
 # CONFIG_PROVE_RCU is not set
-# CONFIG_SPARSE_RCU_POINTER is not set
 # CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
-# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_TRACE=y
 # CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
 # CONFIG_NOTIFIER_ERROR_INJECTION is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_NOP_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_C_RECORDMCOUNT=y
 CONFIG_TRACE_CLOCK=y
 CONFIG_RING_BUFFER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
 CONFIG_RING_BUFFER_ALLOW_SWAP=y
+CONFIG_TRACING=y
 CONFIG_TRACING_SUPPORT=y
 CONFIG_FTRACE=y
 # CONFIG_FUNCTION_TRACER is not set
 # CONFIG_IRQSOFF_TRACER is not set
 # CONFIG_SCHED_TRACER is not set
+# CONFIG_HWLAT_TRACER is not set
 # CONFIG_ENABLE_DEFAULT_TRACERS is not set
 # CONFIG_FTRACE_SYSCALLS is not set
 # CONFIG_TRACER_SNAPSHOT is not set
@@ -2657,18 +2899,21 @@ CONFIG_BRANCH_PROFILE_NONE=y
 # CONFIG_PROFILE_ALL_BRANCHES is not set
 # CONFIG_STACK_TRACER is not set
 # CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_UPROBE_EVENT is not set
-# CONFIG_PROBE_EVENTS is not set
+CONFIG_UPROBE_EVENTS=y
+CONFIG_PROBE_EVENTS=y
 # CONFIG_TRACEPOINT_BENCHMARK is not set
 # CONFIG_RING_BUFFER_BENCHMARK is not set
 # CONFIG_RING_BUFFER_STARTUP_TEST is not set
+# CONFIG_TRACE_EVAL_MAP_FILE is not set
 CONFIG_TRACING_EVENTS_GPIO=y
+# CONFIG_DMA_API_DEBUG is not set
 
 #
 # Runtime Testing
 #
 # CONFIG_LKDTM is not set
 # CONFIG_TEST_LIST_SORT is not set
+# CONFIG_TEST_SORT is not set
 # CONFIG_BACKTRACE_SELF_TEST is not set
 # CONFIG_RBTREE_TEST is not set
 # CONFIG_INTERVAL_TREE_TEST is not set
@@ -2678,21 +2923,29 @@ CONFIG_TRACING_EVENTS_GPIO=y
 # CONFIG_TEST_STRING_HELPERS is not set
 # CONFIG_TEST_KSTRTOX is not set
 # CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
 # CONFIG_TEST_RHASHTABLE is not set
 # CONFIG_TEST_HASH is not set
-# CONFIG_DMA_API_DEBUG is not set
 # CONFIG_TEST_LKM is not set
 # CONFIG_TEST_USER_COPY is not set
 # CONFIG_TEST_BPF is not set
 # CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_SYSCTL is not set
 # CONFIG_TEST_UDELAY is not set
-# CONFIG_MEMTEST is not set
 # CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_BUG_ON_DATA_CORRUPTION is not set
 # CONFIG_SAMPLES is not set
 CONFIG_HAVE_ARCH_KGDB=y
 # CONFIG_KGDB is not set
-# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
 # CONFIG_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_UNWINDER_FRAME_POINTER is not set
+CONFIG_UNWINDER_ARM=y
 CONFIG_ARM_UNWIND=y
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_LL is not set
@@ -2700,7 +2953,6 @@ CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 # CONFIG_DEBUG_UART_8250 is not set
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 # CONFIG_PID_IN_CONTEXTIDR is not set
-# CONFIG_DEBUG_SET_MODULE_RONX is not set
 # CONFIG_CORESIGHT is not set
 
 #
@@ -2710,6 +2962,9 @@ CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 # CONFIG_SECURITY_DMESG_RESTRICT is not set
 # CONFIG_SECURITY is not set
 # CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+# CONFIG_HARDENED_USERCOPY is not set
+# CONFIG_STATIC_USERMODEHELPER is not set
 CONFIG_DEFAULT_SECURITY_DAC=y
 CONFIG_DEFAULT_SECURITY=""
 CONFIG_CRYPTO=y
@@ -2727,9 +2982,12 @@ CONFIG_CRYPTO_HASH2=y
 CONFIG_CRYPTO_RNG=m
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_RNG_DEFAULT=m
-CONFIG_CRYPTO_PCOMP2=y
 CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+CONFIG_CRYPTO_ACOMP2=y
 # CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
 CONFIG_CRYPTO_MANAGER=m
 CONFIG_CRYPTO_MANAGER2=y
 # CONFIG_CRYPTO_USER is not set
@@ -2791,6 +3049,7 @@ CONFIG_CRYPTO_CRC32C=y
 # CONFIG_CRYPTO_SHA1 is not set
 CONFIG_CRYPTO_SHA256=m
 # CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
 # CONFIG_CRYPTO_TGR192 is not set
 # CONFIG_CRYPTO_WP512 is not set
 
@@ -2798,6 +3057,7 @@ CONFIG_CRYPTO_SHA256=m
 # Ciphers
 #
 CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_AES_TI is not set
 # CONFIG_CRYPTO_ANUBIS is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_BLOWFISH is not set
@@ -2818,7 +3078,6 @@ CONFIG_CRYPTO_AES=y
 # Compression
 #
 CONFIG_CRYPTO_DEFLATE=y
-# CONFIG_CRYPTO_ZLIB is not set
 CONFIG_CRYPTO_LZO=y
 # CONFIG_CRYPTO_842 is not set
 # CONFIG_CRYPTO_LZ4 is not set
@@ -2831,7 +3090,6 @@ CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_DRBG_MENU=m
 CONFIG_CRYPTO_DRBG_HMAC=y
 # CONFIG_CRYPTO_DRBG_HASH is not set
-# CONFIG_CRYPTO_DRBG_CTR is not set
 CONFIG_CRYPTO_DRBG=m
 CONFIG_CRYPTO_JITTERENTROPY=m
 # CONFIG_CRYPTO_USER_API_HASH is not set
@@ -2844,7 +3102,7 @@ CONFIG_CRYPTO_JITTERENTROPY=m
 # Certificates for signature checking
 #
 # CONFIG_ARM_CRYPTO is not set
-# CONFIG_BINARY_PRINTF is not set
+CONFIG_BINARY_PRINTF=y
 
 #
 # Library routines
@@ -2868,6 +3126,7 @@ CONFIG_CRC32_SLICEBY8=y
 # CONFIG_CRC32_SLICEBY4 is not set
 # CONFIG_CRC32_SARWATE is not set
 # CONFIG_CRC32_BIT is not set
+# CONFIG_CRC4 is not set
 # CONFIG_CRC7 is not set
 # CONFIG_LIBCRC32C is not set
 # CONFIG_CRC8 is not set
@@ -2896,19 +3155,25 @@ CONFIG_DECOMPRESS_LZ4=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_DMA=y
+# CONFIG_SGL_ALLOC is not set
+# CONFIG_DMA_NOOP_OPS is not set
+# CONFIG_DMA_VIRT_OPS is not set
 CONFIG_CPU_RMAP=y
 CONFIG_DQL=y
 CONFIG_GLOB=y
 # CONFIG_GLOB_SELFTEST is not set
 CONFIG_NLATTR=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 # CONFIG_CORDIC is not set
 # CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
 CONFIG_LIBFDT=y
 CONFIG_FONT_SUPPORT=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
 # CONFIG_SG_SPLIT is not set
+CONFIG_SG_POOL=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_STRING_SELFTEST is not set
 # CONFIG_VIRTUALIZATION is not set
diff --git a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
index 59e98689c2c..f5274104d60 100644
--- a/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
@@ -12,7 +12,6 @@ RUN yum upgrade -y && \
       automake \
       bzip2 \
       file \
-      cmake3 \
       gcc \
       gcc-c++ \
       git \
@@ -35,7 +34,7 @@ RUN yum upgrade -y && \
       zlib-devel.x86_64 \
       && yum clean all
 
-RUN mkdir -p /rustroot/bin && ln -s /usr/bin/cmake3 /rustroot/bin/cmake
+RUN mkdir -p /rustroot/bin
 
 ENV PATH=/rustroot/bin:$PATH
 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
diff --git a/src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile
index 2b2871c2ec0..5dc282403be 100644
--- a/src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-powerpc64le-linux/Dockerfile
@@ -1,22 +1,16 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 COPY scripts/cross-apt-packages.sh /scripts/
 RUN sh /scripts/cross-apt-packages.sh
 
 COPY scripts/rustbuild-setup.sh /scripts/
 RUN sh /scripts/rustbuild-setup.sh
-USER rustbuild
 WORKDIR /tmp
 
-USER root
-
 RUN apt-get install -y --no-install-recommends rpm2cpio cpio
 COPY host-x86_64/dist-powerpc64le-linux/shared.sh host-x86_64/dist-powerpc64le-linux/build-powerpc64le-toolchain.sh /tmp/
 RUN ./build-powerpc64le-toolchain.sh
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile
index c2abe9f19a3..8f4ad0f4e75 100644
--- a/src/ci/docker/host-x86_64/dist-various-1/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-various-1/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   g++ \
   automake \
   bison \
@@ -73,8 +74,8 @@ RUN env \
     CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv6 -marm -mfpu=vfp" \
     bash musl.sh armhf && \
     env \
-    CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv7-a" \
-    CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv7-a" \
+    CC=arm-linux-gnueabihf-gcc CFLAGS="-march=armv7-a+fp" \
+    CXX=arm-linux-gnueabihf-g++ CXXFLAGS="-march=armv7-a+fp" \
     bash musl.sh armv7hf && \
     env \
     CC=mips-openwrt-linux-gcc \
@@ -147,7 +148,7 @@ ENV TARGETS=$TARGETS,armv7a-none-eabi
 ENV CFLAGS_armv5te_unknown_linux_musleabi="-march=armv5te -marm -mfloat-abi=soft" \
     CFLAGS_arm_unknown_linux_musleabi="-march=armv6 -marm" \
     CFLAGS_arm_unknown_linux_musleabihf="-march=armv6 -marm -mfpu=vfp" \
-    CFLAGS_armv7_unknown_linux_musleabihf="-march=armv7-a" \
+    CFLAGS_armv7_unknown_linux_musleabihf="-march=armv7-a+fp" \
     CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
     CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
     CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \
@@ -186,9 +187,6 @@ ENV SCRIPT \
       python3 ../x.py --stage 2 test --host='' --target $RUN_MAKE_TARGETS tests/run-make && \
       python3 ../x.py dist --host='' --target $TARGETS
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 # sccache
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
index 6367aacfdde..dd1c5fced0e 100644
--- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 COPY scripts/cross-apt-packages.sh /scripts/
 RUN sh /scripts/cross-apt-packages.sh
@@ -9,7 +9,7 @@ RUN sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
 RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y --no-install-recommends \
   build-essential \
 # gcc-multilib can not be installed together with gcc-arm-linux-gnueabi
-  g++-8-multilib \
+  g++-9-multilib \
   libedit-dev \
   libgmp-dev \
   libisl-dev \
@@ -24,7 +24,7 @@ RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y --no
   # Needed for apt-key to work:
   dirmngr \
   gpg-agent \
-  g++-8-arm-linux-gnueabi
+  g++-9-arm-linux-gnueabi
 
 RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486
 RUN add-apt-repository -y 'deb https://apt.dilos.org/dilos dilos2 main'
@@ -51,8 +51,8 @@ ENV \
     AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar \
     CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
     CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++ \
-    CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-8 \
-    CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-8 \
+    CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-9 \
+    CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-9 \
     AR_x86_64_fortanix_unknown_sgx=ar \
     CC_x86_64_fortanix_unknown_sgx=clang-11 \
     CFLAGS_x86_64_fortanix_unknown_sgx="-D__ELF__ -isystem/usr/include/x86_64-linux-gnu -mlvi-hardening -mllvm -x86-experimental-lvi-inline-asm-hardening" \
@@ -67,14 +67,14 @@ ENV \
     CXX_i686_unknown_uefi=clang++-11 \
     CC_x86_64_unknown_uefi=clang-11 \
     CXX_x86_64_unknown_uefi=clang++-11 \
-    CC=gcc-8 \
-    CXX=g++-8
+    CC=gcc-9 \
+    CXX=g++-9
 
 WORKDIR /build
 COPY scripts/musl.sh /build
 RUN env \
-    CC=arm-linux-gnueabi-gcc-8 CFLAGS="-march=armv7-a" \
-    CXX=arm-linux-gnueabi-g++-8 CXXFLAGS="-march=armv7-a" \
+    CC=arm-linux-gnueabi-gcc-9 CFLAGS="-march=armv7-a" \
+    CXX=arm-linux-gnueabi-g++-9 CXXFLAGS="-march=armv7-a" \
     bash musl.sh armv7 && \
     rm -rf /build/*
 
@@ -96,9 +96,6 @@ RUN /tmp/build-wasi-toolchain.sh
 COPY scripts/freebsd-toolchain.sh /tmp/
 RUN /tmp/freebsd-toolchain.sh i686
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
@@ -132,7 +129,7 @@ ENV TARGETS=$TARGETS,i686-unknown-uefi
 ENV TARGETS=$TARGETS,x86_64-unknown-uefi
 
 # As per https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211
-# we need asm in the search path for gcc-8 (for gnux32) but not in the search path of the
+# we need asm in the search path for gcc-9 (for gnux32) but not in the search path of the
 # cross compilers.
 # Luckily one of the folders is /usr/local/include so symlink /usr/include/asm-generic there
 RUN ln -s /usr/include/asm-generic /usr/local/include/asm
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
index afd536a6602..319989df334 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
@@ -12,7 +12,6 @@ RUN yum upgrade -y && \
       automake \
       bzip2 \
       file \
-      cmake3 \
       gcc \
       gcc-c++ \
       git \
@@ -35,7 +34,7 @@ RUN yum upgrade -y && \
       zlib-devel.x86_64 \
       && yum clean all
 
-RUN mkdir -p /rustroot/bin && ln -s /usr/bin/cmake3 /rustroot/bin/cmake
+RUN mkdir -p /rustroot/bin
 
 ENV PATH=/rustroot/bin:$PATH
 ENV LD_LIBRARY_PATH=/rustroot/lib64:/rustroot/lib32:/rustroot/lib
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
index 6f04dcad9a5..c9a6a2dd069 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   g++ \
   make \
   ninja-build \
@@ -11,6 +12,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
   python3 \
   git \
   cmake \
+  bzip2 \
   xz-utils \
   sudo \
   gdb \
@@ -21,10 +23,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
 
 WORKDIR /build/
 
-# Build cmake before musl toolchain, as we replace the compiler during that step.
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/musl-toolchain.sh /build/
 # We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
 RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-netbsd/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-netbsd/Dockerfile
index 041bacf3397..effdc99d9a6 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-netbsd/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-netbsd/Dockerfile
@@ -1,14 +1,14 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
+ARG DEBIAN_FRONTEND=noninteractive
 COPY scripts/cross-apt-packages.sh /scripts/
 RUN sh /scripts/cross-apt-packages.sh
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y zlib1g-dev
+RUN apt-get install -y zlib1g-dev
 
 COPY host-x86_64/dist-x86_64-netbsd/build-netbsd-toolchain.sh /tmp/
-RUN /tmp/build-netbsd-toolchain.sh
-
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
+# GCC 10 changed the default to -fno-common, which causes errors with the NetBSD-9.0 sources like:
+# /usr/bin/ld: buf.o:(.bss+0x0): multiple definition of `debug_file'; arch.o:(.bss+0x0): first defined here
+RUN env HOST_CFLAGS="-O -fcommon" /tmp/build-netbsd-toolchain.sh
 
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile
index 002f221b1f3..4fe66014c17 100644
--- a/src/ci/docker/host-x86_64/test-various/Dockerfile
+++ b/src/ci/docker/host-x86_64/test-various/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   clang-11 \
   g++ \
   make \
@@ -15,10 +16,12 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
   gdb \
   libssl-dev \
   pkg-config \
+  bzip2 \
   xz-utils \
   wget \
   patch \
   ovmf \
+  ovmf-ia32 \
   qemu-efi-aarch64 \
   qemu-system-arm \
   qemu-system-x86 \
@@ -27,19 +30,11 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
 RUN curl -sL https://nodejs.org/dist/v18.12.0/node-v18.12.0-linux-x64.tar.xz | \
   tar -xJ
 
-# Install 32-bit OVMF files for the i686-unknown-uefi test. This package
-# is not available in ubuntu 20.04, so download a 22.04 package.
-RUN curl -sL --output ovmf-ia32.deb http://mirrors.kernel.org/ubuntu/pool/universe/e/edk2/ovmf-ia32_2022.02-3_all.deb
-RUN dpkg -i ovmf-ia32.deb && rm ovmf-ia32.deb
-
 WORKDIR /build/
 COPY scripts/musl-toolchain.sh /build/
 RUN bash musl-toolchain.sh x86_64 && rm -rf build
 WORKDIR /
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py b/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py
index ffae7b0d4ac..3577643ca55 100755
--- a/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py
+++ b/src/ci/docker/host-x86_64/test-various/uefi_qemu_test/run.py
@@ -109,12 +109,7 @@ def build_and_run(tmp_dir, target):
                  '-drive',
                  f'format=raw,file=fat:rw:{esp}',
                  capture=True,
-                 # Ubuntu 20.04 (which is what the Dockerfile currently
-                 # uses) provides QEMU 4.2.1, which segfaults on
-                 # shutdown under some circumstances. That has been
-                 # fixed in newer versions of QEMU, but for now just
-                 # don't check the exit status.
-                 check=False,
+                 check=True,
                  # Set a timeout to kill the VM in case something goes wrong.
                  timeout=60).stdout
 
diff --git a/src/ci/docker/host-x86_64/wasm32/Dockerfile b/src/ci/docker/host-x86_64/wasm32/Dockerfile
index 0e8989e10f2..24a1ccb7fc2 100644
--- a/src/ci/docker/host-x86_64/wasm32/Dockerfile
+++ b/src/ci/docker/host-x86_64/wasm32/Dockerfile
@@ -1,6 +1,7 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   g++ \
   make \
   ninja-build \
@@ -20,9 +21,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
 COPY scripts/emscripten.sh /scripts/
 RUN bash /scripts/emscripten.sh
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
@@ -57,6 +55,7 @@ COPY static/gitconfig /etc/gitconfig
 
 # Emscripten installation is user-specific
 ENV NO_CHANGE_USER=1
+RUN chown 10719 -R /emsdk-portable/
 
 # Exclude library/alloc due to OOM in benches.
 ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile
index b404e3b982b..e4534d0f840 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-debug/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 ARG DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -26,9 +26,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   clang \
   && rm -rf /var/lib/apt/lists/*
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile
deleted file mode 100644
index 93d18bcf1b1..00000000000
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile
+++ /dev/null
@@ -1,54 +0,0 @@
-FROM ubuntu:22.04
-
-ARG DEBIAN_FRONTEND=noninteractive
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
-  g++ \
-  gcc-multilib \
-  make \
-  ninja-build \
-  file \
-  curl \
-  ca-certificates \
-  python3.11 \
-  git \
-  cmake \
-  sudo \
-  gdb \
-  llvm-14-tools \
-  llvm-14-dev \
-  libedit-dev \
-  libssl-dev \
-  pkg-config \
-  zlib1g-dev \
-  xz-utils \
-  nodejs \
-  mingw-w64 \
-  && rm -rf /var/lib/apt/lists/*
-
-# Install powershell (universal package) so we can test x.ps1 on Linux
-RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
-    dpkg -i powershell.deb && \
-    rm -f powershell.deb
-
-COPY scripts/sccache.sh /scripts/
-RUN sh /scripts/sccache.sh
-
-# We are disabling CI LLVM since this builder is intentionally using a host
-# LLVM, rather than the typical src/llvm-project LLVM.
-ENV NO_DOWNLOAD_CI_LLVM 1
-
-# This is not the latest LLVM version, so some components required by tests may
-# be missing.
-ENV IS_NOT_LATEST_LLVM 1
-
-# Using llvm-link-shared due to libffi issues -- see #34486
-ENV RUST_CONFIGURE_ARGS \
-      --build=x86_64-unknown-linux-gnu \
-      --llvm-root=/usr/lib/llvm-14 \
-      --enable-llvm-link-shared \
-      --set rust.thin-lto-import-instr-limit=10
-
-COPY host-x86_64/x86_64-gnu-llvm-14/script.sh /tmp/
-
-ENV SCRIPT /tmp/script.sh
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile
index 960683b92bd..444e0275d48 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:22.10
+FROM ubuntu:22.04
 
 ARG DEBIAN_FRONTEND=noninteractive
 
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   file \
   curl \
   ca-certificates \
-  python3 \
+  python3.11 \
   git \
   cmake \
   sudo \
@@ -49,20 +49,6 @@ ENV RUST_CONFIGURE_ARGS \
       --enable-llvm-link-shared \
       --set rust.thin-lto-import-instr-limit=10
 
-# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
-ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
-           # Run the `mir-opt` tests again but this time for a 32-bit target.
-           # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
-           # both 32-bit and 64-bit outputs updated by the PR author, before
-           # the PR is approved and tested for merging.
-           # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
-           # despite having different output on 32-bit vs 64-bit targets.
-           ../x --stage 2 test tests/mir-opt \
-                             --host='' --target=i686-unknown-linux-gnu && \
-           # Run the UI test suite again, but in `--pass=check` mode
-           #
-           # This is intended to make sure that both `--pass=check` continues to
-           # work.
-           #
-           ../x.ps1 --stage 2 test tests/ui --pass=check \
-                             --host='' --target=i686-unknown-linux-gnu
+COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
+
+ENV SCRIPT /tmp/script.sh
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/script.sh b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh
index 0120fd98298..0120fd98298 100755
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/script.sh
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile
index 7c75d0df590..1e2b802e64e 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile
@@ -45,20 +45,6 @@ ENV RUST_CONFIGURE_ARGS \
       --enable-llvm-link-shared \
       --set rust.thin-lto-import-instr-limit=10
 
-# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
-ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
-           # Run the `mir-opt` tests again but this time for a 32-bit target.
-           # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
-           # both 32-bit and 64-bit outputs updated by the PR author, before
-           # the PR is approved and tested for merging.
-           # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
-           # despite having different output on 32-bit vs 64-bit targets.
-           ../x --stage 2 test tests/mir-opt \
-                             --host='' --target=i686-unknown-linux-gnu && \
-           # Run the UI test suite again, but in `--pass=check` mode
-           #
-           # This is intended to make sure that both `--pass=check` continues to
-           # work.
-           #
-           ../x.ps1 --stage 2 test tests/ui --pass=check \
-                             --host='' --target=i686-unknown-linux-gnu
+COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
+
+ENV SCRIPT /tmp/script.sh
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-nopt/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-nopt/Dockerfile
index 1452c00a5d8..d8113e06723 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu-nopt/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu-nopt/Dockerfile
@@ -1,7 +1,8 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 # Avoid interactive prompts while installing `tzdata` dependency with `DEBIAN_FRONTEND`.
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
   g++ \
   make \
   ninja-build \
@@ -18,9 +19,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
   xz-utils \
   && rm -rf /var/lib/apt/lists/*
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu/Dockerfile
index 576487821dc..9025e9bb0a3 100644
--- a/src/ci/docker/host-x86_64/x86_64-gnu/Dockerfile
+++ b/src/ci/docker/host-x86_64/x86_64-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:20.04
+FROM ubuntu:22.04
 
 ARG DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -19,9 +19,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   mingw-w64 \
   && rm -rf /var/lib/apt/lists/*
 
-COPY scripts/cmake.sh /scripts/
-RUN /scripts/cmake.sh
-
 COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index 55fd6cca85a..2f83729bbb6 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -323,7 +323,7 @@ jobs:
           - name: mingw-check-tidy
             <<: *job-linux-16c
 
-          - name: x86_64-gnu-llvm-14
+          - name: x86_64-gnu-llvm-15
             <<: *job-linux-16c
 
           - name: x86_64-gnu-tools
@@ -469,11 +469,6 @@ jobs:
               RUST_BACKTRACE: 1
             <<: *job-linux-8c
 
-          - name: x86_64-gnu-llvm-14
-            env:
-              RUST_BACKTRACE: 1
-            <<: *job-linux-8c
-
           - name: x86_64-gnu-nopt
             <<: *job-linux-4c
 
diff --git a/src/doc/rustc/book.toml b/src/doc/rustc/book.toml
index cea6033ede2..14ae1a7207a 100644
--- a/src/doc/rustc/book.toml
+++ b/src/doc/rustc/book.toml
@@ -6,3 +6,6 @@ title = "The rustc book"
 [output.html]
 git-repository-url = "https://github.com/rust-lang/rust/tree/master/src/doc/rustc"
 edit-url-template = "https://github.com/rust-lang/rust/edit/master/src/doc/rustc/{path}"
+
+[output.html.playground]
+runnable = false
diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md
index f108831138d..7d9db743233 100644
--- a/src/doc/rustc/src/SUMMARY.md
+++ b/src/doc/rustc/src/SUMMARY.md
@@ -59,4 +59,6 @@
 - [Instrumentation-based Code Coverage](instrument-coverage.md)
 - [Linker-plugin-based LTO](linker-plugin-lto.md)
 - [Exploit Mitigations](exploit-mitigations.md)
+- [Symbol Mangling](symbol-mangling/index.md)
+    - [v0 Symbol Format](symbol-mangling/v0.md)
 - [Contributing to `rustc`](contributing.md)
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index 8de638dde4f..4622148e869 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -569,13 +569,15 @@ for the purpose of generating object code and linking.
 
 Supported values for this option are:
 
-* `v0` — The "v0" mangling scheme. The specific format is not specified at
-  this time.
+* `v0` — The "v0" mangling scheme.
 
 The default, if not specified, will use a compiler-chosen default which may
 change in the future.
 
+See the [Symbol Mangling] chapter for details on symbol mangling and the mangling format.
+
 [name mangling]: https://en.wikipedia.org/wiki/Name_mangling
+[Symbol Mangling]: ../symbol-mangling/index.md
 
 ## target-cpu
 
diff --git a/src/doc/rustc/src/command-line-arguments.md b/src/doc/rustc/src/command-line-arguments.md
index 4d32897cc14..2c7c05c0c4b 100644
--- a/src/doc/rustc/src/command-line-arguments.md
+++ b/src/doc/rustc/src/command-line-arguments.md
@@ -260,10 +260,6 @@ The valid types of print values are:
   This returns rustc's minimum supported deployment target if no `*_DEPLOYMENT_TARGET` variable
   is present in the environment, or otherwise returns the variable's parsed value.
 
-A filepath may optionally be specified for each requested information kind, in
-the format `--print KIND=PATH`, just like for `--emit`. When a path is
-specified, information will be written there instead of to stdout.
-
 [conditional compilation]: ../reference/conditional-compilation.html
 [deployment target]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html
 
diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md
index 8c5dc11eeef..22ff51489af 100644
--- a/src/doc/rustc/src/platform-support.md
+++ b/src/doc/rustc/src/platform-support.md
@@ -309,6 +309,7 @@ target | std | host | notes
 `riscv64gc-unknown-linux-musl` |   |   | RISC-V Linux (kernel 4.20, musl 1.2.0)
 [`riscv64gc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | RISC-V NetBSD
 [`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64
+[`riscv64-linux-android`](platform-support/android.md) |   |   | RISC-V 64-bit Android
 `s390x-unknown-linux-musl` |  |  | S390x Linux (kernel 3.2, MUSL)
 `sparc-unknown-linux-gnu` | ✓ |  | 32-bit SPARC Linux
 [`sparc64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/sparc64
diff --git a/src/doc/rustc/src/symbol-mangling/index.md b/src/doc/rustc/src/symbol-mangling/index.md
new file mode 100644
index 00000000000..be58f2b41b8
--- /dev/null
+++ b/src/doc/rustc/src/symbol-mangling/index.md
@@ -0,0 +1,52 @@
+# Symbol Mangling
+
+[Symbol name mangling] is used by `rustc` to encode a unique name for symbols that are used during code generation.
+The encoded names are used by the linker to associate the name with the thing it refers to.
+
+The method for mangling the names can be controlled with the [`-C symbol-mangling-version`] option.
+
+[Symbol name mangling]: https://en.wikipedia.org/wiki/Name_mangling
+[`-C symbol-mangling-version`]: ../codegen-options/index.md#symbol-mangling-version
+
+## Per-item control
+
+The [`#[no_mangle]` attribute][reference-no_mangle] can be used on items to disable name mangling on that item.
+
+The [`#[export_name]`attribute][reference-export_name] can be used to specify the exact name that will be used for a function or static.
+
+Items listed in an [`extern` block][reference-extern-block] use the identifier of the item without mangling to refer to the item.
+The [`#[link_name]` attribute][reference-link_name] can be used to change that name.
+
+<!--
+FIXME: This is incomplete for wasm, per https://github.com/rust-lang/rust/blob/d4c364347ce65cf083d4419195b8232440928d4d/compiler/rustc_symbol_mangling/src/lib.rs#L191-L210
+-->
+
+[reference-no_mangle]: ../../reference/abi.html#the-no_mangle-attribute
+[reference-export_name]: ../../reference/abi.html#the-export_name-attribute
+[reference-link_name]: ../../reference/items/external-blocks.html#the-link_name-attribute
+[reference-extern-block]: ../../reference/items/external-blocks.html
+
+## Decoding
+
+The encoded names may need to be decoded in some situations.
+For example, debuggers and other tooling may need to demangle the name so that it is more readable to the user.
+Recent versions of `gdb` and `lldb` have built-in support for demangling Rust identifiers.
+In situations where you need to do your own demangling, the [`rustc-demangle`] crate can be used to programmatically demangle names.
+[`rustfilt`] is a CLI tool which can demangle names.
+
+An example of running rustfilt:
+
+```text
+$ rustfilt _RNvCskwGfYPst2Cb_3foo16example_function
+foo::example_function
+```
+
+[`rustc-demangle`]: https://crates.io/crates/rustc-demangle
+[`rustfilt`]: https://crates.io/crates/rustfilt
+
+## Mangling versions
+
+`rustc` supports different mangling versions which encode the names in different ways.
+The legacy version (which is currently the default) is not described here.
+The "v0" mangling scheme addresses several limitations of the legacy format,
+and is described in the [v0 Symbol Format](v0.md) chapter.
diff --git a/src/doc/rustc/src/symbol-mangling/v0.md b/src/doc/rustc/src/symbol-mangling/v0.md
new file mode 100644
index 00000000000..61f747fac83
--- /dev/null
+++ b/src/doc/rustc/src/symbol-mangling/v0.md
@@ -0,0 +1,1222 @@
+# v0 Symbol Format
+
+The v0 mangling format was introduced in [RFC 2603].
+It has the following properties:
+
+- It provides an unambiguous string encoding for everything that can end up in a binary's symbol table.
+- It encodes information about generic parameters in a reversible way.
+- The mangled symbols are *decodable* such that the demangled form should be easily identifiable as some concrete instance of e.g. a polymorphic function.
+- It has a consistent definition that does not rely on pretty-printing certain language constructs.
+- Symbols can be restricted to only consist of the characters `A-Z`, `a-z`, `0-9`, and `_`.
+  This helps ensure that it is platform-independent,
+  where other characters might have special meaning in some context (e.g. `.` for MSVC `DEF` files).
+  Unicode symbols are optionally supported.
+- It tries to stay efficient, avoiding unnecessarily long names,
+  and avoiding computationally expensive operations to demangle.
+
+The v0 format is not intended to be compatible with other mangling schemes (such as C++).
+
+The v0 format is not presented as a stable ABI for Rust.
+This format is currently intended to be well-defined enough that a demangler can produce a reasonable human-readable form of the symbol.
+There are several implementation-defined portions that result in it not being possible to entirely predict how a given Rust entity will be encoded.
+
+The sections below define the encoding of a v0 symbol.
+There is no standardized demangled form of the symbols,
+though suggestions are provided for how to demangle a symbol.
+Implementers may choose to demangle in different ways.
+
+## Extensions
+
+This format may be extended in the future to add new tags as Rust is extended with new language items.
+To be forward compatible, demanglers should gracefully handle symbols that have encodings where it encounters a tag character not described in this document.
+For example, they may fall back to displaying the mangled symbol.
+The format may be extended anywhere there is a tag character, such as the [type] rule.
+The meaning of existing tags and encodings will not be changed.
+
+## Grammar notation
+
+The format of an encoded symbol is illustrated as a context free grammar in an extended BNF-like syntax.
+A consolidated summary can be found in the [Symbol grammar summary][summary].
+
+| Name | Syntax | Example | Description |
+|------|--------|---------|-------------|
+| Rule | →      | <nobr>A → *B* *C*</nobr> | A production. |
+| Concatenation | whitespace | <nobr>A → *B* *C* *D*</nobr> | Individual elements in sequence left-to-right. |
+| Alternative | \| | <nobr>A → *B* \| *C*</nobr> | Matches either one or the other. |
+| Grouping | () | <nobr>A → *B* (*C* \| *D*) *E*</nobr> | Groups multiple elements as one. |
+| Repetition | {} | <nobr>A → {*B*}</nobr> | Repeats the enclosed zero or more times. |
+| Option | <sub>opt</sub> | <nobr>A → *B*<sub>opt</sub> *C*</nobr> | An optional element. |
+| Literal | `monospace` | <nobr>A → `G`</nobr> | A terminal matching the exact characters case-sensitive. |
+
+## Symbol name
+[symbol-name]: #symbol-name
+
+> symbol-name → `_R` *[decimal-number]*<sub>opt</sub> *[path]* *[instantiating-crate]*<sub>opt</sub> *[vendor-specific-suffix]*<sub>opt</sub>
+
+A mangled symbol starts with the two characters `_R` which is a prefix to identify the symbol as a Rust symbol.
+The prefix can optionally be followed by a *[decimal-number]* which specifies the encoding version.
+This number is currently not used, and is never present in the current encoding.
+Following that is a *[path]* which encodes the path to an entity.
+The path is followed by an optional *[instantiating-crate]* which helps to disambiguate entities which may be instantiated multiple times in separate crates.
+The final part is an optional *[vendor-specific-suffix]*.
+
+> **Recommended Demangling**
+>
+> A *symbol-name* should be displayed as the *[path]*.
+> The *[instantiating-crate]* and the *[vendor-specific-suffix]* usually need not be displayed.
+
+> Example:
+> ```rust
+> std::path::PathBuf::new();
+> ```
+>
+> The symbol for `PathBuf::new` in crate `mycrate` is:
+>
+> ```text
+> _RNvMsr_NtCs3ssYzQotkvD_3std4pathNtB5_7PathBuf3newCs15kBYyAo9fc_7mycrate
+> ├┘└───────────────────────┬──────────────────────┘└──────────┬─────────┘
+> │                         │                                  │
+> │                         │                                  └── instantiating-crate path "mycrate"
+> │                         └───────────────────────────────────── path to std::path::PathBuf::new
+> └─────────────────────────────────────────────────────────────── `_R` symbol prefix
+> ```
+>
+> Recommended demangling: `<std::path::PathBuf>::new`
+
+## Symbol path
+[path]: #symbol-path
+
+> path → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[crate-root]* \
+> &nbsp;&nbsp; | *[inherent-impl]* \
+> &nbsp;&nbsp; | *[trait-impl]* \
+> &nbsp;&nbsp; | *[trait-definition]* \
+> &nbsp;&nbsp; | *[nested-path]* \
+> &nbsp;&nbsp; | *[generic-args]* \
+> &nbsp;&nbsp; | *[backref]*
+
+A *path* represents a variant of a [Rust path][reference-paths] to some entity.
+In addition to typical Rust path segments using identifiers,
+it uses extra elements to represent unnameable entities (like an `impl`) or generic arguments for monomorphized items.
+
+The initial tag character can be used to determine which kind of path it represents:
+
+| Tag | Rule | Description |
+|-----|------|-------------|
+| `C` | *[crate-root]* | The root of a crate path. |
+| `M` | *[inherent-impl]* | An inherent implementation. |
+| `X` | *[trait-impl]* | A trait implementation. |
+| `Y` | *[trait-definition]* | A trait definition. |
+| `N` | *[nested-path]* | A nested path. |
+| `I` | *[generic-args]* | Generic arguments. |
+| `B` | *[backref]* | A back reference. |
+
+### Path: Crate root
+[crate-root]: #path-crate-root
+
+> crate-root → `C` *[identifier]*
+
+A *crate-root* indicates a path referring to the root of a crate's module tree.
+It consists of the character `C` followed by the crate name as an *[identifier]*.
+
+The crate name is the name as seen from the defining crate.
+Since Rust supports linking multiple crates with the same name,
+the *[disambiguator]* is used to make the name unique across the crate graph.
+
+> **Recommended Demangling**
+>
+> A *crate-root* can be displayed as the identifier such as `mycrate`.
+>
+> Usually the disambiguator in the identifier need not be displayed,
+> but as an alternate form the disambiguator can be shown in hex such as
+> `mycrate[ca63f166dbe9294]`.
+
+> Example:
+> ```rust
+> fn example() {}
+> ```
+>
+> The symbol for `example` in crate `mycrate` is:
+>
+> ```text
+> _RNvCs15kBYyAo9fc_7mycrate7example
+>     │└────┬─────┘││└──┬──┘
+>     │     │      ││   │
+>     │     │      ││   └── crate-root identifier "mycrate"
+>     │     │      │└────── length 7 of "mycrate"
+>     │     │      └─────── end of base-62-number
+>     │     └────────────── disambiguator for crate-root "mycrate" 0xca63f166dbe9293 + 1
+>     └──────────────────── crate-root
+> ```
+>
+> Recommended demangling: `mycrate::example`
+
+### Path: Inherent impl
+[inherent-impl]: #path-inherent-impl
+
+> inherent-impl → `M` *[impl-path]* *[type]*
+
+An *inherent-impl* indicates a path to an [inherent implementation][reference-inherent-impl].
+It consists of the character `M` followed by an *[impl-path]*, which uniquely identifies the impl block the item is defined in.
+Following that is a *[type]* representing the `Self` type of the impl.
+
+> **Recommended Demangling**
+>
+> An *inherent-impl* can be displayed as a qualified path segment to the *[type]* within angled brackets.
+> The *[impl-path]* usually need not be displayed.
+
+> Example:
+> ```rust
+> struct Example;
+> impl Example {
+>     fn foo() {}
+> }
+> ```
+>
+> The symbol for `foo` in the impl for `Example` is:
+>
+> ```text
+> _RNvMs_Cs4Cv8Wi1oAIB_7mycrateNtB4_7Example3foo
+>     │├┘└─────────┬──────────┘└────┬──────┘
+>     ││           │                │
+>     ││           │                └── Self type "Example"
+>     ││           └─────────────────── path to the impl's parent "mycrate"
+>     │└─────────────────────────────── disambiguator 1
+>     └──────────────────────────────── inherent-impl
+> ```
+>
+> Recommended demangling: `<mycrate::Example>::foo`
+
+### Path: Trait impl
+[trait-impl]: #path-trait-impl
+
+> trait-impl → `X` *[impl-path]* *[type]* *[path]*
+
+A *trait-impl* indicates a path to a [trait implementation][reference-trait-impl].
+It consists of the character `X` followed by an *[impl-path]* to the impl's parent followed by the *[type]* representing the `Self` type of the impl followed by a *[path]* to the trait.
+
+> **Recommended Demangling**
+>
+> A *trait-impl* can be displayed as a qualified path segment using the `<` *type* `as` *path* `>` syntax.
+> The *[impl-path]* usually need not be displayed.
+
+> Example:
+> ```rust
+> struct Example;
+> trait Trait {
+>     fn foo();
+> }
+> impl Trait for Example {
+>     fn foo() {}
+> }
+> ```
+>
+> The symbol for `foo` in the trait impl for `Example` is:
+>
+> ```text
+> _RNvXCs15kBYyAo9fc_7mycrateNtB2_7ExampleNtB2_5Trait3foo
+>     │└─────────┬──────────┘└─────┬─────┘└────┬────┘
+>     │          │                 │           │
+>     │          │                 │           └── path to the trait "Trait"
+>     │          │                 └────────────── Self type "Example"
+>     │          └──────────────────────────────── path to the impl's parent "mycrate"
+>     └─────────────────────────────────────────── trait-impl
+> ```
+>
+> Recommended demangling: `<mycrate::Example as mycrate::Trait>::foo`
+
+### Path: Impl
+[impl-path]: #path-impl
+
+> impl-path → *[disambiguator]*<sub>opt</sub> *[path]*
+
+An *impl-path* is a path used for *[inherent-impl]* and *[trait-impl]* to indicate the path to parent of an [implementation][reference-implementations].
+It consists of an optional *[disambiguator]* followed by a *[path]*.
+The *[path]* is the path to the parent that contains the impl.
+The *[disambiguator]* can be used to distinguish between multiple impls within the same parent.
+
+> **Recommended Demangling**
+>
+> An *impl-path* usually need not be displayed (unless the location of the impl is desired).
+
+> Example:
+> ```rust
+> struct Example;
+> impl Example {
+>     fn foo() {}
+> }
+> impl Example {
+>     fn bar() {}
+> }
+> ```
+>
+> The symbol for `foo` in the impl for `Example` is:
+>
+> ```text
+> _RNvMCs7qp2U7fqm6G_7mycrateNtB2_7Example3foo
+>      └─────────┬──────────┘
+>                │
+>                └── path to the impl's parent crate-root "mycrate"
+> ```
+>
+> The symbol for `bar` is similar, though it has a disambiguator to indicate it is in a different impl block.
+>
+> ```text
+> _RNvMs_Cs7qp2U7fqm6G_7mycrateNtB4_7Example3bar
+>      ├┘└─────────┬──────────┘
+>      │           │
+>      │           └── path to the impl's parent crate-root "mycrate"
+>      └────────────── disambiguator 1
+> ```
+>
+> Recommended demangling:
+> * `foo`: `<mycrate::Example>::foo`
+> * `bar`: `<mycrate::Example>::bar`
+
+### Path: Trait definition
+[trait-definition]: #path-trait-definition
+
+> trait-definition → `Y` *[type]* *[path]*
+
+A *trait-definition* is a path to a [trait definition][reference-traits].
+It consists of the character `Y` followed by the *[type]* which is the `Self` type of the referrer, followed by the *[path]* to the trait definition.
+
+> **Recommended Demangling**
+>
+> A *trait-definition* can be displayed as a qualified path segment using the `<` *type* `as` *path* `>` syntax.
+
+> Example:
+> ```rust
+> trait Trait {
+>     fn example() {}
+> }
+> struct Example;
+> impl Trait for Example {}
+> ```
+>
+> The symbol for `example` in the trait `Trait` implemented for `Example` is:
+>
+> ```text
+> _RNvYNtCs15kBYyAo9fc_7mycrate7ExampleNtB4_5Trait7exampleB4_
+>     │└──────────────┬───────────────┘└────┬────┘
+>     │               │                     │
+>     │               │                     └── path to the trait "Trait"
+>     │               └──────────────────────── path to the implementing type "mycrate::Example"
+>     └──────────────────────────────────────── trait-definition
+> ```
+>
+> Recommended demangling: `<mycrate::Example as mycrate::Trait>::example`
+
+### Path: Nested path
+[nested-path]: #path-nested-path
+
+> nested-path → `N` *[namespace]* *[path]* *[identifier]*
+
+A *nested-path* is a path representing an optionally named entity.
+It consists of the character `N` followed by a *[namespace]* indicating the namespace of the entity,
+followed by a *[path]* which is a path representing the parent of the entity,
+followed by an *[identifier]* of the entity.
+
+The identifier of the entity may have a length of 0 when the entity is not named.
+For example, entities like closures, tuple-like struct constructors, and anonymous constants may not have a name.
+The identifier may still have a disambiguator unless the disambiguator is 0.
+
+> **Recommended Demangling**
+>
+> A *nested-path* can be displayed by first displaying the *[path]* followed by a `::` separator followed by the *[identifier]*.
+> If the *[identifier]* is empty, then the separating `::` should not be displayed.
+>
+> If a *[namespace]* is specified, then extra context may be added such as: \
+> *[path]* `::{` *[namespace]* (`:` *[identifier]*)<sub>opt</sub> `#` *disambiguator*<sub>as base-10 number</sub> `}`
+>
+> Here the namespace `C` may be printed as `closure` and `S` as `shim`.
+> Others may be printed by their character tag.
+> The `:` *name* portion may be skipped if the name is empty.
+>
+> The *[disambiguator]* in the *[identifier]* may be displayed if a *[namespace]* is specified.
+> In other situations, it is usually not necessary to display the *[disambiguator]*.
+> If it is displayed, it is recommended to place it in brackets, for example `[284a76a8b41a7fd3]`.
+> If the *[disambiguator]* is not present, then its value is 0 and it can always be omitted from display.
+
+> Example:
+> ```rust
+> fn main() {
+>     let x = || {};
+>     let y = || {};
+>     x();
+>     y();
+> }
+> ```
+>
+> The symbol for the closure `x` in crate `mycrate` is:
+>
+> ```text
+> _RNCNvCsgStHSCytQ6I_7mycrate4main0B3_
+>   ││└─────────────┬─────────────┘│
+>   ││              │              │
+>   ││              │              └── identifier with length 0
+>   ││              └───────────────── path to "mycrate::main"
+>   │└──────────────────────────────── closure namespace
+>   └───────────────────────────────── nested-path
+> ```
+>
+> The symbol for the closure `y` is similar, with a disambiguator:
+>
+> ```text
+> _RNCNvCsgStHSCytQ6I_7mycrate4mains_0B3_
+>                                  ││
+>                                  │└── base-62-number 0
+>                                  └─── disambiguator 1 (base-62-number+1)
+> ```
+>
+> Recommended demangling:
+> * `x`: `mycrate::main::{closure#0}`
+> * `y`: `mycrate::main::{closure#1}`
+
+### Path: Generic arguments
+[generic-args]: #path-generic-arguments
+[generic-arg]: #path-generic-arguments
+
+> generic-args → `I` *[path]* {*[generic-arg]*} `E`
+>
+> generic-arg → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[lifetime]* \
+> &nbsp;&nbsp; | *[type]* \
+> &nbsp;&nbsp; | `K` *[const]*
+
+A *generic-args* is a path representing a list of generic arguments.
+It consists of the character `I` followed by a *[path]* to the defining entity, followed by zero or more <em>[generic-arg]</em>s terminated by the character `E`.
+
+Each *[generic-arg]* is either a *[lifetime]* (starting with the character `L`), a *[type]*, or the character `K` followed by a *[const]* representing a const argument.
+
+> **Recommended Demangling**
+>
+> A *generic-args* may be printed as: *[path]* `::`<sub>opt</sub> `<` comma-separated list of args `>`
+> The `::` separator may be elided for type paths (similar to Rust's rules).
+
+> > Example:
+> ```rust
+> fn main() {
+>     example([123]);
+> }
+>
+> fn example<T, const N: usize>(x: [T; N]) {}
+> ```
+>
+> The symbol for the function `example` is:
+>
+> ```text
+> _RINvCsgStHSCytQ6I_7mycrate7examplelKj1_EB2_
+>   │└──────────────┬───────────────┘││││││
+>   │               │                │││││└── end of generic-args
+>   │               │                ││││└─── end of const-data
+>   │               │                │││└──── const value `1`
+>   │               │                ││└───── const type `usize`
+>   │               │                │└────── const generic
+>   │               │                └─────── generic type i32
+>   │               └──────────────────────── path to "mycrate::example"
+>   └──────────────────────────────────────── generic-args
+> ```
+>
+> Recommended demangling: `mycrate::example::<i32, 1>`
+
+### Namespace
+[namespace]: #namespace
+
+> namespace → *[lower]* | *[upper]*
+
+A *namespace* is used to segregate names into separate logical groups, allowing identical names to otherwise avoid collisions.
+It consists of a single character of an upper or lowercase ASCII letter.
+Lowercase letters are reserved for implementation-internal disambiguation categories (and demanglers should never show them).
+Uppercase letters are used for special namespaces which demanglers may display in a special way.
+
+Uppercase namespaces are:
+
+* `C` — A closure.
+* `S` — A shim. Shims are added by the compiler in some situations where an intermediate is needed.
+  For example, a `fn()` pointer to a function with the [`#[track_caller]` attribute][reference-track_caller] needs a shim to deal with the implicit caller location.
+
+> **Recommended Demangling**
+>
+> See *[nested-path]* for recommended demangling.
+
+## Identifier
+[identifier]: #identifier
+[undisambiguated-identifier]: #identifier
+[bytes]: #identifier
+
+> identifier → *[disambiguator]*<sub>opt</sub> *[undisambiguated-identifier]*
+>
+> undisambiguated-identifier → `u`<sub>opt</sub> *[decimal-number]* `_`<sub>opt</sub> *[bytes]*
+>
+> bytes → {*UTF-8 bytes*}
+
+An *identifier* is a named label used in a *[path]* to refer to an entity.
+It consists of an optional *[disambiguator]* followed by an *[undisambiguated-identifier]*.
+
+The disambiguator is used to disambiguate identical identifiers that should not otherwise be considered the same.
+For example, closures have no name, so the disambiguator is the only differentiating element between two different closures in the same parent path.
+
+The undisambiguated-identifier starts with an optional `u` character,
+which indicates that the identifier is encoded in [Punycode][Punycode identifiers].
+The next part is a *[decimal-number]* which indicates the length of the *bytes*.
+
+Following the identifier size is an optional `_` character which is used to separate the length value from the identifier itself.
+The `_` is mandatory if the *bytes* starts with a decimal digit or `_` in order to keep it unambiguous where the *decimal-number* ends and the *bytes* starts.
+
+*bytes* is the identifier itself encoded in UTF-8.
+
+> **Recommended Demangling**
+>
+> The display of an *identifier* can depend on its context.
+> If it is Punycode-encoded, then it may first be decoded before being displayed.
+>
+> The *[disambiguator]* may or may not be displayed; see recommendations for rules that use *identifier*.
+
+### Punycode identifiers
+[Punycode identifiers]: #punycode-identifiers
+
+Because some environments are restricted to ASCII alphanumerics and `_`,
+Rust's [Unicode identifiers][reference-identifiers] may be encoded using a modified version of [Punycode].
+
+For example, the function:
+
+```rust
+mod gödel {
+  mod escher {
+    fn bach() {}
+  }
+}
+```
+
+would be mangled as:
+
+```text
+_RNvNtNtCsgOH4LzxkuMq_7mycrateu8gdel_5qa6escher4bach
+                              ││└───┬──┘
+                              ││    │
+                              ││    └── gdel_5qa translates to gödel
+                              │└─────── 8 is the length
+                              └──────── `u` indicates it is a Unicode identifier
+```
+
+Standard Punycode generates strings of the form `([[:ascii:]]+-)?[[:alnum:]]+`.
+This is problematic because the `-` character
+(which is used to separate the ASCII part from the base-36 encoding)
+is not in the supported character set for symbols.
+For this reason, `-` characters in the Punycode encoding are replaced with `_`.
+
+Here are some examples:
+
+| Original        | Punycode        | Punycode + Encoding |
+|-----------------|-----------------|---------------------|
+| føø             | f-5gaa          | f_5gaa              |
+| α_ω             | _-ylb7e         | __ylb7e             |
+| 铁锈             | n84amf          | n84amf              |
+| 🤦              | fq9h            | fq9h                |
+| ρυστ            | 2xaedc          | 2xaedc              |
+
+> Note: It is up to the compiler to decide whether or not to encode identifiers using Punycode or not.
+> Some platforms may have native support for UTF-8 symbols,
+> and the compiler may decide to use the UTF-8 encoding directly.
+> Demanglers should be prepared to support either form.
+
+[Punycode]: https://tools.ietf.org/html/rfc3492
+
+## Disambiguator
+[disambiguator]: #disambiguator
+
+> disambiguator → `s` *[base-62-number]*
+
+A *disambiguator* is used in various parts of a symbol *[path]* to uniquely identify path elements that would otherwise be identical but should not be considered the same.
+It starts with the character `s` and is followed by a *[base-62-number]*.
+
+If the *disambiguator* is not specified, then its value can be assumed to be zero.
+Otherwise, when demangling, the value 1 should be added to the *[base-62-number]*
+(thus a *base-62-number* of zero encoded as `_` has a value of 1).
+This allows disambiguators that are encoded sequentially to use minimal bytes.
+
+> **Recommended Demangling**
+>
+> The *disambiguator* may or may not be displayed; see recommendations for rules that use *disambiguator*.
+
+## Lifetime
+[lifetime]: #lifetime
+
+> lifetime → `L` *[base-62-number]*
+
+A *lifetime* is used to encode an anonymous (numbered) lifetime, either erased or [higher-ranked](#binder).
+It starts with the character `L` and is followed by a *[base-62-number]*.
+Index 0 is always erased.
+Indices starting from 1 refer (as de Bruijn indices) to a higher-ranked lifetime bound by one of the enclosing <em>[binder]</em>s.
+
+> **Recommended Demangling**
+>
+> A *lifetime* may be displayed like a Rust lifetime using a single quote.
+>
+> Index 0 should be displayed as `'_`.
+> Index 0 should not be displayed for lifetimes in a *[ref-type]*, *[mut-ref-type]*, or *[dyn-trait-type]*.
+>
+> A lifetime can be displayed by converting the De Bruijn index to a De Bruijn level
+> (level = number of bound lifetimes - index) and selecting a unique name for each level.
+> For example, starting with single lowercase letters such as `'a` for level 0.
+> Levels over 25 may consider printing the numeric lifetime as in `'_123`.
+> See *[binder]* for more on lifetime indexes and ordering.
+
+> Example:
+> ```rust
+> fn main() {
+>     example::<fn(&u8, &u16)>();
+> }
+>
+> pub fn example<T>() {}
+> ```
+>
+> The symbol for the function `example` is:
+>
+> ```text
+> _RINvCs7qp2U7fqm6G_7mycrate7exampleFG0_RL1_hRL0_tEuEB2_
+>                                    │└┬┘│└┬┘││└┬┘││
+>                                    │ │ │ │ ││ │ │└── end of input types
+>                                    │ │ │ │ ││ │ └─── type u16
+>                                    │ │ │ │ ││ └───── lifetime #1 'b
+>                                    │ │ │ │ │└─────── reference type
+>                                    │ │ │ │ └──────── type u8
+>                                    │ │ │ └────────── lifetime #2 'a
+>                                    │ │ └──────────── reference type
+>                                    │ └────────────── binder with 2 lifetimes
+>                                    └──────────────── function type
+> ```
+>
+> Recommended demangling: `mycrate::example::<for<'a, 'b> fn(&'a u8, &'b u16)>`
+
+## Const
+[const]: #const
+[const-data]: #const
+[hex-digit]: #const
+
+> const → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[type]* *[const-data]* \
+> &nbsp;&nbsp; | `p` \
+> &nbsp;&nbsp; | *[backref]*
+>
+> const-data → `n`<sub>opt</sub> {*[hex-digit]*} `_`
+>
+> [hex-digit] → *[digit]* | `a` | `b` | `c` | `d` | `e` | `f`
+
+A *const* is used to encode a const value used in generics and types.
+It has the following forms:
+
+* A constant value encoded as a *[type]* which represents the type of the constant and *[const-data]* which is the constant value, followed by `_` to terminate the *const*.
+* The character `p` which represents a [placeholder].
+* A *[backref]* to a previously encoded *const* of the same value.
+
+The encoding of the *const-data* depends on the type:
+
+* `bool` — The value `false` is encoded as `0_`, the value true is encoded as `1_`.
+* `char` — The Unicode scalar value of the character is encoded in hexadecimal.
+* Unsigned integers — The value is encoded in hexadecimal.
+* Signed integers — The character `n` is a prefix to indicate that it is negative,
+  followed by the absolute value encoded in hexadecimal.
+
+> **Recommended Demangling**
+>
+> A *const* may be displayed by the const value depending on the type.
+>
+> The `p` placeholder should be displayed as the `_` character.
+>
+> For specific types:
+> * `b` (bool) — Display as `true` or `false`.
+> * `c` (char) — Display the character in as a Rust character (such as `'A'` or `'\n'`).
+> * integers — Display the integer (either in decimal or hex).
+
+> Example:
+> ```rust
+> fn main() {
+>     example::<0x12345678>();
+> }
+>
+> pub fn example<const N: u64>() {}
+> ```
+>
+> The symbol for function `example` is:
+>
+> ```text
+> _RINvCs7qp2U7fqm6G_7mycrate7exampleKy12345678_EB2_
+>                                    ││└───┬───┘
+>                                    ││    │
+>                                    ││    └── const-data 0x12345678
+>                                    │└─────── const type u64
+>                                    └──────── const generic arg
+> ```
+>
+> Recommended demangling: `mycrate::example::<305419896>`
+
+### Placeholders
+[placeholder]: #placeholders
+
+A *placeholder* may occur in circumstances where a type or const value is not relevant.
+
+> Example:
+> ```rust
+> pub struct Example<T, const N: usize>([T; N]);
+>
+> impl<T, const N: usize> Example<T, N> {
+>     pub fn foo() -> &'static () {
+>         static EXAMPLE_STATIC: () = ();
+>         &EXAMPLE_STATIC
+>     }
+> }
+> ```
+>
+> In this example, the static `EXAMPLE_STATIC` would not be monomorphized by the type or const parameters `T` and `N`.
+> Those will use the placeholder for those generic arguments.
+> Its symbol is:
+>
+> ```text
+> _RNvNvMCsd9PVOYlP1UU_7mycrateINtB4_7ExamplepKpE3foo14EXAMPLE_STATIC
+>                              │             │││
+>                              │             ││└── const placeholder
+>                              │             │└─── const generic argument
+>                              │             └──── type placeholder
+>                              └────────────────── generic-args
+> ```
+>
+> Recommended demangling: `<mycrate::Example<_, _>>::foo::EXAMPLE_STATIC`
+
+
+## Type
+[type]: #type
+[basic-type]: #basic-type
+[array-type]: #array-type
+[slice-type]: #slice-type
+[tuple-type]: #tuple-type
+[ref-type]: #ref-type
+[mut-ref-type]: #mut-ref-type
+[const-ptr-type]: #const-ptr-type
+[mut-ptr-type]: #mut-ptr-type
+[fn-type]: #fn-type
+[dyn-trait-type]: #dyn-trait-type
+
+> type → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[basic-type]* \
+> &nbsp;&nbsp; | *[array-type]* \
+> &nbsp;&nbsp; | *[slice-type]* \
+> &nbsp;&nbsp; | *[tuple-type]* \
+> &nbsp;&nbsp; | *[ref-type]* \
+> &nbsp;&nbsp; | *[mut-ref-type]* \
+> &nbsp;&nbsp; | *[const-ptr-type]* \
+> &nbsp;&nbsp; | *[mut-ptr-type]* \
+> &nbsp;&nbsp; | *[fn-type]* \
+> &nbsp;&nbsp; | *[dyn-trait-type]* \
+> &nbsp;&nbsp; | *[path]* \
+> &nbsp;&nbsp; | *[backref]*
+
+A *type* represents a Rust [type][reference-types].
+The initial character can be used to distinguish which type is encoded.
+The type encodings based on the initial tag character are:
+
+* A <span id="basic-type">*basic-type*</span> is encoded as a single character:
+  * `a` — `i8`
+  * `b` — `bool`
+  * `c` — `char`
+  * `d` — `f64`
+  * `e` — `str`
+  * `f` — `f32`
+  * `h` — `u8`
+  * `i` — `isize`
+  * `j` — `usize`
+  * `l` — `i32`
+  * `m` — `u32`
+  * `n` — `i128`
+  * `o` — `u128`
+  * `s` — `i16`
+  * `t` — `u16`
+  * `u` — unit `()`
+  * `v` — variadic `...`
+  * `x` — `i64`
+  * `y` — `u64`
+  * `z` — `!`
+  * `p` — [placeholder] `_`
+
+* `A` — An [array][reference-array] `[T; N]`.
+
+  > <span id="array-type">array-type</span> → `A` *[type]* *[const]*
+
+  The tag `A` is followed by the *[type]* of the array followed by a *[const]* for the array size.
+
+* `S` — A [slice][reference-slice] `[T]`.
+
+  > <span id="slice-type">slice-type</span> → `S` *[type]*
+
+  The tag `S` is followed by the *[type]* of the slice.
+
+* `T` — A [tuple][reference-tuple] `(T1, T2, T3, ...)`.
+
+  > <span id="tuple-type">tuple-type</span> → `T` {*[type]*} `E`
+
+  The tag `T` is followed by one or more <em>[type]</em>s indicating the type of each field, followed by a terminating `E` character.
+
+  Note that a zero-length tuple (unit) is encoded with the `u` *[basic-type]*.
+
+* `R` — A [reference][reference-shared-reference] `&T`.
+
+  > <span id="ref-type">ref-type</span> →  `R` *[lifetime]*<sub>opt</sub> *[type]*
+
+  The tag `R` is followed by an optional *[lifetime]* followed by the *[type]* of the reference.
+  The lifetime is not included if it has been erased.
+
+* `Q` — A [mutable reference][reference-mutable-reference] `&mut T`.
+
+  > <span id="mut-ref-type">mut-ref-type</span> → `Q` *[lifetime]*<sub>opt</sub> *[type]*
+
+  The tag `Q` is followed by an optional *[lifetime]* followed by the *[type]* of the mutable reference.
+  The lifetime is not included if it has been erased.
+
+* `P` — A [constant raw pointer][reference-raw-pointer] `*const T`.
+
+  The tag `P` is followed by the *[type]* of the pointer.
+
+  > <span id="const-ptr-type">const-ptr-type</span> → `P` *[type]*
+
+* `O` — A [mutable raw pointer][reference-raw-pointer] `*mut T`.
+
+  > <span id="mut-ptr-type">mut-ptr-type</span> → `O` *[type]*
+
+  The tag `O` is followed by the *[type]* of the pointer.
+
+* `F` — A [function pointer][reference-fn-pointer] `fn(…) -> …`.
+
+  > <span id="fn-type">fn-type</span> → `F` *[fn-sig]*
+  >
+  > <span id="fn-sig">fn-sig</span> → *[binder]*<sub>opt</sub> `U`<sub>opt</sub> (`K` *[abi]*)<sub>opt</sub> {*[type]*} `E` *[type]*
+  >
+  > <span id="abi">abi</span> → \
+  > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `C` \
+  > &nbsp;&nbsp; | *[undisambiguated-identifier]*
+
+  The tag `F` is followed by a *[fn-sig]* of the function signature.
+  A *fn-sig* is the signature for a function pointer.
+
+  It starts with an optional *[binder]* which represents the higher-ranked trait bounds (`for<…>`).
+
+  Following that is an optional `U` character which is present for an `unsafe` function.
+
+  Following that is an optional `K` character which indicates that an *[abi]* is specified.
+  If the ABI is not specified, it is assumed to be the `"Rust"` ABI.
+
+  The *[abi]* can be the letter `C` to indicate it is the `"C"` ABI.
+  Otherwise it is an *[undisambiguated-identifier]* of the ABI string with dashes converted to underscores.
+
+  Following that is zero or more <em>[type]</em>s which indicate the input parameters of the function.
+
+  Following that is the character `E` and then the *[type]* of the return value.
+
+[fn-sig]: #fn-sig
+[abi]: #abi
+
+* `D` — A [trait object][reference-trait-object] `dyn Trait<Assoc=X> + Send + 'a`.
+
+  > <span id="dyn-trait-type">dyn-trait-type</span> → `D` *[dyn-bounds]* *[lifetime]*
+  >
+  > <span id="dyn-bounds">dyn-bounds</span> → *[binder]*<sub>opt</sub> {*[dyn-trait]*} `E`
+  >
+  > <span id="dyn-trait">dyn-trait</span> → *[path]* {*[dyn-trait-assoc-binding]*}
+  >
+  > <span id="dyn-trait-assoc-binding">dyn-trait-assoc-binding</span> → `p` *[undisambiguated-identifier]* *[type]*
+
+  The tag `D` is followed by a *[dyn-bounds]* which encodes the trait bounds,
+  followed by a *[lifetime]* of the trait object lifetime bound.
+
+  A *dyn-bounds* starts with an optional *[binder]* which represents the higher-ranked trait bounds (`for<…>`).
+  Following that is a sequence of *[dyn-trait]* terminated by the character `E`.
+
+  Each *[dyn-trait]* represents a trait bound, which consists of a *[path]* to the trait followed by zero or more *[dyn-trait-assoc-binding]* which list the associated types.
+
+  Each *[dyn-trait-assoc-binding]* consists of a character `p` followed a *[undisambiguated-identifier]* representing the associated binding name, and finally a *[type]*.
+
+[dyn-bounds]: #dyn-bounds
+[dyn-trait]: #dyn-trait
+[dyn-trait-assoc-binding]: #dyn-trait-assoc-binding
+
+
+* A *[path]* to a named type.
+
+* A *[backref]* to refer to a previously encoded type.
+
+> **Recommended Demangling**
+>
+> A *[type]* may be displayed as the type it represents, using typical Rust syntax to represent the type.
+
+> Example:
+> ```rust
+> fn main() {
+>     example::<[u16; 8]>();
+> }
+>
+> pub fn example<T>() {}
+> ```
+>
+> The symbol for function `example` is:
+>
+> ```text
+> _RINvCs7qp2U7fqm6G_7mycrate7exampleAtj8_EB2_
+>                                    │││├┘│
+>                                    ││││ └─── end of generic args
+>                                    │││└───── const data 8
+>                                    ││└────── const type usize
+>                                    │└─────── array element type u16
+>                                    └──────── array type
+> ```
+>
+> Recommended demangling: `mycrate::example::<[u16; 8]>`
+
+## Binder
+[binder]: #binder
+
+> binder → `G` *[base-62-number]*
+
+A *binder* represents the number of [higher-ranked trait bound][reference-hrtb] lifetimes to bind.
+It consists of the character `G` followed by a *[base-62-number]*.
+The value 1 should be added to the *[base-62-number]* when decoding
+(such that the *base-62-number* encoding of `_` is interpreted as having 1 binder).
+
+A *lifetime* rule can then refer to these numbered lifetimes.
+The lowest indices represent the innermost lifetimes.
+The number of bound lifetimes is the value of *[base-62-number]* plus one.
+
+For example, in `for<'a, 'b> fn(for<'c> fn (...))`, any <em>[lifetime]</em>s in `...`
+(but not inside more binders) will observe the indices 1, 2, and 3 to refer to `'c`, `'b`, and `'a`, respectively.
+
+> **Recommended Demangling**
+>
+> A *binder* may be printed using `for<…>` syntax listing the lifetimes as recommended in *[lifetime]*.
+> See *[lifetime]* for an example.
+
+## Backref
+[backref]: #backref
+
+> backref → `B` *[base-62-number]*
+
+A *backref* is used to refer to a previous part of the mangled symbol.
+This provides a simple form of compression to reduce the length of the mangled symbol.
+This can help reduce the amount of work and resources needed by the compiler, linker, and loader.
+
+It consists of the character `B` followed by a *[base-62-number]*.
+The number indicates the 0-based offset in bytes starting from just after the `_R` prefix of the symbol.
+The *backref* represents the corresponding element starting at that position.
+
+<em>backref</em>s always refer to a position before the *backref* itself.
+
+The *backref* compression relies on the fact that all substitutable symbol elements have a self-terminating mangled form.
+Given the start position of the encoded node, the grammar guarantees that it is always unambiguous where the node ends.
+This is ensured by not allowing optional or repeating elements at the end of substitutable productions.
+
+> **Recommended Demangling**
+>
+> A *backref* should be demangled by rendering the element that it points to.
+> Care should be considered when handling deeply nested backrefs to avoid using too much stack.
+
+> Example:
+> ```rust
+> fn main() {
+>     example::<Example, Example>();
+> }
+>
+> struct Example;
+>
+> pub fn example<T, U>() {}
+> ```
+>
+> The symbol for function `example` is:
+>
+> ```text
+> _RINvCs7qp2U7fqm6G_7mycrate7exampleNtB2_7ExampleBw_EB2_
+>                                      │├┘        │├┘ │├┘
+>                                      ││         ││  ││
+>                                      ││         ││  │└── backref to offset 3 (crate-root)
+>                                      ││         ││  └─── backref for instantiating-crate path
+>                                      ││         │└────── backref to offset 33 (path to Example)
+>                                      ││         └─────── backref for second generic-arg
+>                                      │└───────────────── backref to offset 3 (crate-root)
+>                                      └────────────────── backref for first generic-arg (first segment of Example path)
+> ```
+>
+> Recommended demangling: `mycrate::example::<mycrate::Example, mycrate::Example>`
+
+## Instantiating crate
+[instantiating-crate]: #instantiating-crate
+
+> instantiating-crate → *[path]*
+
+The *instantiating-crate* is an optional element of the *[symbol-name]* which can be used to indicate which crate is instantiating the symbol.
+It consists of a single *[path]*.
+
+This helps differentiate symbols that would otherwise be identical,
+for example the monomorphization of a function from an external crate may result in a duplicate if another crate is also instantiating the same generic function with the same types.
+
+In practice, the instantiating crate is also often the crate where the symbol is defined,
+so it is usually encoded as a *[backref]* to the *[crate-root]* encoded elsewhere in the symbol.
+
+> **Recommended Demangling**
+>
+> The *instantiating-crate* usually need not be displayed.
+
+> Example:
+> ```rust
+> std::path::Path::new("example");
+> ```
+>
+> The symbol for `Path::new::<str>` instantiated from the `mycrate` crate is:
+>
+> ```text
+> _RINvMsY_NtCseXNvpPnDBDp_3std4pathNtB6_4Path3neweECs7qp2U7fqm6G_7mycrate
+>                                                                 └──┬───┘
+>                                                                    │
+>                                                                    └── instantiating crate identifier `mycrate`
+> ```
+>
+> Recommended demangling: `<std::path::Path>::new::<str>`
+
+## Vendor-specific suffix
+[vendor-specific-suffix]: #vendor-specific-suffix
+[suffix]: #vendor-specific-suffix
+
+> vendor-specific-suffix → (`.` | `$`) *[suffix]*
+>
+> suffix → {*byte*}
+
+The *vendor-specific-suffix* is an optional element at the end of the *[symbol-name]*.
+It consists of either a `.` or `$` character followed by zero or more bytes.
+There are no restrictions on the characters following the period or dollar sign.
+
+This suffix is added as needed by the implementation.
+One example where this can happen is when locally unique names need to become globally unique.
+LLVM can append a `.llvm.<numbers>` suffix during LTO to ensure a unique name,
+and `$` can be used for thread-local data on Mach-O.
+In these situations it's generally fine to ignore the suffix;
+the suffixed name has the same semantics as the original.
+
+> **Recommended Demangling**
+>
+> The *vendor-specific-suffix* usually need not be displayed.
+
+> Example:
+> ```rust
+> # use std::cell::RefCell;
+> thread_local! {
+>     pub static EXAMPLE: RefCell<u32> = RefCell::new(1);
+> }
+> ```
+>
+> The symbol for `EXAMPLE` on macOS may have the following for thread-local data:
+>
+> ```text
+> _RNvNvNvCs7qp2U7fqm6G_7mycrate7EXAMPLE7___getit5___KEY$tlv$init
+>                                                       └───┬───┘
+>                                                           │
+>                                                           └── vendor-specific-suffix
+> ```
+>
+> Recommended demangling: `mycrate::EXAMPLE::__getit::__KEY`
+
+## Common rules
+[decimal-number]: #common-rules
+[digit]: #common-rules
+[non-zero-digit]: #common-rules
+[lower]: #common-rules
+[upper]: #common-rules
+
+> [decimal-number] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `0` \
+> &nbsp;&nbsp; | *[non-zero-digit]* {*[digit]*}
+>
+> [non-zero-digit] → `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` \
+> [digit] → `0` | *[non-zero-digit]*
+>
+> [lower] → `a` |`b` |`c` |`d` |`e` |`f` |`g` |`h` |`i` |`j` |`k` |`l` |`m` |`n` |`o` |`p` |`q` |`r` |`s` |`t` |`u` |`v` |`w` |`x` |`y` |`z`
+>
+> [upper] → `A` | `B` | `C` | `D` | `E` | `F` | `G` | `H` | `I` | `J` | `K` | `L` | `M` | `N` | `O` | `P` | `Q` | `R` | `S` | `T` | `U` | `V` | `W` | `X` | `Y` | `Z`
+
+A *decimal-number* is encoded as one or more <em>[digit]</em>s indicating a numeric value in decimal.
+
+The value zero is encoded as a single byte `0`.
+Beware that there are situations where `0` may be followed by another digit that should not be decoded as part of the decimal-number.
+For example, a zero-length *[identifier]* within a *[nested-path]* which is in turn inside another *[nested-path]* will result in two identifiers in a row, where the first one only has the encoding of `0`.
+
+A *digit* is an ASCII number.
+
+A *lower* and *upper* is an ASCII lower and uppercase letter respectively.
+
+## base-62-number
+[base-62-number]: #base-62-number
+
+> [base-62-number] → { *[digit]* | *[lower]* | *[upper]* } `_`
+
+A *base-62-number* is an encoding of a numeric value.
+It uses ASCII numbers and lowercase and uppercase letters.
+The value is terminated with the `_` character.
+If the value is 0, then the encoding is the `_` character without any digits.
+Otherwise, one is subtracted from the value, and it is encoded with the mapping:
+
+* `0`-`9` maps to 0-9
+* `a`-`z` maps to 10 to 35
+* `A`-`Z` maps to 36 to 61
+
+The number is repeatedly divided by 62 (with integer division round towards zero)
+to choose the next character in the sequence.
+The remainder of each division is used in the mapping to choose the next character.
+This is repeated until the number is 0.
+The final sequence of characters is then reversed.
+
+Decoding is a similar process in reverse.
+
+Examples:
+
+| Value | Encoding |
+|-------|----------|
+| 0     | `_`      |
+| 1     | `0_`     |
+| 11    | `a_`     |
+| 62    | `Z_`     |
+| 63    | `10_`    |
+| 1000  | `g7_`    |
+
+## Symbol grammar summary
+[summary]: #symbol-grammar-summary
+
+The following is a summary of all of the productions of the symbol grammar.
+
+> [symbol-name] → `_R` *[decimal-number]*<sub>opt</sub> *[path]* *[instantiating-crate]*<sub>opt</sub> *[vendor-specific-suffix]*<sub>opt</sub>
+>
+> [path] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[crate-root]* \
+> &nbsp;&nbsp; | *[inherent-impl]* \
+> &nbsp;&nbsp; | *[trait-impl]* \
+> &nbsp;&nbsp; | *[trait-definition]* \
+> &nbsp;&nbsp; | *[nested-path]* \
+> &nbsp;&nbsp; | *[generic-args]* \
+> &nbsp;&nbsp; | *[backref]*
+>
+> [crate-root] → `C` *[identifier]* \
+> [inherent-impl] → `M` *[impl-path]* *[type]* \
+> [trait-impl] → `X` *[impl-path]* *[type]* *[path]* \
+> [trait-definition] → `Y` *[type]* *[path]* \
+> [nested-path] → `N` *[namespace]* *[path]* *[identifier]* \
+> [generic-args] → `I` *[path]* {*[generic-arg]*} `E`
+>
+> [identifier] → *[disambiguator]*<sub>opt</sub> *[undisambiguated-identifier]* \
+> [undisambiguated-identifier] → `u`<sub>opt</sub> *[decimal-number]* `_`<sub>opt</sub> *[bytes]* \
+> [bytes] → {*UTF-8 bytes*}
+>
+> [disambiguator] → `s` *[base-62-number]*
+>
+> [impl-path] → *[disambiguator]*<sub>opt</sub> *[path]*
+>
+> [type] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[basic-type]* \
+> &nbsp;&nbsp; | *[array-type]* \
+> &nbsp;&nbsp; | *[slice-type]* \
+> &nbsp;&nbsp; | *[tuple-type]* \
+> &nbsp;&nbsp; | *[ref-type]* \
+> &nbsp;&nbsp; | *[mut-ref-type]* \
+> &nbsp;&nbsp; | *[const-ptr-type]* \
+> &nbsp;&nbsp; | *[mut-ptr-type]* \
+> &nbsp;&nbsp; | *[fn-type]* \
+> &nbsp;&nbsp; | *[dyn-trait-type]* \
+> &nbsp;&nbsp; | *[path]* \
+> &nbsp;&nbsp; | *[backref]*
+>
+> [basic-type] → *[lower]* \
+> [array-type] → `A` *[type]* *[const]* \
+> [slice-type] → `S` *[type]* \
+> [tuple-type] → `T` {*[type]*} `E` \
+> [ref-type] →  `R` *[lifetime]*<sub>opt</sub> *[type]* \
+> [mut-ref-type] → `Q` *[lifetime]*<sub>opt</sub> *[type]* \
+> [const-ptr-type] → `P` *[type]* \
+> [mut-ptr-type] → `O` *[type]* \
+> [fn-type] → `F` *[fn-sig]* \
+> [dyn-trait-type] → `D` *[dyn-bounds]* *[lifetime]*
+>
+> [namespace] → *[lower]* | *[upper]*
+>
+> [generic-arg] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[lifetime]* \
+> &nbsp;&nbsp; | *[type]* \
+> &nbsp;&nbsp; | `K` *[const]*
+>
+> [lifetime] → `L` *[base-62-number]*
+>
+> [const] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *[type]* *[const-data]* \
+> &nbsp;&nbsp; | `p` \
+> &nbsp;&nbsp; | *[backref]*
+>
+> [const-data] → `n`<sub>opt</sub> {*[hex-digit]*} `_`
+>
+> [hex-digit] → *[digit]* | `a` | `b` | `c` | `d` | `e` | `f`
+>
+> [fn-sig] → *[binder]*<sub>opt</sub> `U`<sub>opt</sub> (`K` *[abi]*)<sub>opt</sub> {*[type]*} `E` *[type]*
+>
+> [abi] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `C` \
+> &nbsp;&nbsp; | *[undisambiguated-identifier]*
+>
+> [dyn-bounds] → *[binder]*<sub>opt</sub> {*[dyn-trait]*} `E` \
+> [dyn-trait] → *[path]* {*[dyn-trait-assoc-binding]*} \
+> [dyn-trait-assoc-binding] → `p` *[undisambiguated-identifier]* *[type]*
+>
+> [binder] → `G` *[base-62-number]*
+>
+> [backref] → `B` *[base-62-number]*
+>
+> [instantiating-crate] → *[path]*
+>
+> [vendor-specific-suffix] → (`.` | `$`) *[suffix]* \
+> [suffix] → {*byte*}
+>
+> [decimal-number] → \
+> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `0` \
+> &nbsp;&nbsp; | *[non-zero-digit]* {*[digit]*}
+>
+> [base-62-number] → { *[digit]* | *[lower]* | *[upper]* } `_`
+>
+> [non-zero-digit] → `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` \
+> [digit] → `0` | *[non-zero-digit]* \
+> [lower] → `a` |`b` |`c` |`d` |`e` |`f` |`g` |`h` |`i` |`j` |`k` |`l` |`m` |`n` |`o` |`p` |`q` |`r` |`s` |`t` |`u` |`v` |`w` |`x` |`y` |`z` \
+> [upper] → `A` | `B` | `C` | `D` | `E` | `F` | `G` | `H` | `I` | `J` | `K` | `L` | `M` | `N` | `O` | `P` | `Q` | `R` | `S` | `T` | `U` | `V` | `W` | `X` | `Y` | `Z`
+
+## Encoding of Rust entities
+
+The following are guidelines for how Rust entities are encoded in a symbol.
+The compiler has some latitude in how an entity is encoded as long as the symbol is unambiguous.
+
+* Named functions, methods, and statics shall be represented by a *[path]* production.
+
+* Paths should be rooted at the inner-most entity that can act as a path root.
+  Roots can be crate-ids, inherent impls, trait impls, and (for items within default methods) trait definitions.
+
+* The compiler is free to choose disambiguation indices and namespace tags from
+  the reserved ranges as long as it ascertains identifier unambiguity.
+
+* Generic arguments that are equal to the default should not be encoded in order to save space.
+
+
+[RFC 2603]: https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html
+[reference-array]: ../../reference/types/array.html
+[reference-fn-pointer]: ../../reference/types/function-pointer.html
+[reference-hrtb]: ../../reference/trait-bounds.html#higher-ranked-trait-bounds
+[reference-identifiers]: ../../reference/identifiers.html
+[reference-implementations]: ../../reference/items/implementations.html
+[reference-inherent-impl]: ../../reference/items/implementations.html#inherent-implementations
+[reference-mutable-reference]: ../../reference/types/pointer.html#mutable-references-mut
+[reference-paths]: ../../reference/paths.html
+[reference-raw-pointer]: ../../reference/types/pointer.html#raw-pointers-const-and-mut
+[reference-shared-reference]: ../../reference/types/pointer.html#shared-references-
+[reference-slice]: ../../reference/types/slice.html
+[reference-track_caller]: ../../reference/attributes/codegen.html#the-track_caller-attribute
+[reference-trait-impl]: ../../reference/items/implementations.html#trait-implementations
+[reference-trait-object]: ../../reference/types/trait-object.html
+[reference-traits]: ../../reference/items/traits.html
+[reference-tuple]: ../../reference/types/tuple.html
+[reference-types]: ../../reference/types.html
diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md
index bf3fe87a0a4..f0c2a189f12 100644
--- a/src/doc/style-guide/src/expressions.md
+++ b/src/doc/style-guide/src/expressions.md
@@ -663,7 +663,8 @@ never use a block (unless the block is empty).
 
 If the right-hand side consists of multiple statements, or has line comments,
 or the start of the line does not fit on the same line as the left-hand side,
-use a block.
+use a block. Do not flatten a right-hand side block containing a single macro call
+because its expanded form could contain a trailing semicolon.
 
 Block-indent the body of a block arm.
 
@@ -686,6 +687,10 @@ match foo {
     bar => {}
     // Trailing comma on last item.
     foo => bar,
+    baz => qux!(),
+    lorem => {
+        ipsum!()
+    }
 }
 ```
 
diff --git a/src/doc/unstable-book/src/compiler-flags/no-parallel-llvm.md b/src/doc/unstable-book/src/compiler-flags/no-parallel-llvm.md
new file mode 100644
index 00000000000..f19ba16b6f7
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/no-parallel-llvm.md
@@ -0,0 +1,8 @@
+# `no-parallel-llvm`
+
+---------------------
+
+This flag disables parallelization of codegen and linking, while otherwise preserving
+behavior with regard to codegen units and LTO.
+
+This flag is not useful for regular users, but it can be useful for debugging the backend. Codegen issues commonly only manifest under specific circumstances, e.g. if multiple codegen units are used and ThinLTO is enabled. Serialization of these threaded configurations makes the use of LLVM debugging facilities easier, by avoiding the interleaving of output.
diff --git a/src/doc/unstable-book/src/compiler-flags/path-options.md b/src/doc/unstable-book/src/compiler-flags/path-options.md
new file mode 100644
index 00000000000..0f2437020dd
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/path-options.md
@@ -0,0 +1,11 @@
+# `--print` Options
+
+The behavior of the `--print` flag can be modified by optionally be specifiying a filepath
+for each requested information kind, in the format `--print KIND=PATH`, just like for
+`--emit`. When a path is specified, information will be written there instead of to stdout.
+
+This is unstable feature, so you have to provide `-Zunstable-options` to enable it.
+
+## Examples
+
+`rustc main.rs -Z unstable-options --print cfg=cfgs.txt`
diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish
index 9f65f1eeeb7..238b5aa4d5a 100644
--- a/src/etc/completions/x.py.fish
+++ b/src/etc/completions/x.py.fish
@@ -18,7 +18,7 @@ complete -c x.py -n "__fish_use_subcommand" -l llvm-skip-rebuild -d 'whether reb
 complete -c x.py -n "__fish_use_subcommand" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_use_subcommand" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_use_subcommand" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_use_subcommand" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_use_subcommand" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_use_subcommand" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_use_subcommand" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_use_subcommand" -s i -l incremental -d 'use incremental compilation'
@@ -26,7 +26,6 @@ complete -c x.py -n "__fish_use_subcommand" -l include-default-paths -d 'include
 complete -c x.py -n "__fish_use_subcommand" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_use_subcommand" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_use_subcommand" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_use_subcommand" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_use_subcommand" -s h -l help -d 'Print help'
 complete -c x.py -n "__fish_use_subcommand" -f -a "build" -d 'Compile either the compiler or libraries'
 complete -c x.py -n "__fish_use_subcommand" -f -a "check" -d 'Compile either the compiler or libraries, using cargo check'
@@ -62,7 +61,7 @@ complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from build" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from build" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from build" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from build" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from build" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from build" -s i -l incremental -d 'use incremental compilation'
@@ -70,7 +69,6 @@ complete -c x.py -n "__fish_seen_subcommand_from build" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from build" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from build" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from build" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from check" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -92,7 +90,7 @@ complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from check" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from check" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from check" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from check" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from check" -l all-targets -d 'Check all targets'
 complete -c x.py -n "__fish_seen_subcommand_from check" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
@@ -101,7 +99,6 @@ complete -c x.py -n "__fish_seen_subcommand_from check" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from check" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from check" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from check" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -s A -d 'clippy lints to allow' -r
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -s D -d 'clippy lints to deny' -r
@@ -127,7 +124,7 @@ complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from clippy" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l fix
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
@@ -136,7 +133,6 @@ complete -c x.py -n "__fish_seen_subcommand_from clippy" -l include-default-path
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from clippy" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -158,7 +154,7 @@ complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-skip-rebuild -d 'w
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from fix" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from fix" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from fix" -s i -l incremental -d 'use incremental compilation'
@@ -166,7 +162,6 @@ complete -c x.py -n "__fish_seen_subcommand_from fix" -l include-default-paths -
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from fix" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -188,7 +183,7 @@ complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-skip-rebuild -d 'w
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from fmt" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l check -d 'check formatting instead of applying'
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
@@ -197,7 +192,6 @@ complete -c x.py -n "__fish_seen_subcommand_from fmt" -l include-default-paths -
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from fmt" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -219,7 +213,7 @@ complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-skip-rebuild -d 'w
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from doc" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l open -d 'open the docs in a browser'
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l json -d 'render the documentation in JSON format in addition to the usual HTML format'
@@ -229,7 +223,6 @@ complete -c x.py -n "__fish_seen_subcommand_from doc" -l include-default-paths -
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from doc" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from test" -l skip -d 'skips tests matching SUBSTRING, if supported by test tool. May be passed multiple times' -r
 complete -c x.py -n "__fish_seen_subcommand_from test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
@@ -257,7 +250,7 @@ complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-skip-rebuild -d '
 complete -c x.py -n "__fish_seen_subcommand_from test" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from test" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from test" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from test" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from test" -l no-fail-fast -d 'run all tests regardless of failure'
 complete -c x.py -n "__fish_seen_subcommand_from test" -l no-doc -d 'do not run doc tests'
@@ -272,7 +265,6 @@ complete -c x.py -n "__fish_seen_subcommand_from test" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from test" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from test" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l test-args -r
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l config -d 'TOML configuration file for build' -r -F
@@ -295,7 +287,7 @@ complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from bench" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from bench" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from bench" -s i -l incremental -d 'use incremental compilation'
@@ -303,8 +295,8 @@ complete -c x.py -n "__fish_seen_subcommand_from bench" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from bench" -s h -l help -d 'Print help'
+complete -c x.py -n "__fish_seen_subcommand_from clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l build -d 'build target of the stage0 compiler' -r -f
@@ -313,7 +305,6 @@ complete -c x.py -n "__fish_seen_subcommand_from clean" -l target -d 'target tar
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l exclude -d 'build paths to exclude' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l rustc-error-format -r -f
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)"
-complete -c x.py -n "__fish_seen_subcommand_from clean" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)"
@@ -325,16 +316,15 @@ complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from clean" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l set -d 'override options in config.toml' -r -f
-complete -c x.py -n "__fish_seen_subcommand_from clean" -l all
+complete -c x.py -n "__fish_seen_subcommand_from clean" -l all -d 'Clean the entire build directory (not used by default)'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -s i -l incremental -d 'use incremental compilation'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l include-default-paths -d 'include default paths in addition to the provided ones'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from clean" -s h -l help -d 'Print help'
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -356,7 +346,7 @@ complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-skip-rebuild -d '
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from dist" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from dist" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from dist" -s i -l incremental -d 'use incremental compilation'
@@ -364,7 +354,6 @@ complete -c x.py -n "__fish_seen_subcommand_from dist" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from dist" -s h -l help -d 'Print help'
 complete -c x.py -n "__fish_seen_subcommand_from install" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -386,7 +375,7 @@ complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-skip-rebuild -
 complete -c x.py -n "__fish_seen_subcommand_from install" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from install" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from install" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from install" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from install" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from install" -s i -l incremental -d 'use incremental compilation'
@@ -394,7 +383,6 @@ complete -c x.py -n "__fish_seen_subcommand_from install" -l include-default-pat
 complete -c x.py -n "__fish_seen_subcommand_from install" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from install" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from install" -s h -l help -d 'Print help'
 complete -c x.py -n "__fish_seen_subcommand_from run" -l args -d 'arguments for the tool' -r
 complete -c x.py -n "__fish_seen_subcommand_from run" -l config -d 'TOML configuration file for build' -r -F
@@ -417,7 +405,7 @@ complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-skip-rebuild -d 'w
 complete -c x.py -n "__fish_seen_subcommand_from run" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from run" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from run" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from run" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from run" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from run" -s i -l incremental -d 'use incremental compilation'
@@ -425,7 +413,6 @@ complete -c x.py -n "__fish_seen_subcommand_from run" -l include-default-paths -
 complete -c x.py -n "__fish_seen_subcommand_from run" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from run" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from run" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -447,7 +434,7 @@ complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-skip-rebuild -d
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from setup" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from setup" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
 complete -c x.py -n "__fish_seen_subcommand_from setup" -s i -l incremental -d 'use incremental compilation'
@@ -455,7 +442,6 @@ complete -c x.py -n "__fish_seen_subcommand_from setup" -l include-default-paths
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from setup" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -477,7 +463,7 @@ complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-skip-rebuild -
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F
-complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-bolt-profile-use -d 'use BOLT profile for LLVM build' -r -F
+complete -c x.py -n "__fish_seen_subcommand_from suggest" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l set -d 'override options in config.toml' -r -f
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l run -d 'run suggested tests'
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -s v -l verbose -d 'use verbose output (-vv for very verbose)'
@@ -486,5 +472,4 @@ complete -c x.py -n "__fish_seen_subcommand_from suggest" -l include-default-pat
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l dry-run -d 'dry run; don\'t build anything'
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l json-output -d 'use message-format=json'
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
-complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-bolt-profile-generate -d 'generate BOLT profile for LLVM build'
 complete -c x.py -n "__fish_seen_subcommand_from suggest" -s h -l help -d 'Print help (see more with \'--help\')'
diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1
index 569c186555c..ff7d49d5e30 100644
--- a/src/etc/completions/x.py.ps1
+++ b/src/etc/completions/x.py.ps1
@@ -42,7 +42,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -52,7 +52,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('build', 'build', [CompletionResultType]::ParameterValue, 'Compile either the compiler or libraries')
@@ -93,7 +92,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -103,7 +102,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -130,7 +128,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--all-targets', 'all-targets', [CompletionResultType]::ParameterName, 'Check all targets')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -141,7 +139,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -172,7 +169,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--fix', 'fix', [CompletionResultType]::ParameterName, 'fix')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -183,7 +180,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -210,7 +206,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -220,7 +216,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -247,7 +242,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--check', 'check', [CompletionResultType]::ParameterName, 'check formatting instead of applying')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -258,7 +253,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -285,7 +279,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--open', 'open', [CompletionResultType]::ParameterName, 'open the docs in a browser')
             [CompletionResult]::new('--json', 'json', [CompletionResultType]::ParameterName, 'render the documentation in JSON format in addition to the usual HTML format')
@@ -297,7 +291,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -330,7 +323,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--no-fail-fast', 'no-fail-fast', [CompletionResultType]::ParameterName, 'run all tests regardless of failure')
             [CompletionResult]::new('--no-doc', 'no-doc', [CompletionResultType]::ParameterName, 'do not run doc tests')
@@ -347,7 +340,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -375,7 +367,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -385,12 +377,12 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
             break
         }
         'x.py;clean' {
+            [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used')
             [CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', 'build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `config.toml`')
             [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
@@ -399,7 +391,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--exclude', 'exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
             [CompletionResult]::new('--rustc-error-format', 'rustc-error-format', [CompletionResultType]::ParameterName, 'rustc-error-format')
             [CompletionResult]::new('--on-fail', 'on-fail', [CompletionResultType]::ParameterName, 'command to run on failure')
-            [CompletionResult]::new('--stage', 'stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)')
             [CompletionResult]::new('--keep-stage', 'keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)')
             [CompletionResult]::new('--keep-stage-std', 'keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)')
             [CompletionResult]::new('--src', 'src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout')
@@ -412,9 +403,9 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
-            [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'all')
+            [CompletionResult]::new('--all', 'all', [CompletionResultType]::ParameterName, 'Clean the entire build directory (not used by default)')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('-i', 'i', [CompletionResultType]::ParameterName, 'use incremental compilation')
@@ -423,7 +414,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
             break
@@ -450,7 +440,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -460,7 +450,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
             break
@@ -487,7 +476,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -497,7 +486,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
             break
@@ -525,7 +513,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -535,7 +523,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -562,7 +549,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
             [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -572,7 +559,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
@@ -599,7 +585,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--rust-profile-generate', 'rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build')
             [CompletionResult]::new('--rust-profile-use', 'rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build')
             [CompletionResult]::new('--llvm-profile-use', 'llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build')
-            [CompletionResult]::new('--llvm-bolt-profile-use', 'llvm-bolt-profile-use', [CompletionResultType]::ParameterName, 'use BOLT profile for LLVM build')
+            [CompletionResult]::new('--reproducible-artifact', 'reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive')
             [CompletionResult]::new('--set', 'set', [CompletionResultType]::ParameterName, 'override options in config.toml')
             [CompletionResult]::new('--run', 'run', [CompletionResultType]::ParameterName, 'run suggested tests')
             [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)')
@@ -610,7 +596,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--dry-run', 'dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything')
             [CompletionResult]::new('--json-output', 'json-output', [CompletionResultType]::ParameterName, 'use message-format=json')
             [CompletionResult]::new('--llvm-profile-generate', 'llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc')
-            [CompletionResult]::new('--llvm-bolt-profile-generate', 'llvm-bolt-profile-generate', [CompletionResultType]::ParameterName, 'generate BOLT profile for LLVM build')
             [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
             break
diff --git a/src/etc/completions/x.py.sh b/src/etc/completions/x.py.sh
index 322afdb2883..4e9286ae1e8 100644
--- a/src/etc/completions/x.py.sh
+++ b/src/etc/completions/x.py.sh
@@ -61,7 +61,7 @@ _x.py() {
 
     case "${cmd}" in
         x.py)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]... build check clippy fix fmt doc test bench clean dist install run setup suggest"
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]... build check clippy fix fmt doc test bench clean dist install run setup suggest"
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -151,7 +151,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -167,7 +167,7 @@ _x.py() {
             return 0
             ;;
         x.py__bench)
-            opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --test-args --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -261,7 +261,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -277,7 +277,7 @@ _x.py() {
             return 0
             ;;
         x.py__build)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -367,7 +367,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -383,7 +383,7 @@ _x.py() {
             return 0
             ;;
         x.py__check)
-            opts="-v -i -j -h --all-targets --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --all-targets --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -473,7 +473,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -489,12 +489,16 @@ _x.py() {
             return 0
             ;;
         x.py__clean)
-            opts="-v -i -j -h --all --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --all --stage --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
             fi
             case "${prev}" in
+                --stage)
+                    COMPREPLY=($(compgen -f "${cur}"))
+                    return 0
+                    ;;
                 --config)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
@@ -527,10 +531,6 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --stage)
-                    COMPREPLY=("${cur}")
-                    return 0
-                    ;;
                 --keep-stage)
                     COMPREPLY=("${cur}")
                     return 0
@@ -579,7 +579,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -595,7 +595,7 @@ _x.py() {
             return 0
             ;;
         x.py__clippy)
-            opts="-A -D -W -F -v -i -j -h --fix --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-A -D -W -F -v -i -j -h --fix --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -701,7 +701,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -717,7 +717,7 @@ _x.py() {
             return 0
             ;;
         x.py__dist)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -807,7 +807,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -823,7 +823,7 @@ _x.py() {
             return 0
             ;;
         x.py__doc)
-            opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --open --json --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -913,7 +913,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -929,7 +929,7 @@ _x.py() {
             return 0
             ;;
         x.py__fix)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1019,7 +1019,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1035,7 +1035,7 @@ _x.py() {
             return 0
             ;;
         x.py__fmt)
-            opts="-v -i -j -h --check --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --check --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1125,7 +1125,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1141,7 +1141,7 @@ _x.py() {
             return 0
             ;;
         x.py__install)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1231,7 +1231,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1247,7 +1247,7 @@ _x.py() {
             return 0
             ;;
         x.py__run)
-            opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --args --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1341,7 +1341,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1357,7 +1357,7 @@ _x.py() {
             return 0
             ;;
         x.py__setup)
-            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [<PROFILE>|hook|vscode|link] [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [<PROFILE>|hook|vscode|link] [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1447,7 +1447,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1463,7 +1463,7 @@ _x.py() {
             return 0
             ;;
         x.py__suggest)
-            opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1553,7 +1553,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
@@ -1569,7 +1569,7 @@ _x.py() {
             return 0
             ;;
         x.py__test)
-            opts="-v -i -j -h --no-fail-fast --skip --test-args --rustc-args --no-doc --doc --bless --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --llvm-bolt-profile-generate --llvm-bolt-profile-use --set --help [PATHS]... [ARGS]..."
+            opts="-v -i -j -h --no-fail-fast --skip --test-args --rustc-args --no-doc --doc --bless --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --verbose --incremental --config --build-dir --build --host --target --exclude --include-default-paths --rustc-error-format --on-fail --dry-run --stage --keep-stage --keep-stage-std --src --jobs --warnings --error-format --json-output --color --llvm-skip-rebuild --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --reproducible-artifact --set --help [PATHS]... [ARGS]..."
             if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
                 COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
                 return 0
@@ -1683,7 +1683,7 @@ _x.py() {
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
-                --llvm-bolt-profile-use)
+                --reproducible-artifact)
                     COMPREPLY=($(compgen -f "${cur}"))
                     return 0
                     ;;
diff --git a/src/etc/rust_analyzer_settings.json b/src/etc/rust_analyzer_settings.json
index d9c4645f0b3..6e5e2c35005 100644
--- a/src/etc/rust_analyzer_settings.json
+++ b/src/etc/rust_analyzer_settings.json
@@ -31,5 +31,8 @@
         "--json-output"
     ],
     "rust-analyzer.cargo.sysrootSrc": "./library",
-    "rust-analyzer.rustc.source": "./Cargo.toml"
+    "rust-analyzer.rustc.source": "./Cargo.toml",
+    "rust-analyzer.cargo.extraEnv": {
+        "RUSTC_BOOTSTRAP": "1"
+    }
 }
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 1c4149fd545..c31d104f8cb 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -644,6 +644,10 @@ pub(crate) fn print_inlined_const(tcx: TyCtxt<'_>, did: DefId) -> String {
 }
 
 fn build_const(cx: &mut DocContext<'_>, def_id: DefId) -> clean::Constant {
+    let mut generics =
+        clean_ty_generics(cx, cx.tcx.generics_of(def_id), cx.tcx.explicit_predicates_of(def_id));
+    clean::simplify::move_bounds_to_generic_parameters(&mut generics);
+
     clean::Constant {
         type_: clean_middle_ty(
             ty::Binder::dummy(cx.tcx.type_of(def_id).instantiate_identity()),
@@ -651,6 +655,7 @@ fn build_const(cx: &mut DocContext<'_>, def_id: DefId) -> clean::Constant {
             Some(def_id),
             None,
         ),
+        generics: Box::new(generics),
         kind: clean::ConstantKind::Extern { def_id },
     }
 }
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index a57854837d5..6ec8f516366 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -273,6 +273,7 @@ pub(crate) fn clean_const<'tcx>(constant: &hir::ConstArg, cx: &mut DocContext<'t
             Some(def_id),
             None,
         ),
+        generics: Box::new(Generics::default()),
         kind: ConstantKind::Anonymous { body: constant.value.body },
     }
 }
@@ -284,6 +285,7 @@ pub(crate) fn clean_middle_const<'tcx>(
     // FIXME: instead of storing the stringified expression, store `self` directly instead.
     Constant {
         type_: clean_middle_ty(constant.map_bound(|c| c.ty()), cx, None, None),
+        generics: Box::new(Generics::default()),
         kind: ConstantKind::TyConst { expr: constant.skip_binder().to_string().into() },
     }
 }
@@ -804,10 +806,10 @@ fn clean_ty_generics<'tcx>(
     let where_predicates = preds
         .predicates
         .iter()
-        .flat_map(|(p, _)| {
+        .flat_map(|(pred, _)| {
             let mut projection = None;
             let param_idx = (|| {
-                let bound_p = p.kind();
+                let bound_p = pred.kind();
                 match bound_p.skip_binder() {
                     ty::ClauseKind::Trait(pred) => {
                         if let ty::Param(param) = pred.self_ty().kind() {
@@ -832,33 +834,26 @@ fn clean_ty_generics<'tcx>(
             })();
 
             if let Some(param_idx) = param_idx
-                && let Some(b) = impl_trait.get_mut(&param_idx.into())
+                && let Some(bounds) = impl_trait.get_mut(&param_idx.into())
             {
-                let p: WherePredicate = clean_predicate(*p, cx)?;
+                let pred = clean_predicate(*pred, cx)?;
 
-                b.extend(
-                    p.get_bounds()
+                bounds.extend(
+                    pred.get_bounds()
                         .into_iter()
                         .flatten()
                         .cloned()
-                        .filter(|b| !b.is_sized_bound(cx)),
                 );
 
-                let proj = projection.map(|p| {
-                    (
-                        clean_projection(p.map_bound(|p| p.projection_ty), cx, None),
-                        p.map_bound(|p| p.term),
-                    )
-                });
-                if let Some(((_, trait_did, name), rhs)) = proj
-                    .as_ref()
-                    .and_then(|(lhs, rhs): &(Type, _)| Some((lhs.projection()?, rhs)))
+                if let Some(proj) = projection
+                    && let lhs = clean_projection(proj.map_bound(|p| p.projection_ty), cx, None)
+                    && let Some((_, trait_did, name)) = lhs.projection()
                 {
                     impl_trait_proj.entry(param_idx).or_default().push((
                         trait_did,
                         name,
-                        *rhs,
-                        p.get_bound_params()
+                        proj.map_bound(|p| p.term),
+                        pred.get_bound_params()
                             .into_iter()
                             .flatten()
                             .cloned()
@@ -869,13 +864,32 @@ fn clean_ty_generics<'tcx>(
                 return None;
             }
 
-            Some(p)
+            Some(pred)
         })
         .collect::<Vec<_>>();
 
     for (param, mut bounds) in impl_trait {
+        let mut has_sized = false;
+        bounds.retain(|b| {
+            if b.is_sized_bound(cx) {
+                has_sized = true;
+                false
+            } else {
+                true
+            }
+        });
+        if !has_sized {
+            bounds.push(GenericBound::maybe_sized(cx));
+        }
+
         // Move trait bounds to the front.
-        bounds.sort_by_key(|b| !matches!(b, GenericBound::TraitBound(..)));
+        bounds.sort_by_key(|b| !b.is_trait_bound());
+
+        // Add back a `Sized` bound if there are no *trait* bounds remaining (incl. `?Sized`).
+        // Since all potential trait bounds are at the front we can just check the first bound.
+        if bounds.first().map_or(true, |b| !b.is_trait_bound()) {
+            bounds.insert(0, GenericBound::sized(cx));
+        }
 
         let crate::core::ImplTraitParam::ParamIndex(idx) = param else { unreachable!() };
         if let Some(proj) = impl_trait_proj.remove(&idx) {
@@ -897,7 +911,7 @@ fn clean_ty_generics<'tcx>(
     // implicit `Sized` bound unless removed with `?Sized`.
     // However, in the list of where-predicates below, `Sized` appears like a
     // normal bound: It's either present (the type is sized) or
-    // absent (the type is unsized) but never *maybe* (i.e. `?Sized`).
+    // absent (the type might be unsized) but never *maybe* (i.e. `?Sized`).
     //
     // This is unsuitable for rendering.
     // Thus, as a first step remove all `Sized` bounds that should be implicit.
@@ -908,8 +922,8 @@ fn clean_ty_generics<'tcx>(
     let mut sized_params = FxHashSet::default();
     where_predicates.retain(|pred| {
         if let WherePredicate::BoundPredicate { ty: Generic(g), bounds, .. } = pred
-        && *g != kw::SelfUpper
-        && bounds.iter().any(|b| b.is_sized_bound(cx))
+            && *g != kw::SelfUpper
+            && bounds.iter().any(|b| b.is_sized_bound(cx))
         {
             sized_params.insert(*g);
             false
@@ -1176,11 +1190,18 @@ fn clean_trait_item<'tcx>(trait_item: &hir::TraitItem<'tcx>, cx: &mut DocContext
     let local_did = trait_item.owner_id.to_def_id();
     cx.with_param_env(local_did, |cx| {
         let inner = match trait_item.kind {
-            hir::TraitItemKind::Const(ty, Some(default)) => AssocConstItem(
-                clean_ty(ty, cx),
-                ConstantKind::Local { def_id: local_did, body: default },
-            ),
-            hir::TraitItemKind::Const(ty, None) => TyAssocConstItem(clean_ty(ty, cx)),
+            hir::TraitItemKind::Const(ty, Some(default)) => {
+                let generics = enter_impl_trait(cx, |cx| clean_generics(trait_item.generics, cx));
+                AssocConstItem(
+                    Box::new(generics),
+                    clean_ty(ty, cx),
+                    ConstantKind::Local { def_id: local_did, body: default },
+                )
+            }
+            hir::TraitItemKind::Const(ty, None) => {
+                let generics = enter_impl_trait(cx, |cx| clean_generics(trait_item.generics, cx));
+                TyAssocConstItem(Box::new(generics), clean_ty(ty, cx))
+            }
             hir::TraitItemKind::Fn(ref sig, hir::TraitFn::Provided(body)) => {
                 let m = clean_function(cx, sig, trait_item.generics, FunctionArgs::Body(body));
                 MethodItem(m, None)
@@ -1225,8 +1246,9 @@ pub(crate) fn clean_impl_item<'tcx>(
     cx.with_param_env(local_did, |cx| {
         let inner = match impl_.kind {
             hir::ImplItemKind::Const(ty, expr) => {
+                let generics = clean_generics(impl_.generics, cx);
                 let default = ConstantKind::Local { def_id: local_did, body: expr };
-                AssocConstItem(clean_ty(ty, cx), default)
+                AssocConstItem(Box::new(generics), clean_ty(ty, cx), default)
             }
             hir::ImplItemKind::Fn(ref sig, body) => {
                 let m = clean_function(cx, sig, impl_.generics, FunctionArgs::Body(body));
@@ -1267,14 +1289,21 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
                 None,
             );
 
+            let mut generics = Box::new(clean_ty_generics(
+                cx,
+                tcx.generics_of(assoc_item.def_id),
+                tcx.explicit_predicates_of(assoc_item.def_id),
+            ));
+            simplify::move_bounds_to_generic_parameters(&mut generics);
+
             let provided = match assoc_item.container {
                 ty::ImplContainer => true,
                 ty::TraitContainer => tcx.defaultness(assoc_item.def_id).has_value(),
             };
             if provided {
-                AssocConstItem(ty, ConstantKind::Extern { def_id: assoc_item.def_id })
+                AssocConstItem(generics, ty, ConstantKind::Extern { def_id: assoc_item.def_id })
             } else {
-                TyAssocConstItem(ty)
+                TyAssocConstItem(generics, ty)
             }
         }
         ty::AssocKind::Fn => {
@@ -1367,34 +1396,7 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
                 tcx.generics_of(assoc_item.def_id),
                 ty::GenericPredicates { parent: None, predicates },
             );
-            // Move bounds that are (likely) directly attached to the parameters of the
-            // (generic) associated type from the where clause to the respective parameter.
-            // There is no guarantee that this is what the user actually wrote but we have
-            // no way of knowing.
-            let mut where_predicates = ThinVec::new();
-            for mut pred in generics.where_predicates {
-                if let WherePredicate::BoundPredicate { ty: Generic(arg), bounds, .. } = &mut pred
-                    && let Some(GenericParamDef {
-                        kind: GenericParamDefKind::Type { bounds: param_bounds, .. },
-                        ..
-                    }) = generics.params.iter_mut().find(|param| &param.name == arg)
-                {
-                    param_bounds.append(bounds);
-                } else if let WherePredicate::RegionPredicate { lifetime: Lifetime(arg), bounds } = &mut pred
-                    && let Some(GenericParamDef {
-                        kind: GenericParamDefKind::Lifetime { outlives: param_bounds },
-                        ..
-                    }) = generics.params.iter_mut().find(|param| &param.name == arg)
-                {
-                    param_bounds.extend(bounds.drain(..).map(|bound| match bound {
-                        GenericBound::Outlives(lifetime) => lifetime,
-                        _ => unreachable!(),
-                    }));
-                } else {
-                    where_predicates.push(pred);
-                }
-            }
-            generics.where_predicates = where_predicates;
+            simplify::move_bounds_to_generic_parameters(&mut generics);
 
             if let ty::TraitContainer = assoc_item.container {
                 // Move bounds that are (likely) directly attached to the associated type
@@ -1502,8 +1504,121 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
     Item::from_def_id_and_parts(assoc_item.def_id, Some(assoc_item.name), kind, cx)
 }
 
+fn first_non_private_clean_path<'tcx>(
+    cx: &mut DocContext<'tcx>,
+    path: &hir::Path<'tcx>,
+    new_path_segments: &'tcx [hir::PathSegment<'tcx>],
+    new_path_span: rustc_span::Span,
+) -> Path {
+    let new_hir_path =
+        hir::Path { segments: new_path_segments, res: path.res, span: new_path_span };
+    let mut new_clean_path = clean_path(&new_hir_path, cx);
+    // In here we need to play with the path data one last time to provide it the
+    // missing `args` and `res` of the final `Path` we get, which, since it comes
+    // from a re-export, doesn't have the generics that were originally there, so
+    // we add them by hand.
+    if let Some(path_last) = path.segments.last().as_ref()
+        && let Some(new_path_last) = new_clean_path.segments[..].last_mut()
+        && let Some(path_last_args) = path_last.args.as_ref()
+        && path_last.args.is_some()
+    {
+        assert!(new_path_last.args.is_empty());
+        new_path_last.args = clean_generic_args(path_last_args, cx);
+    }
+    new_clean_path
+}
+
+/// The goal of this function is to return the first `Path` which is not private (ie not private
+/// or `doc(hidden)`). If it's not possible, it'll return the "end type".
+///
+/// If the path is not a re-export or is public, it'll return `None`.
+fn first_non_private<'tcx>(
+    cx: &mut DocContext<'tcx>,
+    hir_id: hir::HirId,
+    path: &hir::Path<'tcx>,
+) -> Option<Path> {
+    let target_def_id = path.res.opt_def_id()?;
+    let (parent_def_id, ident) = match &path.segments[..] {
+        [] => return None,
+        // Relative paths are available in the same scope as the owner.
+        [leaf] => (cx.tcx.local_parent(hir_id.owner.def_id), leaf.ident),
+        // So are self paths.
+        [parent, leaf] if parent.ident.name == kw::SelfLower => {
+            (cx.tcx.local_parent(hir_id.owner.def_id), leaf.ident)
+        }
+        // Crate paths are not. We start from the crate root.
+        [parent, leaf] if matches!(parent.ident.name, kw::Crate | kw::PathRoot) => {
+            (LOCAL_CRATE.as_def_id().as_local()?, leaf.ident)
+        }
+        [parent, leaf] if parent.ident.name == kw::Super => {
+            let parent_mod = cx.tcx.parent_module(hir_id);
+            if let Some(super_parent) = cx.tcx.opt_local_parent(parent_mod) {
+                (super_parent, leaf.ident)
+            } else {
+                // If we can't find the parent of the parent, then the parent is already the crate.
+                (LOCAL_CRATE.as_def_id().as_local()?, leaf.ident)
+            }
+        }
+        // Absolute paths are not. We start from the parent of the item.
+        [.., parent, leaf] => (parent.res.opt_def_id()?.as_local()?, leaf.ident),
+    };
+    let hir = cx.tcx.hir();
+    // First we try to get the `DefId` of the item.
+    for child in
+        cx.tcx.module_children_local(parent_def_id).iter().filter(move |c| c.ident == ident)
+    {
+        if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = child.res {
+            continue;
+        }
+
+        if let Some(def_id) = child.res.opt_def_id() && target_def_id == def_id {
+            let mut last_path_res = None;
+            'reexps: for reexp in child.reexport_chain.iter() {
+                if let Some(use_def_id) = reexp.id() &&
+                    let Some(local_use_def_id) = use_def_id.as_local() &&
+                    let Some(hir::Node::Item(item)) = hir.find_by_def_id(local_use_def_id) &&
+                    !item.ident.name.is_empty() &&
+                    let hir::ItemKind::Use(path, _) = item.kind
+                {
+                    for res in &path.res {
+                        if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = res {
+                            continue;
+                        }
+                        if (cx.render_options.document_hidden ||
+                            !cx.tcx.is_doc_hidden(use_def_id)) &&
+                            // We never check for "cx.render_options.document_private"
+                            // because if a re-export is not fully public, it's never
+                            // documented.
+                            cx.tcx.local_visibility(local_use_def_id).is_public() {
+                            break 'reexps;
+                        }
+                        last_path_res = Some((path, res));
+                        continue 'reexps;
+                    }
+                }
+            }
+            if !child.reexport_chain.is_empty() {
+                // So in here, we use the data we gathered from iterating the reexports. If
+                // `last_path_res` is set, it can mean two things:
+                //
+                // 1. We found a public reexport.
+                // 2. We didn't find a public reexport so it's the "end type" path.
+                if let Some((new_path, _)) = last_path_res {
+                    return Some(first_non_private_clean_path(cx, path, new_path.segments, new_path.span));
+                }
+                // If `last_path_res` is `None`, it can mean two things:
+                //
+                // 1. The re-export is public, no need to change anything, just use the path as is.
+                // 2. Nothing was found, so let's just return the original path.
+                return None;
+            }
+        }
+    }
+    None
+}
+
 fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type {
-    let hir::Ty { hir_id: _, span, ref kind } = *hir_ty;
+    let hir::Ty { hir_id, span, ref kind } = *hir_ty;
     let hir::TyKind::Path(qpath) = kind else { unreachable!() };
 
     match qpath {
@@ -1520,7 +1635,12 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
             if let Some(expanded) = maybe_expand_private_type_alias(cx, path) {
                 expanded
             } else {
-                let path = clean_path(path, cx);
+                // First we check if it's a private re-export.
+                let path = if let Some(path) = first_non_private(cx, hir_id, &path) {
+                    path
+                } else {
+                    clean_path(path, cx)
+                };
                 resolve_type(cx, path)
             }
         }
@@ -1671,7 +1791,7 @@ fn maybe_expand_private_type_alias<'tcx>(
         }
     }
 
-    Some(cx.enter_alias(args, def_id.to_def_id(), |cx| clean_ty(ty, cx)))
+    Some(cx.enter_alias(args, def_id.to_def_id(), |cx| clean_ty(&ty, cx)))
 }
 
 pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type {
@@ -2119,7 +2239,6 @@ fn clean_middle_opaque_bounds<'tcx>(
     cx: &mut DocContext<'tcx>,
     bounds: Vec<ty::Clause<'tcx>>,
 ) -> Type {
-    let mut regions = vec![];
     let mut has_sized = false;
     let mut bounds = bounds
         .iter()
@@ -2128,10 +2247,7 @@ fn clean_middle_opaque_bounds<'tcx>(
             let trait_ref = match bound_predicate.skip_binder() {
                 ty::ClauseKind::Trait(tr) => bound_predicate.rebind(tr.trait_ref),
                 ty::ClauseKind::TypeOutlives(ty::OutlivesPredicate(_ty, reg)) => {
-                    if let Some(r) = clean_middle_region(reg) {
-                        regions.push(GenericBound::Outlives(r));
-                    }
-                    return None;
+                    return clean_middle_region(reg).map(GenericBound::Outlives);
                 }
                 _ => return None,
             };
@@ -2167,10 +2283,20 @@ fn clean_middle_opaque_bounds<'tcx>(
             Some(clean_poly_trait_ref_with_bindings(cx, trait_ref, bindings))
         })
         .collect::<Vec<_>>();
-    bounds.extend(regions);
-    if !has_sized && !bounds.is_empty() {
-        bounds.insert(0, GenericBound::maybe_sized(cx));
+
+    if !has_sized {
+        bounds.push(GenericBound::maybe_sized(cx));
     }
+
+    // Move trait bounds to the front.
+    bounds.sort_by_key(|b| !b.is_trait_bound());
+
+    // Add back a `Sized` bound if there are no *trait* bounds remaining (incl. `?Sized`).
+    // Since all potential trait bounds are at the front we can just check the first bound.
+    if bounds.first().map_or(true, |b| !b.is_trait_bound()) {
+        bounds.insert(0, GenericBound::sized(cx));
+    }
+
     ImplTrait(bounds)
 }
 
@@ -2353,19 +2479,19 @@ fn get_all_import_attributes<'hir>(
 }
 
 fn filter_tokens_from_list(
-    args_tokens: TokenStream,
+    args_tokens: &TokenStream,
     should_retain: impl Fn(&TokenTree) -> bool,
 ) -> Vec<TokenTree> {
     let mut tokens = Vec::with_capacity(args_tokens.len());
     let mut skip_next_comma = false;
-    for token in args_tokens.into_trees() {
+    for token in args_tokens.trees() {
         match token {
             TokenTree::Token(Token { kind: TokenKind::Comma, .. }, _) if skip_next_comma => {
                 skip_next_comma = false;
             }
-            token if should_retain(&token) => {
+            token if should_retain(token) => {
                 skip_next_comma = false;
-                tokens.push(token);
+                tokens.push(token.clone());
             }
             _ => {
                 skip_next_comma = true;
@@ -2423,7 +2549,7 @@ fn add_without_unwanted_attributes<'hir>(
                     match normal.item.args {
                         ast::AttrArgs::Delimited(ref mut args) => {
                             let tokens =
-                                filter_tokens_from_list(args.tokens.clone(), |token| {
+                                filter_tokens_from_list(&args.tokens, |token| {
                                     !matches!(
                                         token,
                                         TokenTree::Token(
@@ -2467,8 +2593,9 @@ fn clean_maybe_renamed_item<'tcx>(
             ItemKind::Static(ty, mutability, body_id) => {
                 StaticItem(Static { type_: clean_ty(ty, cx), mutability, expr: Some(body_id) })
             }
-            ItemKind::Const(ty, body_id) => ConstantItem(Constant {
+            ItemKind::Const(ty, generics, body_id) => ConstantItem(Constant {
                 type_: clean_ty(ty, cx),
+                generics: Box::new(clean_generics(generics, cx)),
                 kind: ConstantKind::Local { body: body_id, def_id },
             }),
             ItemKind::OpaqueTy(ref ty) => OpaqueTyItem(OpaqueTy {
@@ -2682,7 +2809,7 @@ fn clean_use_statement_inner<'tcx>(
     cx: &mut DocContext<'tcx>,
     inlined_names: &mut FxHashSet<(ItemType, Symbol)>,
 ) -> Vec<Item> {
-    if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = path.res {
+    if should_ignore_res(path.res) {
         return Vec::new();
     }
     // We need this comparison because some imports (for std types for example)
diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs
index d53b038019b..7b8f20326ed 100644
--- a/src/librustdoc/clean/simplify.rs
+++ b/src/librustdoc/clean/simplify.rs
@@ -138,3 +138,38 @@ fn trait_is_same_or_supertrait(cx: &DocContext<'_>, child: DefId, trait_: DefId)
         })
         .any(|did| trait_is_same_or_supertrait(cx, did, trait_))
 }
+
+/// Move bounds that are (likely) directly attached to generic parameters from the where-clause to
+/// the respective parameter.
+///
+/// There is no guarantee that this is what the user actually wrote but we have no way of knowing.
+// FIXME(fmease): It'd make a lot of sense to just incorporate this logic into `clean_ty_generics`
+// making every of its users benefit from it.
+pub(crate) fn move_bounds_to_generic_parameters(generics: &mut clean::Generics) {
+    use clean::types::*;
+
+    let mut where_predicates = ThinVec::new();
+    for mut pred in generics.where_predicates.drain(..) {
+        if let WherePredicate::BoundPredicate { ty: Generic(arg), bounds, .. } = &mut pred
+            && let Some(GenericParamDef {
+                kind: GenericParamDefKind::Type { bounds: param_bounds, .. },
+                ..
+            }) = generics.params.iter_mut().find(|param| &param.name == arg)
+        {
+            param_bounds.append(bounds);
+        } else if let WherePredicate::RegionPredicate { lifetime: Lifetime(arg), bounds } = &mut pred
+            && let Some(GenericParamDef {
+                kind: GenericParamDefKind::Lifetime { outlives: param_bounds },
+                ..
+            }) = generics.params.iter_mut().find(|param| &param.name == arg)
+        {
+            param_bounds.extend(bounds.drain(..).map(|bound| match bound {
+                GenericBound::Outlives(lifetime) => lifetime,
+                _ => unreachable!(),
+            }));
+        } else {
+            where_predicates.push(pred);
+        }
+    }
+    generics.where_predicates = where_predicates;
+}
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index ddef165a054..cb089ddd09a 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -824,9 +824,9 @@ pub(crate) enum ItemKind {
     ProcMacroItem(ProcMacro),
     PrimitiveItem(PrimitiveType),
     /// A required associated constant in a trait declaration.
-    TyAssocConstItem(Type),
+    TyAssocConstItem(Box<Generics>, Type),
     /// An associated constant in a trait impl or a provided one in a trait declaration.
-    AssocConstItem(Type, ConstantKind),
+    AssocConstItem(Box<Generics>, Type, ConstantKind),
     /// A required associated type in a trait declaration.
     ///
     /// The bounds may be non-empty if there is a `where` clause.
@@ -871,8 +871,8 @@ impl ItemKind {
             | MacroItem(_)
             | ProcMacroItem(_)
             | PrimitiveItem(_)
-            | TyAssocConstItem(_)
-            | AssocConstItem(_, _)
+            | TyAssocConstItem(..)
+            | AssocConstItem(..)
             | TyAssocTypeItem(..)
             | AssocTypeItem(..)
             | StrippedItem(_)
@@ -1219,15 +1219,24 @@ pub(crate) enum GenericBound {
 }
 
 impl GenericBound {
+    pub(crate) fn sized(cx: &mut DocContext<'_>) -> GenericBound {
+        Self::sized_with(cx, hir::TraitBoundModifier::None)
+    }
+
     pub(crate) fn maybe_sized(cx: &mut DocContext<'_>) -> GenericBound {
+        Self::sized_with(cx, hir::TraitBoundModifier::Maybe)
+    }
+
+    fn sized_with(cx: &mut DocContext<'_>, modifier: hir::TraitBoundModifier) -> GenericBound {
         let did = cx.tcx.require_lang_item(LangItem::Sized, None);
         let empty = ty::Binder::dummy(ty::GenericArgs::empty());
         let path = external_path(cx, did, false, ThinVec::new(), empty);
         inline::record_extern_fqn(cx, did, ItemType::Trait);
-        GenericBound::TraitBound(
-            PolyTrait { trait_: path, generic_params: Vec::new() },
-            hir::TraitBoundModifier::Maybe,
-        )
+        GenericBound::TraitBound(PolyTrait { trait_: path, generic_params: Vec::new() }, modifier)
+    }
+
+    pub(crate) fn is_trait_bound(&self) -> bool {
+        matches!(self, Self::TraitBound(..))
     }
 
     pub(crate) fn is_sized_bound(&self, cx: &DocContext<'_>) -> bool {
@@ -1269,7 +1278,7 @@ impl Lifetime {
     }
 }
 
-#[derive(Clone, Debug)]
+#[derive(Clone, PartialEq, Eq, Hash, Debug)]
 pub(crate) enum WherePredicate {
     BoundPredicate { ty: Type, bounds: Vec<GenericBound>, bound_params: Vec<GenericParamDef> },
     RegionPredicate { lifetime: Lifetime, bounds: Vec<GenericBound> },
@@ -1339,7 +1348,7 @@ impl GenericParamDef {
 }
 
 // maybe use a Generic enum and use Vec<Generic>?
-#[derive(Clone, Debug, Default)]
+#[derive(Clone, PartialEq, Eq, Hash, Debug, Default)]
 pub(crate) struct Generics {
     pub(crate) params: ThinVec<GenericParamDef>,
     pub(crate) where_predicates: ThinVec<WherePredicate>,
@@ -2203,6 +2212,17 @@ pub(crate) enum GenericArgs {
     Parenthesized { inputs: Box<[Type]>, output: Option<Box<Type>> },
 }
 
+impl GenericArgs {
+    pub(crate) fn is_empty(&self) -> bool {
+        match self {
+            GenericArgs::AngleBracketed { args, bindings } => {
+                args.is_empty() && bindings.is_empty()
+            }
+            GenericArgs::Parenthesized { inputs, output } => inputs.is_empty() && output.is_none(),
+        }
+    }
+}
+
 #[derive(Clone, PartialEq, Eq, Debug, Hash)]
 pub(crate) struct PathSegment {
     pub(crate) name: Symbol,
@@ -2246,6 +2266,7 @@ pub(crate) struct Static {
 #[derive(Clone, PartialEq, Eq, Hash, Debug)]
 pub(crate) struct Constant {
     pub(crate) type_: Type,
+    pub(crate) generics: Box<Generics>,
     pub(crate) kind: ConstantKind,
 }
 
@@ -2495,7 +2516,8 @@ mod size_asserts {
     static_assert_size!(GenericParamDef, 56);
     static_assert_size!(Generics, 16);
     static_assert_size!(Item, 56);
-    static_assert_size!(ItemKind, 64);
+    // FIXME(generic_const_items): Further reduce the size.
+    static_assert_size!(ItemKind, 72);
     static_assert_size!(PathSegment, 40);
     static_assert_size!(Type, 32);
     // tidy-alphabetical-end
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index 5c8db3b8774..baf90b6d73e 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -13,7 +13,7 @@ use rustc_ast as ast;
 use rustc_ast::tokenstream::TokenTree;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::{DefId, LOCAL_CRATE};
+use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE};
 use rustc_middle::mir;
 use rustc_middle::mir::interpret::ConstValue;
 use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, TyCtxt};
@@ -629,3 +629,35 @@ pub(super) fn display_macro_source(
         }
     }
 }
+
+pub(crate) fn inherits_doc_hidden(
+    tcx: TyCtxt<'_>,
+    mut def_id: LocalDefId,
+    stop_at: Option<LocalDefId>,
+) -> bool {
+    let hir = tcx.hir();
+    while let Some(id) = tcx.opt_local_parent(def_id) {
+        if let Some(stop_at) = stop_at && id == stop_at {
+            return false;
+        }
+        def_id = id;
+        if tcx.is_doc_hidden(def_id.to_def_id()) {
+            return true;
+        } else if let Some(node) = hir.find_by_def_id(def_id) &&
+            matches!(
+                node,
+                hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(_), .. }),
+            )
+        {
+            // `impl` blocks stand a bit on their own: unless they have `#[doc(hidden)]` directly
+            // on them, they don't inherit it from the parent context.
+            return false;
+        }
+    }
+    false
+}
+
+#[inline]
+pub(crate) fn should_ignore_res(res: Res) -> bool {
+    matches!(res, Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..))
+}
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index f60f40267d6..eb5d3c88570 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1102,22 +1102,35 @@ fn fmt_type<'cx>(
             };
             let m = mutability.print_with_space();
             let amp = if f.alternate() { "&" } else { "&amp;" };
-            match **ty {
+
+            if let clean::Generic(name) = **ty {
+                return primitive_link(
+                    f,
+                    PrimitiveType::Reference,
+                    &format!("{amp}{lt}{m}{name}"),
+                    cx,
+                );
+            }
+
+            write!(f, "{amp}{lt}{m}")?;
+
+            let needs_parens = match **ty {
                 clean::DynTrait(ref bounds, ref trait_lt)
                     if bounds.len() > 1 || trait_lt.is_some() =>
                 {
-                    write!(f, "{}{}{}(", amp, lt, m)?;
-                    fmt_type(ty, f, use_absolute, cx)?;
-                    write!(f, ")")
-                }
-                clean::Generic(name) => {
-                    primitive_link(f, PrimitiveType::Reference, &format!("{amp}{lt}{m}{name}"), cx)
-                }
-                _ => {
-                    write!(f, "{}{}{}", amp, lt, m)?;
-                    fmt_type(ty, f, use_absolute, cx)
+                    true
                 }
+                clean::ImplTrait(ref bounds) if bounds.len() > 1 => true,
+                _ => false,
+            };
+            if needs_parens {
+                f.write_str("(")?;
             }
+            fmt_type(ty, f, use_absolute, cx)?;
+            if needs_parens {
+                f.write_str(")")?;
+            }
+            Ok(())
         }
         clean::ImplTrait(ref bounds) => {
             if f.alternate() {
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index fd00277e213..3fb7122fad3 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -532,8 +532,6 @@ impl<'a, 'b, 'ids, I: Iterator<Item = SpannedEvent<'a>>> Iterator
             let start_tags = format!(
                 "<h{level} id=\"{id}\">\
                     <a href=\"#{id}\">",
-                id = id,
-                level = level
             );
             return Some((Event::Html(start_tags.into()), 0..0));
         }
diff --git a/src/librustdoc/html/markdown/tests.rs b/src/librustdoc/html/markdown/tests.rs
index e05635a0207..db8504d15c7 100644
--- a/src/librustdoc/html/markdown/tests.rs
+++ b/src/librustdoc/html/markdown/tests.rs
@@ -38,7 +38,7 @@ fn test_unique_id() {
     ];
 
     let mut map = IdMap::new();
-    let actual: Vec<String> = input.iter().map(|s| map.derive(s.to_string())).collect();
+    let actual: Vec<String> = input.iter().map(|s| map.derive(s)).collect();
     assert_eq!(&actual[..], expected);
 }
 
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index 037c88cb85d..991edbddc6f 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -162,7 +162,7 @@ impl<'tcx> Context<'tcx> {
         self.shared.tcx.sess
     }
 
-    pub(super) fn derive_id(&mut self, id: String) -> String {
+    pub(super) fn derive_id<S: AsRef<str> + ToString>(&mut self, id: S) -> String {
         self.id_map.derive(id)
     }
 
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 2fcf61d0049..8a6e0b1ed51 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -268,7 +268,7 @@ impl AllTypes {
     fn append(&mut self, item_name: String, item_type: &ItemType) {
         let mut url: Vec<_> = item_name.split("::").skip(1).collect();
         if let Some(name) = url.pop() {
-            let new_url = format!("{}/{}.{}.html", url.join("/"), item_type, name);
+            let new_url = format!("{}/{item_type}.{name}.html", url.join("/"));
             url.push(name);
             let name = url.join("::");
             match *item_type {
@@ -385,16 +385,17 @@ impl AllTypes {
 fn scrape_examples_help(shared: &SharedContext<'_>) -> String {
     let mut content = SCRAPE_EXAMPLES_HELP_MD.to_owned();
     content.push_str(&format!(
-      "## More information\n\n\
-      If you want more information about this feature, please read the [corresponding chapter in the Rustdoc book]({}/rustdoc/scraped-examples.html).",
-      DOC_RUST_LANG_ORG_CHANNEL));
+        "## More information\n\n\
+      If you want more information about this feature, please read the [corresponding chapter in \
+      the Rustdoc book]({DOC_RUST_LANG_ORG_CHANNEL}/rustdoc/scraped-examples.html)."
+    ));
 
     let mut ids = IdMap::default();
     format!(
         "<div class=\"main-heading\">\
-            <h1>About scraped examples</h1>\
-        </div>\
-        <div>{}</div>",
+             <h1>About scraped examples</h1>\
+         </div>\
+         <div>{}</div>",
         Markdown {
             content: &content,
             links: &[],
@@ -473,7 +474,7 @@ fn document_short<'a, 'cx: 'a>(
                 MarkdownSummaryLine(&s, &item.links(cx)).into_string_with_has_more_content();
 
             if has_more_content {
-                let link = format!(r#" <a{}>Read more</a>"#, assoc_href_attr(item, link, cx));
+                let link = format!(" <a{}>Read more</a>", assoc_href_attr(item, link, cx));
 
                 if let Some(idx) = summary_html.rfind("</p>") {
                     summary_html.insert_str(idx, &link);
@@ -482,7 +483,7 @@ fn document_short<'a, 'cx: 'a>(
                 }
             }
 
-            write!(f, "<div class='docblock'>{}</div>", summary_html)?;
+            write!(f, "<div class='docblock'>{summary_html}</div>")?;
         }
         Ok(())
     })
@@ -517,9 +518,9 @@ fn document_full_inner<'a, 'cx: 'a>(
                 write!(
                     f,
                     "<details class=\"toggle top-doc\" open>\
-                    <summary class=\"hideme\">\
+                     <summary class=\"hideme\">\
                         <span>Expand description</span>\
-                    </summary>{}</details>",
+                     </summary>{}</details>",
                     render_markdown(cx, &s, item.links(cx), heading_offset)
                 )?;
             } else {
@@ -701,8 +702,8 @@ fn assoc_href_attr(it: &clean::Item, link: AssocItemLink<'_>, cx: &Context<'_>)
     let item_type = it.type_();
 
     let href = match link {
-        AssocItemLink::Anchor(Some(ref id)) => Some(format!("#{}", id)),
-        AssocItemLink::Anchor(None) => Some(format!("#{}.{}", item_type, name)),
+        AssocItemLink::Anchor(Some(ref id)) => Some(format!("#{id}")),
+        AssocItemLink::Anchor(None) => Some(format!("#{item_type}.{name}")),
         AssocItemLink::GotoSource(did, provided_methods) => {
             // We're creating a link from the implementation of an associated item to its
             // declaration in the trait declaration.
@@ -722,7 +723,7 @@ fn assoc_href_attr(it: &clean::Item, link: AssocItemLink<'_>, cx: &Context<'_>)
             };
 
             match href(did.expect_def_id(), cx) {
-                Ok((url, ..)) => Some(format!("{}#{}.{}", url, item_type, name)),
+                Ok((url, ..)) => Some(format!("{url}#{item_type}.{name}")),
                 // The link is broken since it points to an external crate that wasn't documented.
                 // Do not create any link in such case. This is better than falling back to a
                 // dummy anchor like `#{item_type}.{name}` representing the `id` of *this* impl item
@@ -735,37 +736,39 @@ fn assoc_href_attr(it: &clean::Item, link: AssocItemLink<'_>, cx: &Context<'_>)
                 // In this scenario, the actual `id` of this impl item would be
                 // `#{item_type}.{name}-{n}` for some number `n` (a disambiguator).
                 Err(HrefError::DocumentationNotBuilt) => None,
-                Err(_) => Some(format!("#{}.{}", item_type, name)),
+                Err(_) => Some(format!("#{item_type}.{name}")),
             }
         }
     };
 
     // If there is no `href` for the reason explained above, simply do not render it which is valid:
     // https://html.spec.whatwg.org/multipage/links.html#links-created-by-a-and-area-elements
-    href.map(|href| format!(" href=\"{}\"", href)).unwrap_or_default()
+    href.map(|href| format!(" href=\"{href}\"")).unwrap_or_default()
 }
 
 fn assoc_const(
     w: &mut Buffer,
     it: &clean::Item,
+    generics: &clean::Generics,
     ty: &clean::Type,
     default: Option<&clean::ConstantKind>,
     link: AssocItemLink<'_>,
-    extra: &str,
+    indent: usize,
     cx: &Context<'_>,
 ) {
     let tcx = cx.tcx();
     write!(
         w,
-        "{extra}{vis}const <a{href} class=\"constant\">{name}</a>: {ty}",
-        extra = extra,
+        "{indent}{vis}const <a{href} class=\"constant\">{name}</a>{generics}: {ty}",
+        indent = " ".repeat(indent),
         vis = visibility_print_with_space(it.visibility(tcx), it.item_id, cx),
         href = assoc_href_attr(it, link, cx),
         name = it.name.as_ref().unwrap(),
+        generics = generics.print(cx),
         ty = ty.print(cx),
     );
     if let Some(default) = default {
-        write!(w, " = ");
+        w.write_str(" = ");
 
         // FIXME: `.value()` uses `clean::utils::format_integer_with_underscore_sep` under the
         //        hood which adds noisy underscores and a type suffix to number literals.
@@ -774,6 +777,7 @@ fn assoc_const(
         //        Find a way to print constants here without all that jazz.
         write!(w, "{}", Escape(&default.value(tcx).unwrap_or_else(|| default.expr(tcx))));
     }
+    write!(w, "{}", print_where_clause(generics, cx, indent, Ending::NoNewline));
 }
 
 fn assoc_type(
@@ -907,39 +911,41 @@ fn render_stability_since_raw_with_extra(
 
     if let Some(ver) = stable_version {
         stability.push_str(ver.as_str());
-        title.push_str(&format!("Stable since Rust version {}", ver));
+        title.push_str(&format!("Stable since Rust version {ver}"));
     }
 
     let const_title_and_stability = match const_stability {
         Some(ConstStability { level: StabilityLevel::Stable { since, .. }, .. })
             if Some(since) != containing_const_ver =>
         {
-            Some((format!("const since {}", since), format!("const: {}", since)))
+            Some((format!("const since {since}"), format!("const: {since}")))
         }
         Some(ConstStability { level: StabilityLevel::Unstable { issue, .. }, feature, .. }) => {
             let unstable = if let Some(n) = issue {
                 format!(
-                    r#"<a href="https://github.com/rust-lang/rust/issues/{}" title="Tracking issue for {}">unstable</a>"#,
-                    n, feature
+                    "<a \
+                        href=\"https://github.com/rust-lang/rust/issues/{n}\" \
+                        title=\"Tracking issue for {feature}\"\
+                       >unstable</a>"
                 )
             } else {
                 String::from("unstable")
             };
 
-            Some((String::from("const unstable"), format!("const: {}", unstable)))
+            Some((String::from("const unstable"), format!("const: {unstable}")))
         }
         _ => None,
     };
 
     if let Some((const_title, const_stability)) = const_title_and_stability {
         if !title.is_empty() {
-            title.push_str(&format!(", {}", const_title));
+            title.push_str(&format!(", {const_title}"));
         } else {
             title.push_str(&const_title);
         }
 
         if !stability.is_empty() {
-            stability.push_str(&format!(" ({})", const_stability));
+            stability.push_str(&format!(" ({const_stability})"));
         } else {
             stability.push_str(&const_stability);
         }
@@ -986,19 +992,22 @@ fn render_assoc_item(
         clean::MethodItem(m, _) => {
             assoc_method(w, item, &m.generics, &m.decl, link, parent, cx, render_mode)
         }
-        kind @ (clean::TyAssocConstItem(ty) | clean::AssocConstItem(ty, _)) => assoc_const(
-            w,
-            item,
-            ty,
-            match kind {
-                clean::TyAssocConstItem(_) => None,
-                clean::AssocConstItem(_, default) => Some(default),
-                _ => unreachable!(),
-            },
-            link,
-            if parent == ItemType::Trait { "    " } else { "" },
-            cx,
-        ),
+        kind @ (clean::TyAssocConstItem(generics, ty) | clean::AssocConstItem(generics, ty, _)) => {
+            assoc_const(
+                w,
+                item,
+                generics,
+                ty,
+                match kind {
+                    clean::TyAssocConstItem(..) => None,
+                    clean::AssocConstItem(.., default) => Some(default),
+                    _ => unreachable!(),
+                },
+                link,
+                if parent == ItemType::Trait { 4 } else { 0 },
+                cx,
+            )
+        }
         clean::TyAssocTypeItem(ref generics, ref bounds) => assoc_type(
             w,
             item,
@@ -1085,7 +1094,7 @@ pub(crate) fn render_all_impls(
     let impls = impls.into_inner();
     if !impls.is_empty() {
         write_impl_section_heading(&mut w, "Trait Implementations", "trait-implementations");
-        write!(w, "<div id=\"trait-implementations-list\">{}</div>", impls).unwrap();
+        write!(w, "<div id=\"trait-implementations-list\">{impls}</div>").unwrap();
     }
 
     if !synthetic.is_empty() {
@@ -1144,9 +1153,7 @@ fn render_assoc_items_inner(
             AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
                 let id =
                     cx.derive_id(small_url_encode(format!("deref-methods-{:#}", type_.print(cx))));
-                if let Some(def_id) = type_.def_id(cx.cache()) {
-                    cx.deref_id_map.insert(def_id, id.clone());
-                }
+                let derived_id = cx.derive_id(&id);
                 write_impl_section_heading(
                     &mut tmp_buf,
                     &format!(
@@ -1156,11 +1163,10 @@ fn render_assoc_items_inner(
                     ),
                     &id,
                 );
-                (
-                    RenderMode::ForDeref { mut_: deref_mut_ },
-                    cx.derive_id(id),
-                    r#" class="impl-items""#,
-                )
+                if let Some(def_id) = type_.def_id(cx.cache()) {
+                    cx.deref_id_map.insert(def_id, id);
+                }
+                (RenderMode::ForDeref { mut_: deref_mut_ }, derived_id, r#" class="impl-items""#)
             }
         };
         let mut impls_buf = Buffer::html();
@@ -1183,10 +1189,13 @@ fn render_assoc_items_inner(
             );
         }
         if !impls_buf.is_empty() {
-            write!(w, "{}", tmp_buf.into_inner()).unwrap();
-            write!(w, "<div id=\"{id}\"{class_html}>").unwrap();
-            write!(w, "{}", impls_buf.into_inner()).unwrap();
-            w.write_str("</div>").unwrap();
+            write!(
+                w,
+                "{}<div id=\"{id}\"{class_html}>{}</div>",
+                tmp_buf.into_inner(),
+                impls_buf.into_inner()
+            )
+            .unwrap();
         }
     }
 
@@ -1386,7 +1395,7 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) {
         }
     }
     if out.is_empty() {
-        write!(&mut out, "</code></pre>",);
+        out.write_str("</code></pre>");
     }
 
     (format!("{:#}", ty.print(cx)), out.into_inner())
@@ -1532,25 +1541,25 @@ fn render_impl(
         let toggled = !doc_buffer.is_empty();
         if toggled {
             let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
-            write!(w, "<details class=\"toggle{}\" open><summary>", method_toggle_class);
+            write!(w, "<details class=\"toggle{method_toggle_class}\" open><summary>");
         }
         match &*item.kind {
             clean::MethodItem(..) | clean::TyMethodItem(_) => {
                 // Only render when the method is not static or we allow static methods
                 if render_method_item {
-                    let id = cx.derive_id(format!("{}.{}", item_type, name));
+                    let id = cx.derive_id(format!("{item_type}.{name}"));
                     let source_id = trait_
                         .and_then(|trait_| {
                             trait_.items.iter().find(|item| {
                                 item.name.map(|n| n.as_str().eq(name.as_str())).unwrap_or(false)
                             })
                         })
-                        .map(|item| format!("{}.{}", item.type_(), name));
-                    write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class,);
+                        .map(|item| format!("{}.{name}", item.type_()));
+                    write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
                     render_rightside(w, cx, item, containing_item, render_mode);
                     if trait_.is_some() {
                         // Anchors are only used on trait impls.
-                        write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
+                        write!(w, "<a href=\"#{id}\" class=\"anchor\">§</a>");
                     }
                     w.write_str("<h4 class=\"code-header\">");
                     render_assoc_item(
@@ -1561,43 +1570,43 @@ fn render_impl(
                         cx,
                         render_mode,
                     );
-                    w.write_str("</h4>");
-                    w.write_str("</section>");
+                    w.write_str("</h4></section>");
                 }
             }
-            kind @ (clean::TyAssocConstItem(ty) | clean::AssocConstItem(ty, _)) => {
-                let source_id = format!("{}.{}", item_type, name);
-                let id = cx.derive_id(source_id.clone());
-                write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class);
+            kind @ (clean::TyAssocConstItem(generics, ty)
+            | clean::AssocConstItem(generics, ty, _)) => {
+                let source_id = format!("{item_type}.{name}");
+                let id = cx.derive_id(&source_id);
+                write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
                 render_rightside(w, cx, item, containing_item, render_mode);
                 if trait_.is_some() {
                     // Anchors are only used on trait impls.
-                    write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
+                    write!(w, "<a href=\"#{id}\" class=\"anchor\">§</a>");
                 }
                 w.write_str("<h4 class=\"code-header\">");
                 assoc_const(
                     w,
                     item,
+                    generics,
                     ty,
                     match kind {
-                        clean::TyAssocConstItem(_) => None,
-                        clean::AssocConstItem(_, default) => Some(default),
+                        clean::TyAssocConstItem(..) => None,
+                        clean::AssocConstItem(.., default) => Some(default),
                         _ => unreachable!(),
                     },
                     link.anchor(if trait_.is_some() { &source_id } else { &id }),
-                    "",
+                    0,
                     cx,
                 );
-                w.write_str("</h4>");
-                w.write_str("</section>");
+                w.write_str("</h4></section>");
             }
             clean::TyAssocTypeItem(generics, bounds) => {
-                let source_id = format!("{}.{}", item_type, name);
-                let id = cx.derive_id(source_id.clone());
-                write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class);
+                let source_id = format!("{item_type}.{name}");
+                let id = cx.derive_id(&source_id);
+                write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
                 if trait_.is_some() {
                     // Anchors are only used on trait impls.
-                    write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
+                    write!(w, "<a href=\"#{id}\" class=\"anchor\">§</a>");
                 }
                 w.write_str("<h4 class=\"code-header\">");
                 assoc_type(
@@ -1610,16 +1619,15 @@ fn render_impl(
                     0,
                     cx,
                 );
-                w.write_str("</h4>");
-                w.write_str("</section>");
+                w.write_str("</h4></section>");
             }
             clean::AssocTypeItem(tydef, _bounds) => {
-                let source_id = format!("{}.{}", item_type, name);
-                let id = cx.derive_id(source_id.clone());
-                write!(w, "<section id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class);
+                let source_id = format!("{item_type}.{name}");
+                let id = cx.derive_id(&source_id);
+                write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
                 if trait_.is_some() {
                     // Anchors are only used on trait impls.
-                    write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
+                    write!(w, "<a href=\"#{id}\" class=\"anchor\">§</a>");
                 }
                 w.write_str("<h4 class=\"code-header\">");
                 assoc_type(
@@ -1632,8 +1640,7 @@ fn render_impl(
                     0,
                     cx,
                 );
-                w.write_str("</h4>");
-                w.write_str("</section>");
+                w.write_str("</h4></section>");
             }
             clean::StrippedItem(..) => return,
             _ => panic!("can't make docs for trait item with name {:?}", item.name),
@@ -1736,10 +1743,10 @@ fn render_impl(
             close_tags.insert_str(0, "</details>");
             write!(
                 w,
-                "<details class=\"toggle implementors-toggle\"{}>",
+                "<details class=\"toggle implementors-toggle\"{}>\
+                     <summary>",
                 if rendering_params.toggle_open_by_default { " open" } else { "" }
             );
-            write!(w, "<summary>")
         }
         render_impl_summary(
             w,
@@ -1752,15 +1759,15 @@ fn render_impl(
             aliases,
         );
         if toggled {
-            write!(w, "</summary>")
+            w.write_str("</summary>");
         }
 
         if let Some(ref dox) = i.impl_item.opt_doc_value() {
             if trait_.is_none() && i.inner_impl().items.is_empty() {
                 w.write_str(
                     "<div class=\"item-info\">\
-                    <div class=\"stab empty-impl\">This impl block contains no items.</div>\
-                </div>",
+                         <div class=\"stab empty-impl\">This impl block contains no items.</div>\
+                     </div>",
                 );
             }
             write!(
@@ -1819,11 +1826,11 @@ fn render_rightside(
         const_stable_since,
         if has_src_ref { "" } else { " rightside" },
     );
-    if let Some(l) = src_href {
+    if let Some(link) = src_href {
         if has_stability {
-            write!(rightside, " · <a class=\"src\" href=\"{}\">source</a>", l)
+            write!(rightside, " · <a class=\"src\" href=\"{link}\">source</a>")
         } else {
-            write!(rightside, "<a class=\"src rightside\" href=\"{}\">source</a>", l)
+            write!(rightside, "<a class=\"src rightside\" href=\"{link}\">source</a>")
         }
     }
     if has_stability && has_src_ref {
@@ -1852,10 +1859,13 @@ pub(crate) fn render_impl_summary(
     } else {
         format!(" data-aliases=\"{}\"", aliases.join(","))
     };
-    write!(w, "<section id=\"{}\" class=\"impl\"{}>", id, aliases);
+    write!(w, "<section id=\"{id}\" class=\"impl\"{aliases}>");
     render_rightside(w, cx, &i.impl_item, containing_item, RenderMode::Normal);
-    write!(w, "<a href=\"#{}\" class=\"anchor\">§</a>", id);
-    write!(w, "<h3 class=\"code-header\">");
+    write!(
+        w,
+        "<a href=\"#{id}\" class=\"anchor\">§</a>\
+         <h3 class=\"code-header\">"
+    );
 
     if let Some(use_absolute) = use_absolute {
         write!(w, "{}", inner_impl.print(use_absolute, cx));
@@ -1880,15 +1890,16 @@ pub(crate) fn render_impl_summary(
     } else {
         write!(w, "{}", inner_impl.print(false, cx));
     }
-    write!(w, "</h3>");
+    w.write_str("</h3>");
 
     let is_trait = inner_impl.trait_.is_some();
     if is_trait {
         if let Some(portability) = portability(&i.impl_item, Some(parent)) {
             write!(
                 w,
-                "<span class=\"item-info\"><div class=\"stab portability\">{}</div></span>",
-                portability
+                "<span class=\"item-info\">\
+                     <div class=\"stab portability\">{portability}</div>\
+                 </span>",
             );
         }
     }
@@ -1941,7 +1952,7 @@ pub(crate) fn small_url_encode(s: String) -> String {
             // consistent with itself when encoding them.
             st += "+";
         } else {
-            write!(st, "%{:02X}", b).unwrap();
+            write!(st, "%{b:02X}").unwrap();
         }
         // Invariant: if the current byte is not at the start of a multi-byte character,
         // we need to get down here so that when the next turn of the loop comes around,
@@ -2256,7 +2267,7 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
                 format!("lines {}-{}", line_lo + 1, line_hi + 1),
             )
         };
-        let url = format!("{}{}#{}", cx.root_path(), call_data.url, anchor);
+        let url = format!("{}{}#{anchor}", cx.root_path(), call_data.url);
         (url, title)
     };
 
@@ -2266,7 +2277,7 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
             Ok(contents) => contents,
             Err(err) => {
                 let span = item.span(tcx).map_or(rustc_span::DUMMY_SP, |span| span.inner());
-                tcx.sess.span_err(span, format!("failed to read file {}: {}", path.display(), err));
+                tcx.sess.span_err(span, format!("failed to read file {}: {err}", path.display()));
                 return false;
             }
         };
@@ -2325,7 +2336,7 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
         .unwrap();
 
         if line_ranges.len() > 1 {
-            write!(w, r#"<button class="prev">&pr;</button> <button class="next">&sc;</button>"#)
+            w.write_str(r#"<button class="prev">&pr;</button> <button class="next">&sc;</button>"#)
                 .unwrap();
         }
 
@@ -2361,7 +2372,7 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
             highlight::DecorationInfo(decoration_info),
             sources::SourceContext::Embedded { offset: line_min, needs_expansion },
         );
-        write!(w, "</div></div>").unwrap();
+        w.write_str("</div></div>").unwrap();
 
         true
     };
@@ -2428,8 +2439,10 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
 
         // For the remaining examples, generate a <ul> containing links to the source files.
         if it.peek().is_some() {
-            write!(w, r#"<div class="example-links">Additional examples can be found in:<br><ul>"#)
-                .unwrap();
+            w.write_str(
+                r#"<div class="example-links">Additional examples can be found in:<br><ul>"#,
+            )
+            .unwrap();
             it.for_each(|(_, call_data)| {
                 let (url, _) = link_to_loc(call_data, &call_data.locations[0]);
                 write!(
@@ -2440,11 +2453,11 @@ fn render_call_locations<W: fmt::Write>(mut w: W, cx: &mut Context<'_>, item: &c
                 )
                 .unwrap();
             });
-            write!(w, "</ul></div>").unwrap();
+            w.write_str("</ul></div>").unwrap();
         }
 
-        write!(w, "</div></details>").unwrap();
+        w.write_str("</div></details>").unwrap();
     }
 
-    write!(w, "</div>").unwrap();
+    w.write_str("</div>").unwrap();
 }
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 383e3c17088..cfced799f1e 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -433,7 +433,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
                     <a href=\"#{id}\">{name}</a>\
                  </h2>{}",
                 ITEM_TABLE_OPEN,
-                id = cx.derive_id(my_section.id().to_owned()),
+                id = cx.derive_id(my_section.id()),
                 name = my_section.name(),
             );
         }
@@ -1543,10 +1543,12 @@ fn item_constant(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, c: &cle
 
         write!(
             w,
-            "{vis}const {name}: {typ}",
+            "{vis}const {name}{generics}: {typ}{where_clause}",
             vis = visibility_print_with_space(it.visibility(tcx), it.item_id, cx),
             name = it.name.unwrap(),
+            generics = c.generics.print(cx),
             typ = c.type_.print(cx),
+            where_clause = print_where_clause(&c.generics, cx, 0, Ending::NoNewline),
         );
 
         // FIXME: The code below now prints
diff --git a/src/librustdoc/html/render/span_map.rs b/src/librustdoc/html/render/span_map.rs
index ac587bf6008..5f130f1875a 100644
--- a/src/librustdoc/html/render/span_map.rs
+++ b/src/librustdoc/html/render/span_map.rs
@@ -219,7 +219,7 @@ impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
     fn visit_item(&mut self, item: &'tcx Item<'tcx>) {
         match item.kind {
             ItemKind::Static(_, _, _)
-            | ItemKind::Const(_, _)
+            | ItemKind::Const(_, _, _)
             | ItemKind::Fn(_, _, _)
             | ItemKind::Macro(_, _)
             | ItemKind::TyAlias(_, _)
diff --git a/src/librustdoc/html/templates/type_layout.html b/src/librustdoc/html/templates/type_layout.html
index 20e09a54805..287cbab07d2 100644
--- a/src/librustdoc/html/templates/type_layout.html
+++ b/src/librustdoc/html/templates/type_layout.html
@@ -44,6 +44,11 @@
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
             the type was too big. {# #}
         </p> {# #}
+        {% when Err(LayoutError::ReferencesError(_)) %}
+        <p> {# #}
+            <strong>Note:</strong> Encountered an error during type layout; {#+ #}
+            the type references errors. {# #}
+        </p> {# #}
         {% when Err(LayoutError::NormalizationFailure(_, _)) %}
         <p> {# #}
             <strong>Note:</strong> Encountered an error during type layout; {#+ #}
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index 91cd55b1113..8673138f649 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -171,6 +171,7 @@ impl FromWithTcx<clean::GenericArg> for GenericArg {
 }
 
 impl FromWithTcx<clean::Constant> for Constant {
+    // FIXME(generic_const_items): Add support for generic const items.
     fn from_tcx(constant: clean::Constant, tcx: TyCtxt<'_>) -> Self {
         let expr = constant.expr(tcx);
         let value = constant.value(tcx);
@@ -321,8 +322,12 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
                 impls: Vec::new(), // Added in JsonRenderer::item
             })
         }
-        TyAssocConstItem(ty) => ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: None },
-        AssocConstItem(ty, default) => {
+        // FIXME(generic_const_items): Add support for generic associated consts.
+        TyAssocConstItem(_generics, ty) => {
+            ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: None }
+        }
+        // FIXME(generic_const_items): Add support for generic associated consts.
+        AssocConstItem(_generics, ty, default) => {
             ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: Some(default.expr(tcx)) }
         }
         TyAssocTypeItem(g, b) => ItemEnum::AssocType {
diff --git a/src/librustdoc/passes/check_doc_test_visibility.rs b/src/librustdoc/passes/check_doc_test_visibility.rs
index 011ca9a4961..e333a35e8ad 100644
--- a/src/librustdoc/passes/check_doc_test_visibility.rs
+++ b/src/librustdoc/passes/check_doc_test_visibility.rs
@@ -7,11 +7,11 @@
 
 use super::Pass;
 use crate::clean;
+use crate::clean::utils::inherits_doc_hidden;
 use crate::clean::*;
 use crate::core::DocContext;
 use crate::html::markdown::{find_testable_code, ErrorCodes, Ignore, LangString};
 use crate::visit::DocVisitor;
-use crate::visit_ast::inherits_doc_hidden;
 use rustc_hir as hir;
 use rustc_middle::lint::LintLevelSource;
 use rustc_session::lint;
diff --git a/src/librustdoc/passes/strip_hidden.rs b/src/librustdoc/passes/strip_hidden.rs
index 7b990cd4348..81a90ed498a 100644
--- a/src/librustdoc/passes/strip_hidden.rs
+++ b/src/librustdoc/passes/strip_hidden.rs
@@ -6,11 +6,11 @@ use rustc_span::symbol::sym;
 use std::mem;
 
 use crate::clean;
+use crate::clean::utils::inherits_doc_hidden;
 use crate::clean::{Item, ItemIdSet};
 use crate::core::DocContext;
 use crate::fold::{strip_item, DocFolder};
 use crate::passes::{ImplStripper, Pass};
-use crate::visit_ast::inherits_doc_hidden;
 
 pub(crate) const STRIP_HIDDEN: Pass = Pass {
     name: "strip-hidden",
diff --git a/src/librustdoc/passes/stripper.rs b/src/librustdoc/passes/stripper.rs
index a6d31534f1d..64a4ace5b9f 100644
--- a/src/librustdoc/passes/stripper.rs
+++ b/src/librustdoc/passes/stripper.rs
@@ -3,10 +3,10 @@ use rustc_hir::def_id::DefId;
 use rustc_middle::ty::{TyCtxt, Visibility};
 use std::mem;
 
+use crate::clean::utils::inherits_doc_hidden;
 use crate::clean::{self, Item, ItemId, ItemIdSet};
 use crate::fold::{strip_item, DocFolder};
 use crate::formats::cache::Cache;
-use crate::visit_ast::inherits_doc_hidden;
 use crate::visit_lib::RustdocEffectiveVisibilities;
 
 pub(crate) struct Stripper<'a, 'tcx> {
diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs
index 2f67e12df91..3bad9ba4e4a 100644
--- a/src/librustdoc/visit_ast.rs
+++ b/src/librustdoc/visit_ast.rs
@@ -16,6 +16,7 @@ use rustc_span::Span;
 
 use std::mem;
 
+use crate::clean::utils::{inherits_doc_hidden, should_ignore_res};
 use crate::clean::{cfg::Cfg, reexport_chain, AttributesExt, NestedAttributesExt};
 use crate::core;
 
@@ -73,33 +74,6 @@ fn def_id_to_path(tcx: TyCtxt<'_>, did: DefId) -> Vec<Symbol> {
     std::iter::once(crate_name).chain(relative).collect()
 }
 
-pub(crate) fn inherits_doc_hidden(
-    tcx: TyCtxt<'_>,
-    mut def_id: LocalDefId,
-    stop_at: Option<LocalDefId>,
-) -> bool {
-    let hir = tcx.hir();
-    while let Some(id) = tcx.opt_local_parent(def_id) {
-        if let Some(stop_at) = stop_at && id == stop_at {
-            return false;
-        }
-        def_id = id;
-        if tcx.is_doc_hidden(def_id.to_def_id()) {
-            return true;
-        } else if let Some(node) = hir.find_by_def_id(def_id) &&
-            matches!(
-                node,
-                hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(_), .. }),
-            )
-        {
-            // `impl` blocks stand a bit on their own: unless they have `#[doc(hidden)]` directly
-            // on them, they don't inherit it from the parent context.
-            return false;
-        }
-    }
-    false
-}
-
 pub(crate) struct RustdocVisitor<'a, 'tcx> {
     cx: &'a mut core::DocContext<'tcx>,
     view_item_stack: LocalDefIdSet,
@@ -466,7 +440,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
                 for &res in &path.res {
                     // Struct and variant constructors and proc macro stubs always show up alongside
                     // their definitions, we've already processed them so just discard these.
-                    if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = res {
+                    if should_ignore_res(res) {
                         continue;
                     }
 
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 06248fa7f35136f66114b2f82c29abcefd5f1e9
+Subproject a7d11c453784a3f258c7269b5108c58592d27e1
diff --git a/src/tools/build-manifest/Cargo.toml b/src/tools/build-manifest/Cargo.toml
index 6c3b5bb00a3..7e0c4bee2b3 100644
--- a/src/tools/build-manifest/Cargo.toml
+++ b/src/tools/build-manifest/Cargo.toml
@@ -8,7 +8,7 @@ toml = "0.5"
 serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 anyhow = "1.0.32"
-flate2 = "1.0.16"
+flate2 = "1.0.26"
 xz2 = "0.1.7"
 tar = "0.4.29"
 sha2 = "0.10.1"
diff --git a/src/tools/cargo b/src/tools/cargo
-Subproject 7ac9416d82cd4fc5e707c9ec3574d22dff6466e
+Subproject c91a693e7977e33a1064b63a5daf5fb689f0165
diff --git a/src/tools/clippy/clippy_lints/src/derive.rs b/src/tools/clippy/clippy_lints/src/derive.rs
index c343f248d06..91bc30ab577 100644
--- a/src/tools/clippy/clippy_lints/src/derive.rs
+++ b/src/tools/clippy/clippy_lints/src/derive.rs
@@ -6,7 +6,7 @@ use rustc_errors::Applicability;
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{walk_expr, walk_fn, walk_item, FnKind, Visitor};
 use rustc_hir::{
-    self as hir, BlockCheckMode, BodyId, Constness, Expr, ExprKind, FnDecl, Impl, Item, ItemKind, UnsafeSource,
+    self as hir, BlockCheckMode, BodyId, Expr, ExprKind, FnDecl, Impl, Item, ItemKind, UnsafeSource,
     Unsafety,
 };
 use rustc_lint::{LateContext, LateLintPass};
@@ -526,6 +526,5 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
             }),
         )),
         Reveal::UserFacing,
-        Constness::NotConst,
     )
 }
diff --git a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs
index 4dc750c03b4..9b26c3573e1 100644
--- a/src/tools/clippy/clippy_lints/src/large_const_arrays.rs
+++ b/src/tools/clippy/clippy_lints/src/large_const_arrays.rs
@@ -50,7 +50,11 @@ impl<'tcx> LateLintPass<'tcx> for LargeConstArrays {
     fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
         if_chain! {
             if !item.span.from_expansion();
-            if let ItemKind::Const(hir_ty, _) = &item.kind;
+            if let ItemKind::Const(hir_ty, generics, _) = &item.kind;
+            // Since static items may not have generics, skip generic const items.
+            // FIXME(generic_const_items): I don't think checking `generics.hwcp` suffices as it
+            // doesn't account for empty where-clauses that only consist of keyword `where` IINM.
+            if generics.params.is_empty() && !generics.has_where_clause_predicates;
             let ty = hir_ty_to_ty(cx.tcx, hir_ty);
             if let ty::Array(element_type, cst) = ty.kind();
             if let ConstKind::Value(ty::ValTree::Leaf(element_count)) = cst.kind();
diff --git a/src/tools/clippy/clippy_lints/src/manual_float_methods.rs b/src/tools/clippy/clippy_lints/src/manual_float_methods.rs
index 085c73a5f9f..f48a5d9d245 100644
--- a/src/tools/clippy/clippy_lints/src/manual_float_methods.rs
+++ b/src/tools/clippy/clippy_lints/src/manual_float_methods.rs
@@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_then;
 use clippy_utils::source::snippet_opt;
 use clippy_utils::{is_from_proc_macro, path_to_local};
 use rustc_errors::Applicability;
-use rustc_hir::{BinOpKind, Expr, ExprKind};
+use rustc_hir::{BinOpKind, Constness, Expr, ExprKind};
 use rustc_lint::{LateContext, LateLintPass, Lint, LintContext};
 use rustc_middle::lint::in_external_macro;
 use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -83,8 +83,10 @@ impl Variant {
 impl<'tcx> LateLintPass<'tcx> for ManualFloatMethods {
     fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
         if !in_external_macro(cx.sess(), expr.span)
-            && (!cx.param_env.is_const() || cx.tcx.features().active(sym!(const_float_classify)))
-            && let ExprKind::Binary(kind, lhs, rhs) = expr.kind
+            && (
+                matches!(cx.tcx.constness(cx.tcx.hir().enclosing_body_owner(expr.hir_id)), Constness::NotConst) 
+                    || cx.tcx.features().active(sym!(const_float_classify))
+            ) && let ExprKind::Binary(kind, lhs, rhs) = expr.kind
             && let ExprKind::Binary(lhs_kind, lhs_lhs, lhs_rhs) = lhs.kind
             && let ExprKind::Binary(rhs_kind, rhs_lhs, rhs_rhs) = rhs.kind
             // Checking all possible scenarios using a function would be a hopeless task, as we have
diff --git a/src/tools/clippy/clippy_lints/src/non_copy_const.rs b/src/tools/clippy/clippy_lints/src/non_copy_const.rs
index 87699fd0ca6..8bb2fa92585 100644
--- a/src/tools/clippy/clippy_lints/src/non_copy_const.rs
+++ b/src/tools/clippy/clippy_lints/src/non_copy_const.rs
@@ -302,7 +302,7 @@ declare_lint_pass!(NonCopyConst => [DECLARE_INTERIOR_MUTABLE_CONST, BORROW_INTER
 
 impl<'tcx> LateLintPass<'tcx> for NonCopyConst {
     fn check_item(&mut self, cx: &LateContext<'tcx>, it: &'tcx Item<'_>) {
-        if let ItemKind::Const(hir_ty, body_id) = it.kind {
+        if let ItemKind::Const(hir_ty, _generics, body_id) = it.kind {
             let ty = hir_ty_to_ty(cx.tcx, hir_ty);
             if !ignored_macro(cx, it) && is_unfrozen(cx, ty) && is_value_unfrozen_poly(cx, body_id, ty) {
                 lint(cx, Source::Item { item: it.span });
diff --git a/src/tools/clippy/clippy_lints/src/operators/bit_mask.rs b/src/tools/clippy/clippy_lints/src/operators/bit_mask.rs
index 1fddf0f50e3..c146f3ae95b 100644
--- a/src/tools/clippy/clippy_lints/src/operators/bit_mask.rs
+++ b/src/tools/clippy/clippy_lints/src/operators/bit_mask.rs
@@ -40,9 +40,9 @@ fn check_compare(cx: &LateContext<'_>, bit_op: &Expr<'_>, cmp_op: BinOpKind, cmp
         if op.node != BinOpKind::BitAnd && op.node != BinOpKind::BitOr {
             return;
         }
-        fetch_int_literal(cx, right)
-            .or_else(|| fetch_int_literal(cx, left))
-            .map_or((), |mask| check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span));
+        if let Some(mask) = fetch_int_literal(cx, right).or_else(|| fetch_int_literal(cx, left)) {
+            check_bit_mask(cx, op.node, cmp_op, mask, cmp_value, span);
+        }
     }
 }
 
diff --git a/src/tools/clippy/clippy_lints/src/renamed_lints.rs b/src/tools/clippy/clippy_lints/src/renamed_lints.rs
index d24215c2292..e532dd61a82 100644
--- a/src/tools/clippy/clippy_lints/src/renamed_lints.rs
+++ b/src/tools/clippy/clippy_lints/src/renamed_lints.rs
@@ -31,7 +31,7 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
     ("clippy::stutter", "clippy::module_name_repetitions"),
     ("clippy::to_string_in_display", "clippy::recursive_format_impl"),
     ("clippy::zero_width_space", "clippy::invisible_characters"),
-    ("clippy::cast_ref_to_mut", "cast_ref_to_mut"),
+    ("clippy::cast_ref_to_mut", "invalid_reference_casting"),
     ("clippy::clone_double_ref", "suspicious_double_ref_op"),
     ("clippy::cmp_nan", "invalid_nan_comparisons"),
     ("clippy::drop_bounds", "drop_bounds"),
diff --git a/src/tools/clippy/clippy_lints/src/types/mod.rs b/src/tools/clippy/clippy_lints/src/types/mod.rs
index 3c873a5901d..79f9d45d597 100644
--- a/src/tools/clippy/clippy_lints/src/types/mod.rs
+++ b/src/tools/clippy/clippy_lints/src/types/mod.rs
@@ -349,7 +349,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
         let is_exported = cx.effective_visibilities.is_exported(item.owner_id.def_id);
 
         match item.kind {
-            ItemKind::Static(ty, _, _) | ItemKind::Const(ty, _) => self.check_ty(
+            ItemKind::Static(ty, _, _) | ItemKind::Const(ty, _, _) => self.check_ty(
                 cx,
                 ty,
                 CheckTyContext {
diff --git a/src/tools/clippy/clippy_utils/src/ast_utils.rs b/src/tools/clippy/clippy_utils/src/ast_utils.rs
index 8cc01f1ef97..7e42924603a 100644
--- a/src/tools/clippy/clippy_utils/src/ast_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/ast_utils.rs
@@ -301,15 +301,17 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
         (
             Const(box ast::ConstItem {
                 defaultness: ld,
+                generics: lg,
                 ty: lt,
                 expr: le,
             }),
             Const(box ast::ConstItem {
                 defaultness: rd,
+                generics: rg,
                 ty: rt,
                 expr: re,
             }),
-        ) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
+        ) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le, re),
         (
             Fn(box ast::Fn {
                 defaultness: ld,
@@ -476,15 +478,17 @@ pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
         (
             Const(box ast::ConstItem {
                 defaultness: ld,
+                generics: lg,
                 ty: lt,
                 expr: le,
             }),
             Const(box ast::ConstItem {
                 defaultness: rd,
+                generics: rg,
                 ty: rt,
                 expr: re,
             }),
-        ) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
+        ) => eq_defaultness(*ld, *rd) && eq_generics(lg, rg) && eq_ty(lt, rt) && eq_expr_opt(le, re),
         (
             Fn(box ast::Fn {
                 defaultness: ld,
diff --git a/src/tools/clippy/clippy_utils/src/consts.rs b/src/tools/clippy/clippy_utils/src/consts.rs
index 061086c4fc2..f19e09a18ec 100644
--- a/src/tools/clippy/clippy_utils/src/consts.rs
+++ b/src/tools/clippy/clippy_utils/src/consts.rs
@@ -461,7 +461,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
                 // Check if this constant is based on `cfg!(..)`,
                 // which is NOT constant for our purposes.
                 if let Some(node) = self.lcx.tcx.hir().get_if_local(def_id)
-                    && let Node::Item(Item { kind: ItemKind::Const(_, body_id), .. }) = node
+                    && let Node::Item(Item { kind: ItemKind::Const(.., body_id), .. }) = node
                     && let Node::Expr(Expr { kind: ExprKind::Lit(_), span, .. }) = self.lcx
                         .tcx
                         .hir()
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs
index 035511e8912..45b99df46b0 100644
--- a/src/tools/clippy/clippy_utils/src/lib.rs
+++ b/src/tools/clippy/clippy_utils/src/lib.rs
@@ -2380,7 +2380,7 @@ fn with_test_item_names(tcx: TyCtxt<'_>, module: LocalDefId, f: impl Fn(&[Symbol
             for id in tcx.hir().module_items(module) {
                 if matches!(tcx.def_kind(id.owner_id), DefKind::Const)
                     && let item = tcx.hir().item(id)
-                    && let ItemKind::Const(ty, _body) = item.kind {
+                    && let ItemKind::Const(ty, _generics, _body) = item.kind {
                     if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind {
                         // We could also check for the type name `test::TestDescAndFn`
                         if let Res::Def(DefKind::Struct, _) = path.res {
diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
index e563e41ab2a..a98e2038d5f 100644
--- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
+++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
@@ -391,32 +391,38 @@ fn is_const_fn(tcx: TyCtxt<'_>, def_id: DefId, msrv: &Msrv) -> bool {
 
 #[expect(clippy::similar_names)] // bit too pedantic
 fn is_ty_const_destruct<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>) -> bool {
-    // Avoid selecting for simple cases, such as builtin types.
-    if ty::util::is_trivially_const_drop(ty) {
-        return true;
-    }
+    // FIXME(effects, fee1-dead) revert to const destruct once it works again
+    #[expect(unused)]
+    fn is_ty_const_destruct_unused<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>) -> bool {
+        // Avoid selecting for simple cases, such as builtin types.
+        if ty::util::is_trivially_const_drop(ty) {
+            return true;
+        }
 
-    let obligation = Obligation::new(
-        tcx,
-        ObligationCause::dummy_with_span(body.span),
-        ConstCx::new(tcx, body).param_env.with_const(),
-        TraitRef::from_lang_item(tcx, LangItem::Destruct, body.span, [ty]).with_constness(BoundConstness::ConstIfConst),
-    );
+        let obligation = Obligation::new(
+            tcx,
+            ObligationCause::dummy_with_span(body.span),
+            ConstCx::new(tcx, body).param_env,
+            TraitRef::from_lang_item(tcx, LangItem::Destruct, body.span, [ty]).with_constness(BoundConstness::ConstIfConst),
+        );
 
-    let infcx = tcx.infer_ctxt().build();
-    let mut selcx = SelectionContext::new(&infcx);
-    let Some(impl_src) = selcx.select(&obligation).ok().flatten() else {
-        return false;
-    };
+        let infcx = tcx.infer_ctxt().build();
+        let mut selcx = SelectionContext::new(&infcx);
+        let Some(impl_src) = selcx.select(&obligation).ok().flatten() else {
+            return false;
+        };
+
+        if !matches!(
+            impl_src,
+            ImplSource::Builtin(BuiltinImplSource::Misc, _) | ImplSource::Param(ty::BoundConstness::ConstIfConst, _)
+        ) {
+            return false;
+        }
 
-    if !matches!(
-        impl_src,
-        ImplSource::Builtin(BuiltinImplSource::Misc, _) | ImplSource::Param(ty::BoundConstness::ConstIfConst, _)
-    ) {
-        return false;
+        let ocx = ObligationCtxt::new(&infcx);
+        ocx.register_obligations(impl_src.nested_obligations());
+        ocx.select_all_or_error().is_empty()
     }
 
-    let ocx = ObligationCtxt::new(&infcx);
-    ocx.register_obligations(impl_src.nested_obligations());
-    ocx.select_all_or_error().is_empty()
+    !ty.needs_drop(tcx, ConstCx::new(tcx, body).param_env)    
 }
diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs
index d70c4ea34cb..f714b296233 100644
--- a/src/tools/clippy/tests/compile-test.rs
+++ b/src/tools/clippy/tests/compile-test.rs
@@ -115,7 +115,9 @@ fn base_config(test_dir: &str) -> compiletest::Config {
         mode: TestMode::Yolo,
         stderr_filters: vec![],
         stdout_filters: vec![],
-        output_conflict_handling: if var_os("BLESS").is_some() || env::args().any(|arg| arg == "--bless") {
+        // FIXME(tgross35): deduplicate bless env once clippy can update
+        output_conflict_handling: if var_os("RUSTC_BLESS").is_some_and(|v| v != "0")
+        || env::args().any(|arg| arg == "--bless") {
             compiletest::OutputConflictHandling::Bless
         } else {
             compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into())
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.fixed b/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
index 4d72b58cdf8..4c0b0d8f275 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.fixed
@@ -4,6 +4,7 @@
 #![allow(
     clippy::borrow_deref_ref,
     suspicious_double_ref_op,
+    noop_method_call,
     clippy::explicit_auto_deref,
     clippy::needless_borrow,
     clippy::no_effect,
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.rs b/src/tools/clippy/tests/ui/explicit_deref_methods.rs
index fcd945de338..bc5da35e52e 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.rs
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.rs
@@ -4,6 +4,7 @@
 #![allow(
     clippy::borrow_deref_ref,
     suspicious_double_ref_op,
+    noop_method_call,
     clippy::explicit_auto_deref,
     clippy::needless_borrow,
     clippy::no_effect,
diff --git a/src/tools/clippy/tests/ui/explicit_deref_methods.stderr b/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
index 362e559b21a..e4d2fe3a1c3 100644
--- a/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
+++ b/src/tools/clippy/tests/ui/explicit_deref_methods.stderr
@@ -1,5 +1,5 @@
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:54:19
+  --> $DIR/explicit_deref_methods.rs:55:19
    |
 LL |     let b: &str = a.deref();
    |                   ^^^^^^^^^ help: try: `&*a`
@@ -7,67 +7,67 @@ LL |     let b: &str = a.deref();
    = note: `-D clippy::explicit-deref-methods` implied by `-D warnings`
 
 error: explicit `deref_mut` method call
-  --> $DIR/explicit_deref_methods.rs:56:23
+  --> $DIR/explicit_deref_methods.rs:57:23
    |
 LL |     let b: &mut str = a.deref_mut();
    |                       ^^^^^^^^^^^^^ help: try: `&mut **a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:59:39
+  --> $DIR/explicit_deref_methods.rs:60:39
    |
 LL |     let b: String = format!("{}, {}", a.deref(), a.deref());
    |                                       ^^^^^^^^^ help: try: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:59:50
+  --> $DIR/explicit_deref_methods.rs:60:50
    |
 LL |     let b: String = format!("{}, {}", a.deref(), a.deref());
    |                                                  ^^^^^^^^^ help: try: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:61:20
+  --> $DIR/explicit_deref_methods.rs:62:20
    |
 LL |     println!("{}", a.deref());
    |                    ^^^^^^^^^ help: try: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:64:11
+  --> $DIR/explicit_deref_methods.rs:65:11
    |
 LL |     match a.deref() {
    |           ^^^^^^^^^ help: try: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:68:28
+  --> $DIR/explicit_deref_methods.rs:69:28
    |
 LL |     let b: String = concat(a.deref());
    |                            ^^^^^^^^^ help: try: `&*a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:70:13
+  --> $DIR/explicit_deref_methods.rs:71:13
    |
 LL |     let b = just_return(a).deref();
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:72:28
+  --> $DIR/explicit_deref_methods.rs:73:28
    |
 LL |     let b: String = concat(just_return(a).deref());
    |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:74:19
+  --> $DIR/explicit_deref_methods.rs:75:19
    |
 LL |     let b: &str = a.deref().deref();
    |                   ^^^^^^^^^^^^^^^^^ help: try: `&**a`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:77:13
+  --> $DIR/explicit_deref_methods.rs:78:13
    |
 LL |     let b = opt_a.unwrap().deref();
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*opt_a.unwrap()`
 
 error: explicit `deref` method call
-  --> $DIR/explicit_deref_methods.rs:114:31
+  --> $DIR/explicit_deref_methods.rs:115:31
    |
 LL |     let b: &str = expr_deref!(a.deref());
    |                               ^^^^^^^^^ help: try: `&*a`
diff --git a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs
index b1980b1b523..3aaee67e1d9 100644
--- a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs
+++ b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.rs
@@ -99,4 +99,5 @@ impl const Drop for D {
 }
 
 // Lint this, since it can be dropped in const contexts
+// FIXME(effects)
 fn d(this: D) {}
diff --git a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr
index 7be2cc0ca93..66cf4e31529 100644
--- a/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr
+++ b/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr
@@ -89,11 +89,5 @@ LL | |     46
 LL | | }
    | |_^
 
-error: this could be a `const fn`
-  --> $DIR/could_be_const.rs:102:1
-   |
-LL | fn d(this: D) {}
-   | ^^^^^^^^^^^^^^^^
-
-error: aborting due to 12 previous errors
+error: aborting due to 11 previous errors
 
diff --git a/src/tools/clippy/tests/ui/rename.fixed b/src/tools/clippy/tests/ui/rename.fixed
index cab02bb93c9..03d9ea41a0b 100644
--- a/src/tools/clippy/tests/ui/rename.fixed
+++ b/src/tools/clippy/tests/ui/rename.fixed
@@ -28,9 +28,9 @@
 #![allow(clippy::module_name_repetitions)]
 #![allow(clippy::recursive_format_impl)]
 #![allow(clippy::invisible_characters)]
-#![allow(cast_ref_to_mut)]
 #![allow(suspicious_double_ref_op)]
 #![allow(invalid_nan_comparisons)]
+#![allow(invalid_reference_casting)]
 #![allow(drop_bounds)]
 #![allow(dropping_copy_types)]
 #![allow(dropping_references)]
@@ -79,7 +79,7 @@
 #![warn(clippy::module_name_repetitions)]
 #![warn(clippy::recursive_format_impl)]
 #![warn(clippy::invisible_characters)]
-#![warn(cast_ref_to_mut)]
+#![warn(invalid_reference_casting)]
 #![warn(suspicious_double_ref_op)]
 #![warn(invalid_nan_comparisons)]
 #![warn(drop_bounds)]
diff --git a/src/tools/clippy/tests/ui/rename.rs b/src/tools/clippy/tests/ui/rename.rs
index e5e31452149..c028fcb5a37 100644
--- a/src/tools/clippy/tests/ui/rename.rs
+++ b/src/tools/clippy/tests/ui/rename.rs
@@ -28,9 +28,9 @@
 #![allow(clippy::module_name_repetitions)]
 #![allow(clippy::recursive_format_impl)]
 #![allow(clippy::invisible_characters)]
-#![allow(cast_ref_to_mut)]
 #![allow(suspicious_double_ref_op)]
 #![allow(invalid_nan_comparisons)]
+#![allow(invalid_reference_casting)]
 #![allow(drop_bounds)]
 #![allow(dropping_copy_types)]
 #![allow(dropping_references)]
diff --git a/src/tools/clippy/tests/ui/rename.stderr b/src/tools/clippy/tests/ui/rename.stderr
index 783608a0841..4d8a7fd70f4 100644
--- a/src/tools/clippy/tests/ui/rename.stderr
+++ b/src/tools/clippy/tests/ui/rename.stderr
@@ -174,11 +174,11 @@ error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_ch
 LL | #![warn(clippy::zero_width_space)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters`
 
-error: lint `clippy::cast_ref_to_mut` has been renamed to `cast_ref_to_mut`
+error: lint `clippy::cast_ref_to_mut` has been renamed to `invalid_reference_casting`
   --> $DIR/rename.rs:82:9
    |
 LL | #![warn(clippy::cast_ref_to_mut)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `cast_ref_to_mut`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_reference_casting`
 
 error: lint `clippy::clone_double_ref` has been renamed to `suspicious_double_ref_op`
   --> $DIR/rename.rs:83:9
diff --git a/src/tools/clippy/tests/ui/result_map_or_into_option.fixed b/src/tools/clippy/tests/ui/result_map_or_into_option.fixed
index 119ff25918a..6850eeb7a4c 100644
--- a/src/tools/clippy/tests/ui/result_map_or_into_option.fixed
+++ b/src/tools/clippy/tests/ui/result_map_or_into_option.fixed
@@ -15,5 +15,5 @@ fn main() {
     // A non-Some `f` closure where the argument is not used as the
     // return should not emit the lint
     let opt: Result<u32, &str> = Ok(1);
-    opt.map_or(None, |_x| Some(1));
+    _ = opt.map_or(None, |_x| Some(1));
 }
diff --git a/src/tools/clippy/tests/ui/result_map_or_into_option.rs b/src/tools/clippy/tests/ui/result_map_or_into_option.rs
index eeeef830af0..8e151814407 100644
--- a/src/tools/clippy/tests/ui/result_map_or_into_option.rs
+++ b/src/tools/clippy/tests/ui/result_map_or_into_option.rs
@@ -15,5 +15,5 @@ fn main() {
     // A non-Some `f` closure where the argument is not used as the
     // return should not emit the lint
     let opt: Result<u32, &str> = Ok(1);
-    opt.map_or(None, |_x| Some(1));
+    _ = opt.map_or(None, |_x| Some(1));
 }
diff --git a/src/tools/compiletest/src/header/cfg.rs b/src/tools/compiletest/src/header/cfg.rs
index 86a749b935d..77c2866b366 100644
--- a/src/tools/compiletest/src/header/cfg.rs
+++ b/src/tools/compiletest/src/header/cfg.rs
@@ -112,7 +112,7 @@ pub(super) fn parse_cfg_name_directive<'a>(
             (config.target == "wasm32-unknown-unknown").then_some("emscripten"),
         ],
         allowed_names: &target_cfgs.all_oses,
-        message: "when the operative system is {name}"
+        message: "when the operating system is {name}"
     }
     condition! {
         name: &target_cfg.env,
@@ -122,7 +122,7 @@ pub(super) fn parse_cfg_name_directive<'a>(
     condition! {
         name: &target_cfg.os_and_env(),
         allowed_names: &target_cfgs.all_oses_and_envs,
-        message: "when the operative system and target environment are {name}"
+        message: "when the operating system and target environment are {name}"
     }
     condition! {
         name: &target_cfg.abi,
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index fc48d015990..1a765477fe5 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -1119,7 +1119,7 @@ fn check_overlapping_tests(found_paths: &BTreeSet<PathBuf>) {
     for path in found_paths {
         for ancestor in path.ancestors().skip(1) {
             if found_paths.contains(ancestor) {
-                collisions.push((path, ancestor.clone()));
+                collisions.push((path, ancestor));
             }
         }
     }
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index ba068995d44..45582ddcbaf 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2330,7 +2330,14 @@ impl<'test> TestCx<'test> {
                 // Hide line numbers to reduce churn
                 rustc.arg("-Zui-testing");
                 rustc.arg("-Zdeduplicate-diagnostics=no");
-                rustc.arg("-Zwrite-long-types-to-disk=no");
+                // #[cfg(not(bootstrap)] unconditionally pass flag after beta bump
+                // since `ui-fulldeps --stage=1` builds using the stage 0 compiler,
+                // which doesn't have this flag.
+                if !(self.config.stage_id.starts_with("stage1-")
+                    && self.config.suite == "ui-fulldeps")
+                {
+                    rustc.arg("-Zwrite-long-types-to-disk=no");
+                }
                 // FIXME: use this for other modes too, for perf?
                 rustc.arg("-Cstrip=debuginfo");
             }
diff --git a/src/tools/miri/.github/workflows/ci.yml b/src/tools/miri/.github/workflows/ci.yml
index 452677d9146..042bb9bbd2c 100644
--- a/src/tools/miri/.github/workflows/ci.yml
+++ b/src/tools/miri/.github/workflows/ci.yml
@@ -10,10 +10,7 @@ on:
     branches:
       - 'master'
   schedule:
-    - cron: '6 6 * * *' # At 6:06 UTC every day.
-
-env:
-  CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
+    - cron: '11 5 * * *' # At 5:11 UTC every day.
 
 defaults:
   run:
@@ -21,10 +18,6 @@ defaults:
 
 jobs:
   build:
-    runs-on: ${{ matrix.os }}
-    env:
-      RUST_BACKTRACE: 1
-      HOST_TARGET: ${{ matrix.host_target }}
     strategy:
       fail-fast: false
       matrix:
@@ -35,6 +28,10 @@ jobs:
             host_target: x86_64-apple-darwin
           - os: windows-latest
             host_target: i686-pc-windows-msvc
+    runs-on: ${{ matrix.os }}
+    env:
+      RUST_BACKTRACE: 1
+      HOST_TARGET: ${{ matrix.host_target }}
     steps:
       - uses: actions/checkout@v3
 
diff --git a/src/tools/miri/README.md b/src/tools/miri/README.md
index eaf58340d7b..89d4b29ebb8 100644
--- a/src/tools/miri/README.md
+++ b/src/tools/miri/README.md
@@ -482,7 +482,7 @@ Moreover, Miri recognizes some environment variables:
   purpose.
 * `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
   sysroot is built without libstd. This allows testing and running no_std programs.
-* `MIRI_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
+* `RUSTC_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
   `stderr` and `stdout` files instead of checking whether the output matches.
 * `MIRI_SKIP_UI_CHECKS` (recognized by the test suite): don't check whether the
   `stderr` or `stdout` files match the actual output.
diff --git a/src/tools/miri/miri b/src/tools/miri/miri
index 1bc4e254ad4..bccf6d835ff 100755
--- a/src/tools/miri/miri
+++ b/src/tools/miri/miri
@@ -303,7 +303,7 @@ test|bless)
     $CARGO build $CARGO_EXTRA_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml
     find_sysroot
     if [ "$COMMAND" = "bless" ]; then
-        export MIRI_BLESS="Gesundheit"
+        export RUSTC_BLESS="Gesundheit"
     fi
     # Then test, and let caller control flags.
     # Only in root project as `cargo-miri` has no tests.
diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version
index 4958c377215..1d5dd4d3f63 100644
--- a/src/tools/miri/rust-version
+++ b/src/tools/miri/rust-version
@@ -1 +1 @@
-cec34a43b1b14f4e39363f3b283d7ac4f593ee81
+d150dbb067e66f351a0b33a54e7d4b464ef51e47
diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs
index 3b2d6f9608e..7723f06f296 100644
--- a/src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs
+++ b/src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs
@@ -227,10 +227,10 @@ pub(super) enum TransitionError {
     ChildAccessForbidden(Permission),
     /// A protector was triggered due to an invalid transition that loses
     /// too much permissions.
-    /// For example, if a protected tag goes from `Active` to `Frozen` due
-    /// to a foreign write this will produce a `ProtectedTransition(PermTransition(Active, Frozen))`.
+    /// For example, if a protected tag goes from `Active` to `Disabled` due
+    /// to a foreign write this will produce a `ProtectedDisabled(Active)`.
     /// This kind of error can only occur on foreign accesses.
-    ProtectedTransition(PermTransition),
+    ProtectedDisabled(Permission),
     /// Cannot deallocate because some tag in the allocation is strongly protected.
     /// This kind of error can only occur on deallocations.
     ProtectedDealloc,
@@ -302,7 +302,7 @@ impl TbError<'_> {
                 ));
                 (title, details, conflicting_tag_name)
             }
-            ProtectedTransition(transition) => {
+            ProtectedDisabled(before_disabled) => {
                 let conflicting_tag_name = "protected";
                 let access = cause.print_as_access(/* is_foreign */ true);
                 let details = vec![
@@ -310,12 +310,9 @@ impl TbError<'_> {
                         "the accessed tag {accessed} is foreign to the {conflicting_tag_name} tag {conflicting} (i.e., it is not a child)"
                     ),
                     format!(
-                        "this {access} would cause the {conflicting_tag_name} tag {conflicting} to transition {transition}"
-                    ),
-                    format!(
-                        "this transition would be {loss}, which is not allowed for protected tags",
-                        loss = transition.summary(),
+                        "this {access} would cause the {conflicting_tag_name} tag {conflicting} (currently {before_disabled}) to become Disabled"
                     ),
+                    format!("protected tags must never be Disabled"),
                 ];
                 (title, details, conflicting_tag_name)
             }
diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
index 362070f1857..051b209da17 100644
--- a/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
+++ b/src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
@@ -72,7 +72,12 @@ mod transition {
             // accesses, since the data is not being mutated. Hence the `{ .. }`
             res @ Reserved { .. } if !protected => res,
             Reserved { .. } => Frozen, // protected reserved
-            Active => Frozen,
+            Active =>
+                if protected {
+                    Disabled
+                } else {
+                    Frozen
+                },
             non_writeable @ (Frozen | Disabled) => non_writeable,
         })
     }
@@ -189,34 +194,9 @@ impl PermTransition {
         Permission { inner: self.from }
     }
 
-    /// Determines whether a transition that occured is compatible with the presence
-    /// of a Protector. This is not included in the `transition` functions because
-    /// it would distract from the few places where the transition is modified
-    /// because of a protector, but not forbidden.
-    ///
-    /// Note: this is not in charge of checking that there *is* a protector,
-    /// it should be used as
-    /// ```
-    /// let no_protector_error = if is_protected(tag) {
-    ///     transition.is_allowed_by_protector()
-    /// };
-    /// ```
-    pub fn is_allowed_by_protector(&self) -> bool {
-        assert!(self.is_possible());
-        match (self.from, self.to) {
-            _ if self.from == self.to => true,
-            // It is always a protector violation to not be readable anymore
-            (_, Disabled) => false,
-            // In the case of a `Reserved` under a protector, both transitions
-            // `Reserved => Active` and `Reserved => Frozen` can legitimately occur.
-            // The first is standard (Child Write), the second is for Foreign Writes
-            // on protected Reserved where we must ensure that the pointer is not
-            // written to in the future.
-            (Reserved { .. }, Active) | (Reserved { .. }, Frozen) => true,
-            // This pointer should have stayed writeable for the whole function
-            (Active, Frozen) => false,
-            _ => unreachable!("Transition {} should never be possible", self),
-        }
+    /// Determines if this transition would disable the permission.
+    pub fn produces_disabled(self) -> bool {
+        self.to == Disabled
     }
 }
 
@@ -298,14 +278,15 @@ pub mod diagnostics {
         ///
         /// This function assumes that its arguments apply to the same location
         /// and that they were obtained during a normal execution. It will panic otherwise.
-        /// - `err` cannot be a `ProtectedTransition(_)` of a noop transition, as those
-        /// never trigger protectors;
         /// - all transitions involved in `self` and `err` should be increasing
         /// (Reserved < Active < Frozen < Disabled);
         /// - between `self` and `err` the permission should also be increasing,
         /// so all permissions inside `err` should be greater than `self.1`;
         /// - `Active` and `Reserved` cannot cause an error due to insufficient permissions,
         /// so `err` cannot be a `ChildAccessForbidden(_)` of either of them;
+        /// - `err` should not be `ProtectedDisabled(Disabled)`, because the protected
+        /// tag should not have been `Disabled` in the first place (if this occurs it means
+        /// we have unprotected tags that become protected)
         pub(in super::super) fn is_relevant(&self, err: TransitionError) -> bool {
             // NOTE: `super::super` is the visibility of `TransitionError`
             assert!(self.is_possible());
@@ -342,17 +323,16 @@ pub mod diagnostics {
                             unreachable!("permissions between self and err must be increasing"),
                     }
                 }
-                TransitionError::ProtectedTransition(forbidden) => {
-                    assert!(!forbidden.is_noop());
+                TransitionError::ProtectedDisabled(before_disabled) => {
                     // Show how we got to the starting point of the forbidden transition,
                     // but ignore what came before.
                     // This eliminates transitions like `Reserved -> Active`
                     // when the error is a `Frozen -> Disabled`.
-                    match (self.to, forbidden.from, forbidden.to) {
+                    match (self.to, before_disabled.inner) {
                         // We absolutely want to know where it was activated.
-                        (Active, Active, Frozen | Disabled) => true,
+                        (Active, Active) => true,
                         // And knowing where it became Frozen is also important.
-                        (Frozen, Frozen, Disabled) => true,
+                        (Frozen, Frozen) => true,
                         // If the error is a transition `Frozen -> Disabled`, then we don't really
                         // care whether before that was `Reserved -> Active -> Frozen` or
                         // `Reserved -> Frozen` or even `Frozen` directly.
@@ -360,27 +340,22 @@ pub mod diagnostics {
                         // - created as Frozen, then Frozen -> Disabled is forbidden
                         // - created as Reserved, later became Frozen, then Frozen -> Disabled is forbidden
                         // In both cases the `Reserved -> Active` part is inexistant or irrelevant.
-                        (Active, Frozen, Disabled) => false,
+                        (Active, Frozen) => false,
 
-                        // `Reserved -> Frozen` does not trigger protectors.
-                        (_, Reserved { .. }, Frozen) =>
-                            unreachable!("this transition cannot cause an error"),
+                        (_, Disabled) =>
+                            unreachable!(
+                                "permission that results in Disabled should not itself be Disabled in the first place"
+                            ),
                         // No transition has `Reserved` as its `.to` unless it's a noop.
-                        (Reserved { .. }, _, _) => unreachable!("self is a noop transition"),
-                        (_, Disabled, Disabled) | (_, Frozen, Frozen) | (_, Active, Active) =>
-                            unreachable!("err contains a noop transition"),
+                        (Reserved { .. }, _) => unreachable!("self is a noop transition"),
 
                         // Permissions only evolve in the order `Reserved -> Active -> Frozen -> Disabled`,
                         // so permissions found must be increasing in the order
                         // `self.from < self.to <= forbidden.from < forbidden.to`.
-                        (Disabled, Reserved { .. } | Active | Frozen, _)
-                        | (Frozen, Reserved { .. } | Active, _)
-                        | (Active, Reserved { .. }, _) =>
+                        (Disabled, Reserved { .. } | Active | Frozen)
+                        | (Frozen, Reserved { .. } | Active)
+                        | (Active, Reserved { .. }) =>
                             unreachable!("permissions between self and err must be increasing"),
-                        (_, Disabled, Reserved { .. } | Active | Frozen)
-                        | (_, Frozen, Reserved { .. } | Active)
-                        | (_, Active, Reserved { .. }) =>
-                            unreachable!("permissions within err must be increasing"),
                     }
                 }
                 // We don't care because protectors evolve independently from
@@ -406,7 +381,7 @@ mod propagation_optimization_checks {
         pub use super::*;
         impl PermissionPriv {
             /// Enumerate all states
-            pub fn all() -> impl Iterator<Item = PermissionPriv> {
+            pub fn all() -> impl Iterator<Item = Self> {
                 vec![
                     Active,
                     Reserved { ty_is_freeze: true },
@@ -418,9 +393,15 @@ mod propagation_optimization_checks {
             }
         }
 
+        impl Permission {
+            pub fn all() -> impl Iterator<Item = Self> {
+                PermissionPriv::all().map(|inner| Self { inner })
+            }
+        }
+
         impl AccessKind {
             /// Enumerate all AccessKind.
-            pub fn all() -> impl Iterator<Item = AccessKind> {
+            pub fn all() -> impl Iterator<Item = Self> {
                 use AccessKind::*;
                 [Read, Write].into_iter()
             }
@@ -428,7 +409,7 @@ mod propagation_optimization_checks {
 
         impl AccessRelatedness {
             /// Enumerate all relative positions
-            pub fn all() -> impl Iterator<Item = AccessRelatedness> {
+            pub fn all() -> impl Iterator<Item = Self> {
                 use AccessRelatedness::*;
                 [This, StrictChildAccess, AncestorAccess, DistantAccess].into_iter()
             }
diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs
index 9e8b1e11899..355356b743a 100644
--- a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs
+++ b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs
@@ -19,6 +19,7 @@ use rustc_target::abi::Size;
 
 use crate::borrow_tracker::tree_borrows::{
     diagnostics::{self, NodeDebugInfo, TbError, TransitionError},
+    perms::PermTransition,
     unimap::{UniEntry, UniIndex, UniKeyMap, UniValMap},
     Permission,
 };
@@ -28,17 +29,19 @@ use crate::*;
 /// Data for a single *location*.
 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
 pub(super) struct LocationState {
-    /// This pointer's current permission
-    permission: Permission,
-    /// A location is initialized when it is child accessed for the first time,
-    /// and it then stays initialized forever.
-    /// Before initialization we still apply some preemptive transitions on
-    /// `permission` to know what to do in case it ever gets initialized,
-    /// but these can never cause any immediate UB. There can however be UB
-    /// the moment we attempt to initialize (i.e. child-access) because some
-    /// foreign access done between the creation and the initialization is
-    /// incompatible with child accesses.
+    /// A location is initialized when it is child-accessed for the first time (and the initial
+    /// retag initializes the location for the range covered by the type), and it then stays
+    /// initialized forever.
+    /// For initialized locations, "permission" is the current permission. However, for
+    /// uninitialized locations, we still need to track the "future initial permission": this will
+    /// start out to be `default_initial_perm`, but foreign accesses need to be taken into account.
+    /// Crucially however, while transitions to `Disabled` would usually be UB if this location is
+    /// protected, that is *not* the case for uninitialized locations. Instead we just have a latent
+    /// "future initial permission" of `Disabled`, causing UB only if an access is ever actually
+    /// performed.
     initialized: bool,
+    /// This pointer's current permission / future initial permission.
+    permission: Permission,
     /// Strongest foreign access whose effects have already been applied to
     /// this node and all its children since the last child access.
     /// This is `None` if the most recent access is a child access,
@@ -69,6 +72,104 @@ impl LocationState {
     pub fn permission(&self) -> Permission {
         self.permission
     }
+
+    /// Apply the effect of an access to one location, including
+    /// - applying `Permission::perform_access` to the inner `Permission`,
+    /// - emitting protector UB if the location is initialized,
+    /// - updating the initialized status (child accesses produce initialized locations).
+    fn perform_access(
+        &mut self,
+        access_kind: AccessKind,
+        rel_pos: AccessRelatedness,
+        protected: bool,
+    ) -> Result<PermTransition, TransitionError> {
+        let old_perm = self.permission;
+        let transition = Permission::perform_access(access_kind, rel_pos, old_perm, protected)
+            .ok_or(TransitionError::ChildAccessForbidden(old_perm))?;
+        // Why do only initialized locations cause protector errors?
+        // Consider two mutable references `x`, `y` into disjoint parts of
+        // the same allocation. A priori, these may actually both be used to
+        // access the entire allocation, as long as only reads occur. However,
+        // a write to `y` needs to somehow record that `x` can no longer be used
+        // on that location at all. For these uninitialized locations (i.e., locations
+        // that haven't been accessed with `x` yet), we track the "future initial state":
+        // it defaults to whatever the initial state of the tag is,
+        // but the access to `y` moves that "future initial state" of `x` to `Disabled`.
+        // However, usually a `Reserved -> Disabled` transition would be UB due to the protector!
+        // So clearly protectors shouldn't fire for such "future initial state" transitions.
+        //
+        // See the test `two_mut_protected_same_alloc` in `tests/pass/tree_borrows/tree-borrows.rs`
+        // for an example of safe code that would be UB if we forgot to check `self.initialized`.
+        if protected && self.initialized && transition.produces_disabled() {
+            return Err(TransitionError::ProtectedDisabled(old_perm));
+        }
+        self.permission = transition.applied(old_perm).unwrap();
+        self.initialized |= !rel_pos.is_foreign();
+        Ok(transition)
+    }
+
+    // Helper to optimize the tree traversal.
+    // The optimization here consists of observing thanks to the tests
+    // `foreign_read_is_noop_after_write` and `all_transitions_idempotent`,
+    // that there are actually just three possible sequences of events that can occur
+    // in between two child accesses that produce different results.
+    //
+    // Indeed,
+    // - applying any number of foreign read accesses is the same as applying
+    //   exactly one foreign read,
+    // - applying any number of foreign read or write accesses is the same
+    //   as applying exactly one foreign write.
+    // therefore the three sequences of events that can produce different
+    // outcomes are
+    // - an empty sequence (`self.latest_foreign_access = None`)
+    // - a nonempty read-only sequence (`self.latest_foreign_access = Some(Read)`)
+    // - a nonempty sequence with at least one write (`self.latest_foreign_access = Some(Write)`)
+    //
+    // This function not only determines if skipping the propagation right now
+    // is possible, it also updates the internal state to keep track of whether
+    // the propagation can be skipped next time.
+    // It is a performance loss not to call this function when a foreign access occurs.
+    // It is unsound not to call this function when a child access occurs.
+    fn skip_if_known_noop(
+        &mut self,
+        access_kind: AccessKind,
+        rel_pos: AccessRelatedness,
+    ) -> ContinueTraversal {
+        if rel_pos.is_foreign() {
+            let new_access_noop = match (self.latest_foreign_access, access_kind) {
+                // Previously applied transition makes the new one a guaranteed
+                // noop in the two following cases:
+                // (1) justified by `foreign_read_is_noop_after_write`
+                (Some(AccessKind::Write), AccessKind::Read) => true,
+                // (2) justified by `all_transitions_idempotent`
+                (Some(old), new) if old == new => true,
+                // In all other cases there has been a recent enough
+                // child access that the effects of the new foreign access
+                // need to be applied to this subtree.
+                _ => false,
+            };
+            if new_access_noop {
+                // Abort traversal if the new transition is indeed guaranteed
+                // to be noop.
+                // No need to update `self.latest_foreign_access`,
+                // the type of the current streak among nonempty read-only
+                // or nonempty with at least one write has not changed.
+                ContinueTraversal::SkipChildren
+            } else {
+                // Otherwise propagate this time, and also record the
+                // access that just occurred so that we can skip the propagation
+                // next time.
+                self.latest_foreign_access = Some(access_kind);
+                ContinueTraversal::Recurse
+            }
+        } else {
+            // A child access occurred, this breaks the streak of foreign
+            // accesses in a row and the sequence since the previous child access
+            // is now empty.
+            self.latest_foreign_access = None;
+            ContinueTraversal::Recurse
+        }
+    }
 }
 
 /// Tree structure with both parents and children since we want to be
@@ -387,11 +488,15 @@ impl<'tcx> Tree {
         Ok(())
     }
 
-    /// Maps the following propagation procedure to each range:
-    /// - initialize if needed;
-    /// - compute new state after transition;
-    /// - check that there is no protector that would forbid this;
-    /// - record this specific location as accessed.
+    /// Map the per-node and per-location `LocationState::perform_access`
+    /// to each location of `access_range`, on every tag of the allocation.
+    ///
+    /// `LocationState::perform_access` will take care of raising transition
+    /// errors and updating the `initialized` status of each location,
+    /// this traversal adds to that:
+    /// - inserting into the map locations that do not exist yet,
+    /// - trimming the traversal,
+    /// - recording the history.
     pub fn perform_access(
         &mut self,
         access_kind: AccessKind,
@@ -411,55 +516,16 @@ impl<'tcx> Tree {
                         let old_state =
                             perm.or_insert_with(|| LocationState::new(node.default_initial_perm));
 
-                        // Optimize the tree traversal.
-                        // The optimization here consists of observing thanks to the tests
-                        // `foreign_read_is_noop_after_write` and `all_transitions_idempotent`
-                        // that if we apply twice in a row the effects of a foreign access
-                        // we can skip some branches.
-                        // "two foreign accesses in a row" occurs when `perm.latest_foreign_access` is `Some(_)`
-                        // AND the `rel_pos` of the current access corresponds to a foreign access.
-                        if rel_pos.is_foreign() {
-                            let new_access_noop =
-                                match (old_state.latest_foreign_access, access_kind) {
-                                    // Previously applied transition makes the new one a guaranteed
-                                    // noop in the two following cases:
-                                    // (1) justified by `foreign_read_is_noop_after_write`
-                                    (Some(AccessKind::Write), AccessKind::Read) => true,
-                                    // (2) justified by `all_transitions_idempotent`
-                                    (Some(old), new) if old == new => true,
-                                    // In all other cases there has been a recent enough
-                                    // child access that the effects of the new foreign access
-                                    // need to be applied to this subtree.
-                                    _ => false,
-                                };
-                            if new_access_noop {
-                                // Abort traversal if the new transition is indeed guaranteed
-                                // to be noop.
-                                return Ok(ContinueTraversal::SkipChildren);
-                            } else {
-                                // Otherwise propagate this time, and also record the
-                                // access that just occurred so that we can skip the propagation
-                                // next time.
-                                old_state.latest_foreign_access = Some(access_kind);
-                            }
-                        } else {
-                            // A child access occurred, this breaks the streak of "two foreign
-                            // accesses in a row" and we reset this field.
-                            old_state.latest_foreign_access = None;
+                        match old_state.skip_if_known_noop(access_kind, rel_pos) {
+                            ContinueTraversal::SkipChildren =>
+                                return Ok(ContinueTraversal::SkipChildren),
+                            _ => {}
                         }
 
-                        let old_perm = old_state.permission;
                         let protected = global.borrow().protected_tags.contains_key(&node.tag);
                         let transition =
-                            Permission::perform_access(access_kind, rel_pos, old_perm, protected)
-                                .ok_or(TransitionError::ChildAccessForbidden(old_perm))?;
-                        if protected
-                            // Can't trigger Protector on uninitialized locations
-                            && old_state.initialized
-                            && !transition.is_allowed_by_protector()
-                        {
-                            return Err(TransitionError::ProtectedTransition(transition));
-                        }
+                            old_state.perform_access(access_kind, rel_pos, protected)?;
+
                         // Record the event as part of the history
                         if !transition.is_noop() {
                             node.debug_info.history.push(diagnostics::Event {
@@ -470,10 +536,7 @@ impl<'tcx> Tree {
                                 transition_range: perms_range.clone(),
                                 span,
                             });
-                            old_state.permission =
-                                transition.applied(old_state.permission).unwrap();
                         }
-                        old_state.initialized |= !rel_pos.is_foreign();
                         Ok(ContinueTraversal::Recurse)
                     },
                     |args: ErrHandlerArgs<'_, TransitionError>| -> InterpError<'tcx> {
@@ -602,3 +665,57 @@ impl AccessRelatedness {
         }
     }
 }
+
+#[cfg(test)]
+mod commutation_tests {
+    use super::*;
+    impl LocationState {
+        pub fn all_without_access() -> impl Iterator<Item = Self> {
+            Permission::all().flat_map(|permission| {
+                [false, true].into_iter().map(move |initialized| {
+                    Self { permission, initialized, latest_foreign_access: None }
+                })
+            })
+        }
+    }
+
+    #[test]
+    #[rustfmt::skip]
+    // Exhaustive check that for any starting configuration loc,
+    // for any two read accesses r1 and r2, if `loc + r1 + r2` is not UB
+    // and results in `loc'`, then `loc + r2 + r1` is also not UB and results
+    // in the same final state `loc'`.
+    // This lets us justify arbitrary read-read reorderings.
+    fn all_read_accesses_commute() {
+        let kind = AccessKind::Read;
+        // Two of the four combinations of `AccessRelatedness` are trivial,
+        // but we might as well check them all.
+        for rel1 in AccessRelatedness::all() {
+            for rel2 in AccessRelatedness::all() {
+                // Any protector state works, but we can't move reads across function boundaries
+                // so the two read accesses occur under the same protector.
+                for &protected in &[true, false] {
+                    for loc in LocationState::all_without_access() {
+                        // Apply 1 then 2. Failure here means that there is UB in the source
+                        // and we skip the check in the target.
+                        let mut loc12 = loc;
+                        let Ok(_) = loc12.perform_access(kind, rel1, protected) else { continue; };
+                        let Ok(_) = loc12.perform_access(kind, rel2, protected) else { continue; };
+
+                        // If 1 followed by 2 succeeded, then 2 followed by 1 must also succeed...
+                        let mut loc21 = loc;
+                        loc21.perform_access(kind, rel2, protected).unwrap();
+                        loc21.perform_access(kind, rel1, protected).unwrap();
+
+                        // ... and produce the same final result.
+                        assert_eq!(
+                            loc12, loc21,
+                            "Read accesses {:?} followed by {:?} do not commute !",
+                            rel1, rel2
+                        );
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/src/tools/miri/src/mono_hash_map.rs b/src/tools/miri/src/mono_hash_map.rs
index 45057632df9..81b3153517f 100644
--- a/src/tools/miri/src/mono_hash_map.rs
+++ b/src/tools/miri/src/mono_hash_map.rs
@@ -2,7 +2,7 @@
 //! otherwise mutated. We also box items in the map. This means we can safely provide
 //! shared references into existing items in the `FxHashMap`, because they will not be dropped
 //! (from being removed) or moved (because they are boxed).
-//! The API is is completely tailored to what `memory.rs` needs. It is still in
+//! The API is completely tailored to what `memory.rs` needs. It is still in
 //! a separate file to minimize the amount of code that has to care about the unsafety.
 
 use std::borrow::Borrow;
diff --git a/src/tools/miri/src/shims/backtrace.rs b/src/tools/miri/src/shims/backtrace.rs
index e89b2e01a39..9f4bb37a469 100644
--- a/src/tools/miri/src/shims/backtrace.rs
+++ b/src/tools/miri/src/shims/backtrace.rs
@@ -194,14 +194,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 let filename_alloc =
                     this.allocate_str(&filename, MiriMemoryKind::Rust.into(), Mutability::Mut)?;
 
-                this.write_immediate(
-                    name_alloc.to_ref(this),
-                    &this.project_field(&dest, 0)?,
-                )?;
-                this.write_immediate(
-                    filename_alloc.to_ref(this),
-                    &this.project_field(&dest, 1)?,
-                )?;
+                this.write_immediate(name_alloc.to_ref(this), &this.project_field(&dest, 0)?)?;
+                this.write_immediate(filename_alloc.to_ref(this), &this.project_field(&dest, 1)?)?;
             }
             1 => {
                 this.write_scalar(
diff --git a/src/tools/miri/src/shims/foreign_items.rs b/src/tools/miri/src/shims/foreign_items.rs
index c753eadbbad..763fa9235d0 100644
--- a/src/tools/miri/src/shims/foreign_items.rs
+++ b/src/tools/miri/src/shims/foreign_items.rs
@@ -914,16 +914,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 let x = this.read_scalar(x)?.to_f64()?;
                 let exp = this.read_scalar(exp)?.to_i32()?;
 
-                // Saturating cast to i16. Even those are outside the valid exponent range so
-                // `scalbn` below will do its over/underflow handling.
-                let exp = if exp > i32::from(i16::MAX) {
-                    i16::MAX
-                } else if exp < i32::from(i16::MIN) {
-                    i16::MIN
-                } else {
-                    exp.try_into().unwrap()
-                };
-
                 let res = x.scalbn(exp);
                 this.write_scalar(Scalar::from_f64(res), dest)?;
             }
diff --git a/src/tools/miri/src/shims/time.rs b/src/tools/miri/src/shims/time.rs
index 6667c4d751f..935447fd89d 100644
--- a/src/tools/miri/src/shims/time.rs
+++ b/src/tools/miri/src/shims/time.rs
@@ -156,10 +156,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
         let qpc = i64::try_from(duration.as_nanos()).map_err(|_| {
             err_unsup_format!("programs running longer than 2^63 nanoseconds are not supported")
         })?;
-        this.write_scalar(
-            Scalar::from_i64(qpc),
-            &this.deref_operand(lpPerformanceCount_op)?,
-        )?;
+        this.write_scalar(Scalar::from_i64(qpc), &this.deref_operand(lpPerformanceCount_op)?)?;
         Ok(Scalar::from_i32(-1)) // return non-zero on success
     }
 
diff --git a/src/tools/miri/src/shims/unix/macos/foreign_items.rs b/src/tools/miri/src/shims/unix/macos/foreign_items.rs
index 3673ca5aee3..5141b29b683 100644
--- a/src/tools/miri/src/shims/unix/macos/foreign_items.rs
+++ b/src/tools/miri/src/shims/unix/macos/foreign_items.rs
@@ -86,7 +86,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
             "_NSGetEnviron" => {
                 let [] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
                 this.write_pointer(
-                    this.machine.env_vars.environ.as_ref().expect("machine must be initialized").ptr,
+                    this.machine
+                        .env_vars
+                        .environ
+                        .as_ref()
+                        .expect("machine must be initialized")
+                        .ptr,
                     dest,
                 )?;
             }
@@ -139,10 +144,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
                 if written {
                     this.write_null(dest)?;
                 } else {
-                    this.write_scalar(
-                        Scalar::from_u32(size_needed.try_into().unwrap()),
-                        &bufsize,
-                    )?;
+                    this.write_scalar(Scalar::from_u32(size_needed.try_into().unwrap()), &bufsize)?;
                     this.write_int(-1, dest)?;
                 }
             }
diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs
index 428581801d9..0aeb8ae95a7 100644
--- a/src/tools/miri/src/shims/unix/sync.rs
+++ b/src/tools/miri/src/shims/unix/sync.rs
@@ -867,9 +867,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
         cond_get_clock_id(this, cond_op)?;
 
         // This might lead to false positives, see comment in pthread_mutexattr_destroy
-        this.write_uninit(
-            &this.deref_operand_as(cond_op, this.libc_ty_layout("pthread_cond_t"))?,
-        )?;
+        this.write_uninit(&this.deref_operand_as(cond_op, this.libc_ty_layout("pthread_cond_t"))?)?;
         // FIXME: delete interpreter state associated with this condvar.
 
         Ok(0)
diff --git a/src/tools/miri/test-cargo-miri/run-test.py b/src/tools/miri/test-cargo-miri/run-test.py
index f022c51e59f..ca2f69fc8cf 100755
--- a/src/tools/miri/test-cargo-miri/run-test.py
+++ b/src/tools/miri/test-cargo-miri/run-test.py
@@ -8,8 +8,8 @@ and the working directory to contain the cargo-miri-test project.
 import difflib
 import os
 import re
-import sys
 import subprocess
+import sys
 
 CGREEN  = '\33[32m'
 CBOLD   = '\33[1m'
@@ -37,7 +37,8 @@ def normalize_stderr(str):
     return str
 
 def check_output(actual, path, name):
-    if 'MIRI_BLESS' in os.environ:
+    if os.environ.get("RUSTC_BLESS", "0") != "0":
+        # Write the output only if bless is set
         open(path, mode='w').write(actual)
         return True
     expected = open(path).read()
diff --git a/src/tools/miri/tests/compiletest.rs b/src/tools/miri/tests/compiletest.rs
index 59143550253..fa17923446f 100644
--- a/src/tools/miri/tests/compiletest.rs
+++ b/src/tools/miri/tests/compiletest.rs
@@ -72,13 +72,14 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
         program.args.push(flag);
     }
 
+    let bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v !="0");
     let skip_ui_checks = env::var_os("MIRI_SKIP_UI_CHECKS").is_some();
 
-    let output_conflict_handling = match (env::var_os("MIRI_BLESS").is_some(), skip_ui_checks) {
+    let output_conflict_handling = match (bless, skip_ui_checks) {
         (false, false) => OutputConflictHandling::Error("./miri bless".into()),
         (true, false) => OutputConflictHandling::Bless,
         (false, true) => OutputConflictHandling::Ignore,
-        (true, true) => panic!("cannot use MIRI_BLESS and MIRI_SKIP_UI_CHECKS at the same time"),
+        (true, true) => panic!("cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time"),
     };
 
     let mut config = Config {
@@ -190,6 +191,8 @@ regexes! {
     // erase borrow tags
     "<[0-9]+>"                       => "<TAG>",
     "<[0-9]+="                       => "<TAG=",
+    // normalize width of Tree Borrows diagnostic borders (which otherwise leak borrow tag info)
+    "(─{50})─+"                      => "$1",
     // erase whitespace that differs between platforms
     r" +at (.*\.rs)"                 => " at $1",
     // erase generics in backtraces
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
index 4102c718af8..106e5c19bf2 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
@@ -6,8 +6,8 @@ LL |         ptr::write(dest, src);
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Frozen to Disabled
-   = help: this transition would be a loss of read permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/aliasing_mut4.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
index 1d1ed820324..1ecd6620806 100644
--- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
@@ -6,8 +6,8 @@ LL |     *y
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign read access would cause the protected tag <TAG> to transition from Active to Frozen
-   = help: this transition would be a loss of write permissions, which is not allowed for protected tags
+   = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/box_noalias_violation.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
index 7308d045d19..64e08f545e3 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { *y = 2 };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Active to Disabled
-   = help: this transition would be a loss of read and write permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/illegal_write6.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
index ee64a66cc21..66f7f1788e4 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { *x = 0 };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Frozen to Disabled
-   = help: this transition would be a loss of read permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/invalidate_against_protector2.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
index e217170afb9..ef807d7362e 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { *x = 0 };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Frozen to Disabled
-   = help: this transition would be a loss of read permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/invalidate_against_protector3.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
index 00b2708a651..f26fc6cbaae 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> to transition from Frozen to Disabled
-   = help: this transition would be a loss of read permissions, which is not allowed for protected tags
+   = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Frozen) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/newtype_pair_retagging.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
index aed2e7abebc..687c72d574d 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> to transition from Frozen to Disabled
-   = help: this transition would be a loss of read permissions, which is not allowed for protected tags
+   = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Frozen) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/newtype_retagging.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.rs b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.rs
index 1edd7748cde..0c7f4b89711 100644
--- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.rs
+++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.rs
@@ -1,7 +1,7 @@
 //@revisions: stack tree
 //@[tree]compile-flags: -Zmiri-tree-borrows
 
-#![allow(cast_ref_to_mut)]
+#![allow(invalid_reference_casting)]
 
 fn foo(x: &mut i32) -> i32 {
     *x = 5;
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
index 35c02cc2ebd..8393b80f25b 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { ptr.write(S(0)) };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Active to Disabled
-   = help: this transition would be a loss of read and write permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/arg_inplace_mutate.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
index cbd76c38f62..5af4856bbe3 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { ptr.read() };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign read access would cause the protected tag <TAG> to transition from Active to Frozen
-   = help: this transition would be a loss of write permissions, which is not allowed for protected tags
+   = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/arg_inplace_observe_during.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr
index c2c9de3f4ee..c491a904a10 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.tree.stderr
@@ -6,8 +6,8 @@ LL |     unsafe { ptr.read() };
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign read access would cause the protected tag <TAG> to transition from Active to Frozen
-   = help: this transition would be a loss of write permissions, which is not allowed for protected tags
+   = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/return_pointer_aliasing.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/modifying_constants.rs b/src/tools/miri/tests/fail/modifying_constants.rs
index 40ba31dad8f..0d1bd7929b5 100644
--- a/src/tools/miri/tests/fail/modifying_constants.rs
+++ b/src/tools/miri/tests/fail/modifying_constants.rs
@@ -1,7 +1,7 @@
 // This should fail even without validation/SB
 //@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
 
-#![allow(cast_ref_to_mut)]
+#![allow(invalid_reference_casting)]
 
 fn main() {
     let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee
diff --git a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
index 0feafb1a71e..8b3bf8414db 100644
--- a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
@@ -6,8 +6,8 @@ LL |     *y.add(3) = 42;
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> to transition from Reserved to Disabled
-   = help: this transition would be a loss of read and write permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (currently Reserved) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/outside-range.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
index 5e910779621..769769d957d 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
@@ -1,4 +1,4 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -7,7 +7,7 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Re*|        │ └─┬──<TAG=caller:x>
 | Re*|        │   └────<TAG=callee:x> Strongly protected
 | Re*|        └────<TAG=y, callee:y, caller:y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 error: Undefined Behavior: write access through <TAG> (y, callee:y, caller:y) is forbidden
   --> $DIR/cell-protected-write.rs:LL:CC
    |
@@ -16,8 +16,8 @@ LL |             *y = 1;
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (y, callee:y, caller:y) is foreign to the protected tag <TAG> (callee:x) (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> (callee:x) to transition from Reserved to Disabled
-   = help: this transition would be a loss of read and write permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/cell-protected-write.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
index e28aac306cd..f7e9fb9e3c3 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
@@ -1,4 +1,4 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -7,7 +7,7 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Res|        │ └─┬──<TAG=caller:x>
 | Res|        │   └────<TAG=callee:x> Strongly protected
 | Res|        └────<TAG=y, callee:y, caller:y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 error: Undefined Behavior: write access through <TAG> (y, callee:y, caller:y) is forbidden
   --> $DIR/int-protected-write.rs:LL:CC
    |
@@ -16,8 +16,8 @@ LL |             *y = 0;
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> (y, callee:y, caller:y) is foreign to the protected tag <TAG> (callee:x) (i.e., it is not a child)
-   = help: this foreign write access would cause the protected tag <TAG> (callee:x) to transition from Reserved to Disabled
-   = help: this transition would be a loss of read and write permissions, which is not allowed for protected tags
+   = help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
+   = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
   --> $DIR/int-protected-write.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/pass/intrinsics.rs b/src/tools/miri/tests/pass/intrinsics.rs
index a6a4a06f860..8c6eeab2219 100644
--- a/src/tools/miri/tests/pass/intrinsics.rs
+++ b/src/tools/miri/tests/pass/intrinsics.rs
@@ -3,7 +3,7 @@
 //! Tests for various intrinsics that do not fit anywhere else.
 
 use std::intrinsics;
-use std::mem::{size_of, size_of_val, size_of_val_raw, discriminant};
+use std::mem::{discriminant, size_of, size_of_val, size_of_val_raw};
 
 struct Bomb;
 
diff --git a/src/tools/miri/tests/pass/tree_borrows/cell-alternate-writes.stderr b/src/tools/miri/tests/pass/tree_borrows/cell-alternate-writes.stderr
index 1eab4685a35..f464e0b4f49 100644
--- a/src/tools/miri/tests/pass/tree_borrows/cell-alternate-writes.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/cell-alternate-writes.stderr
@@ -1,12 +1,12 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Re*|      └────<TAG=data, x, y>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └────<TAG=data, x, y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/end-of-protector.stderr b/src/tools/miri/tests/pass/tree_borrows/end-of-protector.stderr
index c20da1a593f..265f6dfc9c8 100644
--- a/src/tools/miri/tests/pass/tree_borrows/end-of-protector.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/end-of-protector.stderr
@@ -1,11 +1,11 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Res|      └─┬──<TAG=data>
 | Res|        └────<TAG=x>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -13,8 +13,8 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Res|        └─┬──<TAG=x>
 | Res|          └─┬──<TAG=caller:x>
 | Res|            └────<TAG=callee:x> Strongly protected
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -23,8 +23,8 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Res|        │ └─┬──<TAG=caller:x>
 | Res|        │   └────<TAG=callee:x>
 | Res|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -33,4 +33,4 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Dis|        │ └─┬──<TAG=caller:x>
 | Dis|        │   └────<TAG=callee:x>
 | Act|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/formatting.stderr b/src/tools/miri/tests/pass/tree_borrows/formatting.stderr
index effd0d9f961..673dae6210d 100644
--- a/src/tools/miri/tests/pass/tree_borrows/formatting.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/formatting.stderr
@@ -1,4 +1,4 @@
-───────────────────────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1..  2.. 10.. 11..100..101..1000..1001..1024
 | Act| Act| Act| Act| Act| Act|  Act|  Act|  Act|    └─┬──<TAG=root of the allocation>
@@ -7,8 +7,8 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 |----|----|----| Act|----|?Dis| ----| ?Dis| ----|        ├────<TAG=data[10]>
 |----|----|----|----|----| Frz| ----| ?Dis| ----|        ├────<TAG=data[100]>
 |----|----|----|----|----|----| ----|  Act| ----|        └────<TAG=data[1000]>
-───────────────────────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -28,4 +28,4 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Frz|          └─┬──<TAG=xcb>
 | Frz|            ├────<TAG=xcba>
 | Frz|            └────<TAG=xcbb>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/reborrow-is-read.stderr b/src/tools/miri/tests/pass/tree_borrows/reborrow-is-read.stderr
index 8c4323b2f7f..b23d78a7156 100644
--- a/src/tools/miri/tests/pass/tree_borrows/reborrow-is-read.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/reborrow-is-read.stderr
@@ -1,15 +1,15 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=parent>
 | Act|        └────<TAG=x>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=parent>
 | Frz|        ├────<TAG=x>
 | Res|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/reserved.stderr b/src/tools/miri/tests/pass/tree_borrows/reserved.stderr
index afb91700222..691fe8b7744 100644
--- a/src/tools/miri/tests/pass/tree_borrows/reserved.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/reserved.stderr
@@ -1,5 +1,5 @@
 [interior mut + protected] Foreign Read: Re* -> Frz
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -8,27 +8,27 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Re*|        │ └─┬──<TAG=caller:x>
 | Frz|        │   └────<TAG=callee:x>
 | Re*|        └────<TAG=y, caller:y, callee:y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 [interior mut] Foreign Read: Re* -> Re*
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  8
 | Act|    └─┬──<TAG=root of the allocation>
 | Re*|      └─┬──<TAG=base>
 | Re*|        ├────<TAG=x>
 | Re*|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 [interior mut] Foreign Write: Re* -> Re*
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  8
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Re*|        ├────<TAG=x>
 | Act|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 [protected] Foreign Read: Res -> Frz
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
@@ -37,22 +37,22 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Res|        │ └─┬──<TAG=caller:x>
 | Frz|        │   └────<TAG=callee:x>
 | Res|        └────<TAG=y, caller:y, callee:y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 [] Foreign Read: Res -> Res
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Res|      └─┬──<TAG=base>
 | Res|        ├────<TAG=x>
 | Res|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 [] Foreign Write: Res -> Dis
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Dis|        ├────<TAG=x>
 | Act|        └────<TAG=y>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/tree-borrows.rs b/src/tools/miri/tests/pass/tree_borrows/tree-borrows.rs
index 6bdad695965..0d50d54faf6 100644
--- a/src/tools/miri/tests/pass/tree_borrows/tree-borrows.rs
+++ b/src/tools/miri/tests/pass/tree_borrows/tree-borrows.rs
@@ -9,6 +9,7 @@ use std::ptr;
 fn main() {
     aliasing_read_only_mutable_refs();
     string_as_mut_ptr();
+    two_mut_protected_same_alloc();
 
     // Stacked Borrows tests
     read_does_not_invalidate1();
@@ -62,6 +63,23 @@ pub fn string_as_mut_ptr() {
     }
 }
 
+// This function checks that there is no issue with having two mutable references
+// from the same allocation both under a protector.
+// This is safe code, it must absolutely not be UB.
+// This test failing is a symptom of forgetting to check that only initialized
+// locations can cause protector UB.
+fn two_mut_protected_same_alloc() {
+    fn write_second(_x: &mut u8, y: &mut u8) {
+        // write through `y` will make some locations of `x` (protected)
+        // become Disabled. Those locations are outside of the range on which
+        // `x` is initialized, and the protector must not trigger.
+        *y = 1;
+    }
+
+    let mut data = (0u8, 1u8);
+    write_second(&mut data.0, &mut data.1);
+}
+
 // ----- The tests below were taken from Stacked Borrows ----
 
 // Make sure that reading from an `&mut` does, like reborrowing to `&`,
diff --git a/src/tools/miri/tests/pass/tree_borrows/unique.default.stderr b/src/tools/miri/tests/pass/tree_borrows/unique.default.stderr
index 11e05d50f2c..f870d3bdec0 100644
--- a/src/tools/miri/tests/pass/tree_borrows/unique.default.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/unique.default.stderr
@@ -1,21 +1,21 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Res|      └─┬──<TAG=base>
 | Res|        └────<TAG=raw, uniq, uniq>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Act|        └────<TAG=raw, uniq, uniq>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Act|        └────<TAG=raw, uniq, uniq>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/unique.uniq.stderr b/src/tools/miri/tests/pass/tree_borrows/unique.uniq.stderr
index 5008b66741a..9ab6b879aa7 100644
--- a/src/tools/miri/tests/pass/tree_borrows/unique.uniq.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/unique.uniq.stderr
@@ -1,24 +1,24 @@
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Res|      └─┬──<TAG=base>
 | Res|        └─┬──<TAG=raw>
 |----|          └────<TAG=uniq, uniq>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Act|        └─┬──<TAG=raw>
 | Act|          └────<TAG=uniq, uniq>
-──────────────────────────────────────────────────────────────────────
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  1
 | Act|    └─┬──<TAG=root of the allocation>
 | Act|      └─┬──<TAG=base>
 | Act|        └─┬──<TAG=raw>
 | Dis|          └────<TAG=uniq, uniq>
-──────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/vec_unique.default.stderr b/src/tools/miri/tests/pass/tree_borrows/vec_unique.default.stderr
index f1af1ea3d8b..a7712ae91fb 100644
--- a/src/tools/miri/tests/pass/tree_borrows/vec_unique.default.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/vec_unique.default.stderr
@@ -1,6 +1,6 @@
-─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  2
 | Act|    └─┬──<TAG=root of the allocation>
 | Res|      └────<TAG=base.as_ptr(), base.as_ptr(), raw_parts.0, reconstructed.as_ptr(), reconstructed.as_ptr()>
-─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr b/src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr
index 00ff1ee00eb..e9f1cb3b1ed 100644
--- a/src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr
+++ b/src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr
@@ -1,8 +1,8 @@
-──────────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
 Warning: this tree is indicative only. Some tags may have been hidden.
 0..  2
 | Act|    └─┬──<TAG=root of the allocation>
 |----|      └─┬──<TAG=base.as_ptr(), base.as_ptr()>
 |----|        └─┬──<TAG=raw_parts.0>
 |----|          └────<TAG=reconstructed.as_ptr(), reconstructed.as_ptr()>
-──────────────────────────────────────────────────────────────────────────
+──────────────────────────────────────────────────
diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml
index 5a1794d3336..3f7dba81c3a 100644
--- a/src/tools/opt-dist/Cargo.toml
+++ b/src/tools/opt-dist/Cargo.toml
@@ -20,3 +20,4 @@ xz = "0.1"
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
 glob = "0.3"
+tempfile = "3.5"
diff --git a/src/tools/opt-dist/src/bolt.rs b/src/tools/opt-dist/src/bolt.rs
new file mode 100644
index 00000000000..e44b8a4db92
--- /dev/null
+++ b/src/tools/opt-dist/src/bolt.rs
@@ -0,0 +1,98 @@
+use anyhow::Context;
+
+use crate::exec::cmd;
+use crate::training::LlvmBoltProfile;
+use camino::{Utf8Path, Utf8PathBuf};
+
+use crate::utils::io::copy_file;
+
+/// Instruments an artifact at the given `path` (in-place) with BOLT and then calls `func`.
+/// After this function finishes, the original file will be restored.
+pub fn with_bolt_instrumented<F: FnOnce() -> anyhow::Result<R>, R>(
+    path: &Utf8Path,
+    func: F,
+) -> anyhow::Result<R> {
+    // Back up the original file.
+    // It will be restored to its original state when this function exits.
+    // By copying it, we break any existing hard links, so that they are not affected by the
+    // instrumentation.
+    let _backup_file = BackedUpFile::new(path)?;
+
+    let instrumented_path = tempfile::NamedTempFile::new()?.into_temp_path();
+
+    // Instrument the original file with BOLT, saving the result into `instrumented_path`
+    cmd(&["llvm-bolt"])
+        .arg("-instrument")
+        .arg(path)
+        // Make sure that each process will write its profiles into a separate file
+        .arg("--instrumentation-file-append-pid")
+        .arg("-o")
+        .arg(instrumented_path.display())
+        .run()
+        .with_context(|| anyhow::anyhow!("Could not instrument {path} using BOLT"))?;
+
+    // Copy the instrumented artifact over the original one
+    copy_file(&instrumented_path, path)?;
+
+    // Run the function that will make use of the instrumented artifact.
+    // The original file will be restored when `_backup_file` is dropped.
+    func()
+}
+
+/// Optimizes the file at `path` with BOLT in-place using the given `profile`.
+pub fn bolt_optimize(path: &Utf8Path, profile: &LlvmBoltProfile) -> anyhow::Result<()> {
+    // Copy the artifact to a new location, so that we do not use the same input and output file.
+    // BOLT cannot handle optimizing when the input and output is the same file, because it performs
+    // in-place patching.
+    let temp_path = tempfile::NamedTempFile::new()?.into_temp_path();
+    copy_file(path, &temp_path)?;
+
+    cmd(&["llvm-bolt"])
+        .arg(temp_path.display())
+        .arg("-data")
+        .arg(&profile.0)
+        .arg("-o")
+        .arg(path)
+        // Reorder basic blocks within functions
+        .arg("-reorder-blocks=ext-tsp")
+        // Reorder functions within the binary
+        .arg("-reorder-functions=hfsort+")
+        // Split function code into hot and code regions
+        .arg("-split-functions")
+        // Split as many basic blocks as possible
+        .arg("-split-all-cold")
+        // Move jump tables to a separate section
+        .arg("-jump-tables=move")
+        // Fold functions with identical code
+        .arg("-icf=1")
+        // Try to reuse old text segments to reduce binary size
+        .arg("--use-old-text")
+        // Update DWARF debug info in the final binary
+        .arg("-update-debug-sections")
+        // Print optimization statistics
+        .arg("-dyno-stats")
+        .run()
+        .with_context(|| anyhow::anyhow!("Could not optimize {path} with BOLT"))?;
+
+    Ok(())
+}
+
+/// Copies a file to a temporary location and restores it (copies it back) when it is dropped.
+pub struct BackedUpFile {
+    original: Utf8PathBuf,
+    backup: tempfile::TempPath,
+}
+
+impl BackedUpFile {
+    pub fn new(file: &Utf8Path) -> anyhow::Result<Self> {
+        let temp_path = tempfile::NamedTempFile::new()?.into_temp_path();
+        copy_file(file, &temp_path)?;
+        Ok(Self { backup: temp_path, original: file.to_path_buf() })
+    }
+}
+
+impl Drop for BackedUpFile {
+    fn drop(&mut self) {
+        copy_file(&self.backup, &self.original).expect("Cannot restore backed up file");
+    }
+}
diff --git a/src/tools/opt-dist/src/environment/linux.rs b/src/tools/opt-dist/src/environment/linux.rs
index d4c55c46f7c..c2a328b1dbc 100644
--- a/src/tools/opt-dist/src/environment/linux.rs
+++ b/src/tools/opt-dist/src/environment/linux.rs
@@ -41,6 +41,10 @@ impl Environment for LinuxEnvironment {
         true
     }
 
+    fn supports_shared_llvm(&self) -> bool {
+        true
+    }
+
     fn executable_extension(&self) -> &'static str {
         ""
     }
diff --git a/src/tools/opt-dist/src/environment/mod.rs b/src/tools/opt-dist/src/environment/mod.rs
index f66b9ab41ea..d28983d289c 100644
--- a/src/tools/opt-dist/src/environment/mod.rs
+++ b/src/tools/opt-dist/src/environment/mod.rs
@@ -60,6 +60,8 @@ pub trait Environment {
 
     fn supports_bolt(&self) -> bool;
 
+    fn supports_shared_llvm(&self) -> bool;
+
     /// What is the extension of binary executables in this environment?
     fn executable_extension(&self) -> &'static str;
 
diff --git a/src/tools/opt-dist/src/environment/windows.rs b/src/tools/opt-dist/src/environment/windows.rs
index 36f4c0f29cc..12a63cbb03c 100644
--- a/src/tools/opt-dist/src/environment/windows.rs
+++ b/src/tools/opt-dist/src/environment/windows.rs
@@ -65,6 +65,10 @@ impl Environment for WindowsEnvironment {
         false
     }
 
+    fn supports_shared_llvm(&self) -> bool {
+        false
+    }
+
     fn executable_extension(&self) -> &'static str {
         ".exe"
     }
diff --git a/src/tools/opt-dist/src/exec.rs b/src/tools/opt-dist/src/exec.rs
index d05ddbd4c0e..4765dceb5dd 100644
--- a/src/tools/opt-dist/src/exec.rs
+++ b/src/tools/opt-dist/src/exec.rs
@@ -16,7 +16,7 @@ pub struct CmdBuilder {
 }
 
 impl CmdBuilder {
-    pub fn arg(mut self, arg: &str) -> Self {
+    pub fn arg<S: ToString>(mut self, arg: S) -> Self {
         self.args.push(arg.to_string());
         self
     }
@@ -139,18 +139,28 @@ impl Bootstrap {
         self
     }
 
+    pub fn without_llvm_lto(mut self) -> Self {
+        self.cmd = self
+            .cmd
+            .arg("--set")
+            .arg("llvm.thin-lto=false")
+            .arg("--set")
+            .arg("llvm.link-shared=true");
+        self
+    }
+
     pub fn rustc_pgo_optimize(mut self, profile: &RustcPGOProfile) -> Self {
         self.cmd = self.cmd.arg("--rust-profile-use").arg(profile.0.as_str());
         self
     }
 
-    pub fn llvm_bolt_instrument(mut self) -> Self {
-        self.cmd = self.cmd.arg("--llvm-bolt-profile-generate");
+    pub fn with_llvm_bolt_ldflags(mut self) -> Self {
+        self.cmd = self.cmd.arg("--set").arg("llvm.ldflags=-Wl,-q");
         self
     }
 
-    pub fn llvm_bolt_optimize(mut self, profile: &LlvmBoltProfile) -> Self {
-        self.cmd = self.cmd.arg("--llvm-bolt-profile-use").arg(profile.0.as_str());
+    pub fn with_bolt_profile(mut self, profile: LlvmBoltProfile) -> Self {
+        self.cmd = self.cmd.arg("--reproducible-artifact").arg(profile.0.as_str());
         self
     }
 
diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs
index 6fc3c3b64a8..f6edd008845 100644
--- a/src/tools/opt-dist/src/main.rs
+++ b/src/tools/opt-dist/src/main.rs
@@ -1,5 +1,7 @@
+use crate::bolt::{bolt_optimize, with_bolt_instrumented};
 use anyhow::Context;
 use log::LevelFilter;
+use utils::io;
 
 use crate::environment::{create_environment, Environment};
 use crate::exec::Bootstrap;
@@ -12,6 +14,7 @@ use crate::utils::{
     with_log_group,
 };
 
+mod bolt;
 mod environment;
 mod exec;
 mod metrics;
@@ -40,7 +43,17 @@ fn execute_pipeline(
         let rustc_profile_dir_root = env.opt_artifacts().join("rustc-pgo");
 
         stage.section("Build PGO instrumented rustc and LLVM", |section| {
-            Bootstrap::build(env).rustc_pgo_instrument(&rustc_profile_dir_root).run(section)
+            let mut builder = Bootstrap::build(env).rustc_pgo_instrument(&rustc_profile_dir_root);
+
+            if env.supports_shared_llvm() {
+                // This first LLVM that we build will be thrown away after this stage, and it
+                // doesn't really need LTO. Without LTO, it builds in ~1 minute thanks to sccache,
+                // with LTO it takes almost 10 minutes. It makes the followup Rustc PGO
+                // instrumented/optimized build a bit slower, but it seems to be worth it.
+                builder = builder.without_llvm_lto();
+            }
+
+            builder.run(section)
         })?;
 
         let profile = stage
@@ -89,19 +102,35 @@ fn execute_pipeline(
         // BOLT instrumentation is performed "on-the-fly" when the LLVM library is copied to the sysroot of rustc,
         // therefore the LLVM artifacts on disk are not "tainted" with BOLT instrumentation and they can be reused.
         timer.section("Stage 3 (LLVM BOLT)", |stage| {
-            stage.section("Build BOLT instrumented LLVM", |stage| {
+            stage.section("Build PGO optimized LLVM", |stage| {
                 Bootstrap::build(env)
-                    .llvm_bolt_instrument()
+                    .with_llvm_bolt_ldflags()
                     .llvm_pgo_optimize(&llvm_pgo_profile)
                     .avoid_rustc_rebuild()
                     .run(stage)
             })?;
 
-            let profile = stage.section("Gather profiles", |_| gather_llvm_bolt_profiles(env))?;
+            // Find the path to the `libLLVM.so` file
+            let llvm_lib = io::find_file_in_dir(
+                &env.build_artifacts().join("stage2").join("lib"),
+                "libLLVM",
+                ".so",
+            )?;
+
+            // Instrument it and gather profiles
+            let profile = with_bolt_instrumented(&llvm_lib, || {
+                stage.section("Gather profiles", |_| gather_llvm_bolt_profiles(env))
+            })?;
             print_free_disk_space()?;
 
-            // LLVM is not being cleared here, we want to reuse the previous PGO-optimized build
+            // Now optimize the library with BOLT. The `libLLVM-XXX.so` library is actually hard-linked
+            // from several places, and this specific path (`llvm_lib`) will *not* be packaged into
+            // the final dist build. However, when BOLT optimizes an artifact, it does so *in-place*,
+            // therefore it will actually optimize all the hard links, which means that the final
+            // packaged `libLLVM.so` file *will* be BOLT optimized.
+            bolt_optimize(&llvm_lib, &profile).context("Could not optimize LLVM with BOLT")?;
 
+            // LLVM is not being cleared here, we want to use the BOLT-optimized LLVM
             Ok(Some(profile))
         })?
     } else {
@@ -114,7 +143,7 @@ fn execute_pipeline(
         .avoid_rustc_rebuild();
 
     if let Some(llvm_bolt_profile) = llvm_bolt_profile {
-        dist = dist.llvm_bolt_optimize(&llvm_bolt_profile);
+        dist = dist.with_bolt_profile(llvm_bolt_profile);
     }
 
     // Final stage: Assemble the dist artifacts
diff --git a/src/tools/opt-dist/src/training.rs b/src/tools/opt-dist/src/training.rs
index 951bc6f9264..a9e88bdbb60 100644
--- a/src/tools/opt-dist/src/training.rs
+++ b/src/tools/opt-dist/src/training.rs
@@ -175,7 +175,7 @@ pub fn gather_llvm_bolt_profiles(env: &dyn Environment) -> anyhow::Result<LlvmBo
             .context("Cannot gather LLVM BOLT profiles")
     })?;
 
-    let merged_profile = env.opt_artifacts().join("bolt.profdata");
+    let merged_profile = env.opt_artifacts().join("llvm-bolt.profdata");
     let profile_root = Utf8PathBuf::from("/tmp/prof.fdata");
     log::info!("Merging LLVM BOLT profiles to {merged_profile}");
 
diff --git a/src/tools/opt-dist/src/utils/io.rs b/src/tools/opt-dist/src/utils/io.rs
index aab078067af..8bd516fa349 100644
--- a/src/tools/opt-dist/src/utils/io.rs
+++ b/src/tools/opt-dist/src/utils/io.rs
@@ -2,6 +2,7 @@ use anyhow::Context;
 use camino::{Utf8Path, Utf8PathBuf};
 use fs_extra::dir::CopyOptions;
 use std::fs::File;
+use std::path::Path;
 
 /// Delete and re-create the directory.
 pub fn reset_directory(path: &Utf8Path) -> anyhow::Result<()> {
@@ -17,6 +18,12 @@ pub fn copy_directory(src: &Utf8Path, dst: &Utf8Path) -> anyhow::Result<()> {
     Ok(())
 }
 
+pub fn copy_file<S: AsRef<Path>, D: AsRef<Path>>(src: S, dst: D) -> anyhow::Result<()> {
+    log::info!("Copying file {} to {}", src.as_ref().display(), dst.as_ref().display());
+    std::fs::copy(src.as_ref(), dst.as_ref())?;
+    Ok(())
+}
+
 #[allow(unused)]
 pub fn move_directory(src: &Utf8Path, dst: &Utf8Path) -> anyhow::Result<()> {
     log::info!("Moving directory {src} to {dst}");
@@ -60,3 +67,22 @@ pub fn get_files_from_dir(
         .map(|p| p.map(|p| Utf8PathBuf::from_path_buf(p).unwrap()))
         .collect::<Result<Vec<_>, _>>()?)
 }
+
+/// Finds a single file in the specified `directory` with the given `prefix` and `suffix`.
+pub fn find_file_in_dir(
+    directory: &Utf8Path,
+    prefix: &str,
+    suffix: &str,
+) -> anyhow::Result<Utf8PathBuf> {
+    let files = glob::glob(&format!("{directory}/{prefix}*{suffix}"))?
+        .into_iter()
+        .collect::<Result<Vec<_>, _>>()?;
+    match files.len() {
+        0 => Err(anyhow::anyhow!("No file with prefix {prefix} found in {directory}")),
+        1 => Ok(Utf8PathBuf::from_path_buf(files[0].clone()).unwrap()),
+        _ => Err(anyhow::anyhow!(
+            "More than one file with prefix {prefix} found in {directory}: {:?}",
+            files
+        )),
+    }
+}
diff --git a/src/tools/rustfmt/src/macros.rs b/src/tools/rustfmt/src/macros.rs
index e9a298a2769..4f45d0c7402 100644
--- a/src/tools/rustfmt/src/macros.rs
+++ b/src/tools/rustfmt/src/macros.rs
@@ -13,7 +13,7 @@ use std::collections::HashMap;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
 use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind};
-use rustc_ast::tokenstream::{TokenStream, TokenTree, TokenTreeCursor};
+use rustc_ast::tokenstream::{RefTokenTreeCursor, TokenStream, TokenTree};
 use rustc_ast::{ast, ptr};
 use rustc_ast_pretty::pprust;
 use rustc_span::{
@@ -394,7 +394,7 @@ pub(crate) fn rewrite_macro_def(
     }
 
     let ts = def.body.tokens.clone();
-    let mut parser = MacroParser::new(ts.into_trees());
+    let mut parser = MacroParser::new(ts.trees());
     let parsed_def = match parser.parse() {
         Some(def) => def,
         None => return snippet,
@@ -736,9 +736,9 @@ impl MacroArgParser {
         self.buf.clear();
     }
 
-    fn add_meta_variable(&mut self, iter: &mut TokenTreeCursor) -> Option<()> {
+    fn add_meta_variable(&mut self, iter: &mut RefTokenTreeCursor<'_>) -> Option<()> {
         match iter.next() {
-            Some(TokenTree::Token(
+            Some(&TokenTree::Token(
                 Token {
                     kind: TokenKind::Ident(name, _),
                     ..
@@ -768,7 +768,7 @@ impl MacroArgParser {
         &mut self,
         inner: Vec<ParsedMacroArg>,
         delim: Delimiter,
-        iter: &mut TokenTreeCursor,
+        iter: &mut RefTokenTreeCursor<'_>,
     ) -> Option<()> {
         let mut buffer = String::new();
         let mut first = true;
@@ -868,11 +868,11 @@ impl MacroArgParser {
 
     /// Returns a collection of parsed macro def's arguments.
     fn parse(mut self, tokens: TokenStream) -> Option<Vec<ParsedMacroArg>> {
-        let mut iter = tokens.into_trees();
+        let mut iter = tokens.trees();
 
         while let Some(tok) = iter.next() {
             match tok {
-                TokenTree::Token(
+                &TokenTree::Token(
                     Token {
                         kind: TokenKind::Dollar,
                         span,
@@ -901,7 +901,7 @@ impl MacroArgParser {
                     self.add_meta_variable(&mut iter)?;
                 }
                 TokenTree::Token(ref t, _) => self.update_buffer(t),
-                TokenTree::Delimited(_delimited_span, delimited, ref tts) => {
+                &TokenTree::Delimited(_delimited_span, delimited, ref tts) => {
                     if !self.buf.is_empty() {
                         if next_space(&self.last_tok.kind) == SpaceState::Always {
                             self.add_separator();
@@ -1119,12 +1119,12 @@ pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> D
 
 // A very simple parser that just parses a macros 2.0 definition into its branches.
 // Currently we do not attempt to parse any further than that.
-struct MacroParser {
-    toks: TokenTreeCursor,
+struct MacroParser<'a> {
+    toks: RefTokenTreeCursor<'a>,
 }
 
-impl MacroParser {
-    const fn new(toks: TokenTreeCursor) -> Self {
+impl<'a> MacroParser<'a> {
+    const fn new(toks: RefTokenTreeCursor<'a>) -> Self {
         Self { toks }
     }
 
@@ -1143,9 +1143,9 @@ impl MacroParser {
         let tok = self.toks.next()?;
         let (lo, args_paren_kind) = match tok {
             TokenTree::Token(..) => return None,
-            TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
+            &TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
         };
-        let args = TokenStream::new(vec![tok]);
+        let args = TokenStream::new(vec![tok.clone()]);
         match self.toks.next()? {
             TokenTree::Token(
                 Token {
diff --git a/src/tools/rustfmt/src/test/mod.rs b/src/tools/rustfmt/src/test/mod.rs
index 364aa225f68..37854ead28b 100644
--- a/src/tools/rustfmt/src/test/mod.rs
+++ b/src/tools/rustfmt/src/test/mod.rs
@@ -838,11 +838,9 @@ fn handle_result(
 
         // Ignore LF and CRLF difference for Windows.
         if !string_eq_ignore_newline_repr(&fmt_text, &text) {
-            if let Some(bless) = std::env::var_os("BLESS") {
-                if bless != "0" {
-                    std::fs::write(file_name, fmt_text).unwrap();
-                    continue;
-                }
+            if std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0") {
+                std::fs::write(file_name, fmt_text).unwrap();
+                continue;
             }
             let diff = make_diff(&text, &fmt_text, DIFF_CONTEXT_SIZE);
             assert!(
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index bfb967213e1..57cbfe68be4 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -46,6 +46,7 @@ const EXCEPTIONS: &[(&str, &str)] = &[
     ("instant", "BSD-3-Clause"),                             // rustc_driver/tracing-subscriber/parking_lot
     ("mdbook", "MPL-2.0"),                                   // mdbook
     ("openssl", "Apache-2.0"),                               // opt-dist
+    ("rustc_apfloat", "Apache-2.0 WITH LLVM-exception"),     // rustc (license is the same as LLVM uses)
     ("ryu", "Apache-2.0 OR BSL-1.0"),                        // cargo/... (because of serde)
     ("self_cell", "Apache-2.0"),                             // rustc (fluent translations)
     ("snap", "BSD-3-Clause"),                                // rustc
@@ -224,6 +225,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
     "rustc-hash",
     "rustc-rayon",
     "rustc-rayon-core",
+    "rustc_apfloat",
     "rustc_version",
     "rustix",
     "ruzstd", // via object in thorin-dwp
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
deleted file mode 100644
index 9f1e8d1b3f3..00000000000
--- a/src/tools/tidy/src/issues.txt
+++ /dev/null
@@ -1,4282 +0,0 @@
-/*
-============================================================
-    ⚠️⚠️⚠️NOTHING SHOULD EVER BE ADDED TO THIS LIST⚠️⚠️⚠️
-============================================================
-*/
-[
-"ui/abi/issues/issue-22565-rust-call.rs",
-"ui/abi/issues/issue-62350-sysv-neg-reg-counts.rs",
-"ui/abi/issues/issue-97463-broken-abi-leaked-uninit-data.rs",
-"ui/abi/issue-28676.rs",
-"ui/abi/issue-94223.rs",
-"ui/argument-suggestions/issue-100154.rs",
-"ui/argument-suggestions/issue-100478.rs",
-"ui/argument-suggestions/issue-101097.rs",
-"ui/argument-suggestions/issue-109831.rs",
-"ui/argument-suggestions/issue-96638.rs",
-"ui/argument-suggestions/issue-97197.rs",
-"ui/argument-suggestions/issue-97484.rs",
-"ui/argument-suggestions/issue-98894.rs",
-"ui/argument-suggestions/issue-98897.rs",
-"ui/argument-suggestions/issue-99482.rs",
-"ui/argument-suggestions/issue-112507.rs",
-"ui/argument-suggestions/issue-109425.rs",
-"ui/array-slice-vec/issue-15730.rs",
-"ui/array-slice-vec/issue-18425.rs",
-"ui/array-slice-vec/issue-69103-extra-binding-subslice.rs",
-"ui/asm/x86_64/issue-82869.rs",
-"ui/asm/x86_64/issue-89875.rs",
-"ui/asm/x86_64/issue-96797.rs",
-"ui/asm/issue-72570.rs",
-"ui/asm/issue-85247.rs",
-"ui/asm/issue-87802.rs",
-"ui/asm/issue-89305.rs",
-"ui/asm/issue-92378.rs",
-"ui/asm/issue-97490.rs",
-"ui/asm/issue-99071.rs",
-"ui/asm/issue-99122-2.rs",
-"ui/asm/issue-99122.rs",
-"ui/associated-consts/issue-102335-const.rs",
-"ui/associated-consts/issue-105330.rs",
-"ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs",
-"ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs",
-"ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs",
-"ui/associated-consts/issue-47814.rs",
-"ui/associated-consts/issue-58022.rs",
-"ui/associated-consts/issue-63496.rs",
-"ui/associated-consts/issue-93775.rs",
-"ui/associated-consts/issue-93835.rs",
-"ui/associated-consts/issue-69020-assoc-const-arith-overflow.rs",
-"ui/associated-consts/issue-88599-ref-self.rs",
-"ui/associated-consts/issue-110933.rs",
-"ui/associated-inherent-types/issue-109299-1.rs",
-"ui/associated-inherent-types/issue-109299.rs",
-"ui/associated-inherent-types/issue-109768.rs",
-"ui/associated-inherent-types/issue-109789.rs",
-"ui/associated-inherent-types/issue-111879-0.rs",
-"ui/associated-inherent-types/issue-111879-1.rs",
-"ui/associated-inherent-types/issue-111404-1.rs",
-"ui/associated-inherent-types/issue-104260.rs",
-"ui/associated-inherent-types/issue-109790.rs",
-"ui/associated-inherent-types/issue-111404-0.rs",
-"ui/associated-inherent-types/issue-109071.rs",
-"ui/associated-item/issue-48027.rs",
-"ui/associated-item/issue-105449.rs",
-"ui/associated-item/issue-87638.rs",
-"ui/associated-type-bounds/issue-102335-ty.rs",
-"ui/associated-type-bounds/issue-104916.rs",
-"ui/associated-type-bounds/issue-71443-1.rs",
-"ui/associated-type-bounds/issue-99828.rs",
-"ui/associated-type-bounds/issue-61752.rs",
-"ui/associated-type-bounds/issue-70292.rs",
-"ui/associated-type-bounds/issue-71443-2.rs",
-"ui/associated-type-bounds/issue-73818.rs",
-"ui/associated-type-bounds/issue-79949.rs",
-"ui/associated-type-bounds/issue-81193.rs",
-"ui/associated-type-bounds/issue-83017.rs",
-"ui/associated-types/issue-18655.rs",
-"ui/associated-types/issue-19883.rs",
-"ui/associated-types/issue-20005.rs",
-"ui/associated-types/issue-20825.rs",
-"ui/associated-types/issue-22037.rs",
-"ui/associated-types/issue-22560.rs",
-"ui/associated-types/issue-22828.rs",
-"ui/associated-types/issue-23208.rs",
-"ui/associated-types/issue-23595-1.rs",
-"ui/associated-types/issue-23595-2.rs",
-"ui/associated-types/issue-25339.rs",
-"ui/associated-types/issue-25700-1.rs",
-"ui/associated-types/issue-25700-2.rs",
-"ui/associated-types/issue-25700.rs",
-"ui/associated-types/issue-26681.rs",
-"ui/associated-types/issue-27675-unchecked-bounds.rs",
-"ui/associated-types/issue-27901.rs",
-"ui/associated-types/issue-38821.rs",
-"ui/associated-types/issue-43784-associated-type.rs",
-"ui/associated-types/issue-43924.rs",
-"ui/associated-types/issue-44153.rs",
-"ui/associated-types/issue-47139-1.rs",
-"ui/associated-types/issue-47139-2.rs",
-"ui/associated-types/issue-47814.rs",
-"ui/associated-types/issue-54108.rs",
-"ui/associated-types/issue-54182-1.rs",
-"ui/associated-types/issue-54467.rs",
-"ui/associated-types/issue-55846.rs",
-"ui/associated-types/issue-59324.rs",
-"ui/associated-types/issue-62200.rs",
-"ui/associated-types/issue-63593.rs",
-"ui/associated-types/issue-64848.rs",
-"ui/associated-types/issue-64855.rs",
-"ui/associated-types/issue-65774-1.rs",
-"ui/associated-types/issue-65774-2.rs",
-"ui/associated-types/issue-72806.rs",
-"ui/associated-types/issue-85103.rs",
-"ui/associated-types/issue-87261.rs",
-"ui/associated-types/issue-19081.rs",
-"ui/associated-types/issue-20825-2.rs",
-"ui/associated-types/issue-21363.rs",
-"ui/associated-types/issue-21726.rs",
-"ui/associated-types/issue-22066.rs",
-"ui/associated-types/issue-24159.rs",
-"ui/associated-types/issue-24204.rs",
-"ui/associated-types/issue-24338.rs",
-"ui/associated-types/issue-28871.rs",
-"ui/associated-types/issue-31597.rs",
-"ui/associated-types/issue-32350.rs",
-"ui/associated-types/issue-36499.rs",
-"ui/associated-types/issue-37808.rs",
-"ui/associated-types/issue-37883.rs",
-"ui/associated-types/issue-38917.rs",
-"ui/associated-types/issue-39532.rs",
-"ui/associated-types/issue-40093.rs",
-"ui/associated-types/issue-41868.rs",
-"ui/associated-types/issue-43475.rs",
-"ui/associated-types/issue-47385.rs",
-"ui/associated-types/issue-48010.rs",
-"ui/associated-types/issue-48551.rs",
-"ui/associated-types/issue-50301.rs",
-"ui/associated-types/issue-54182-2.rs",
-"ui/associated-types/issue-63591.rs",
-"ui/associated-types/issue-64855-2.rs",
-"ui/associated-types/issue-65934.rs",
-"ui/associated-types/issue-67684.rs",
-"ui/associated-types/issue-69398.rs",
-"ui/associated-types/issue-71113.rs",
-"ui/associated-types/issue-76179.rs",
-"ui/associated-types/issue-82079.rs",
-"ui/associated-types/issue-88856.rs",
-"ui/associated-types/issue-91069.rs",
-"ui/associated-types/issue-91231.rs",
-"ui/associated-types/issue-91234.rs",
-"ui/async-await/auxiliary/issue-107036.rs",
-"ui/async-await/auxiliary/issue-72470-lib.rs",
-"ui/async-await/in-trait/issue-102138.rs",
-"ui/async-await/in-trait/issue-102219.rs",
-"ui/async-await/in-trait/issue-102310.rs",
-"ui/async-await/in-trait/issue-104678.rs",
-"ui/async-await/issues/auxiliary/issue-60674.rs",
-"ui/async-await/issues/auxiliary/issue_67893.rs",
-"ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs",
-"ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs",
-"ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs",
-"ui/async-await/issues/issue-102206.rs",
-"ui/async-await/issues/issue-107280.rs",
-"ui/async-await/issues/issue-112225-1.rs",
-"ui/async-await/issues/issue-112225-2.rs",
-"ui/async-await/issues/issue-51719.rs",
-"ui/async-await/issues/issue-51751.rs",
-"ui/async-await/issues/issue-53249.rs",
-"ui/async-await/issues/issue-54752-async-block.rs",
-"ui/async-await/issues/issue-54974.rs",
-"ui/async-await/issues/issue-55324.rs",
-"ui/async-await/issues/issue-55809.rs",
-"ui/async-await/issues/issue-58885.rs",
-"ui/async-await/issues/issue-59001.rs",
-"ui/async-await/issues/issue-59972.rs",
-"ui/async-await/issues/issue-60518.rs",
-"ui/async-await/issues/issue-60655-latebound-regions.rs",
-"ui/async-await/issues/issue-60674.rs",
-"ui/async-await/issues/issue-61187.rs",
-"ui/async-await/issues/issue-61986.rs",
-"ui/async-await/issues/issue-62009-1.rs",
-"ui/async-await/issues/issue-62009-2.rs",
-"ui/async-await/issues/issue-62097.rs",
-"ui/async-await/issues/issue-62517-1.rs",
-"ui/async-await/issues/issue-62517-2.rs",
-"ui/async-await/issues/issue-63388-1.rs",
-"ui/async-await/issues/issue-63388-2.rs",
-"ui/async-await/issues/issue-63388-3.rs",
-"ui/async-await/issues/issue-63388-4.rs",
-"ui/async-await/issues/issue-64391-2.rs",
-"ui/async-await/issues/issue-64433.rs",
-"ui/async-await/issues/issue-64477-2.rs",
-"ui/async-await/issues/issue-64477.rs",
-"ui/async-await/issues/issue-64964.rs",
-"ui/async-await/issues/issue-65159.rs",
-"ui/async-await/issues/issue-65436-raw-ptr-not-send.rs",
-"ui/async-await/issues/issue-66695-static-refs.rs",
-"ui/async-await/issues/issue-66958-non-copy-infered-type-arg.rs",
-"ui/async-await/issues/issue-67611-static-mut-refs.rs",
-"ui/async-await/issues/issue-67893.rs",
-"ui/async-await/issues/issue-69307-nested.rs",
-"ui/async-await/issues/issue-69307.rs",
-"ui/async-await/issues/issue-72312.rs",
-"ui/async-await/issues/issue-78600.rs",
-"ui/async-await/issues/issue-78654.rs",
-"ui/async-await/issues/issue-78938-async-block.rs",
-"ui/async-await/issues/issue-95307.rs",
-"ui/async-await/return-type-notation/issue-110963-early.rs",
-"ui/async-await/return-type-notation/issue-110963-late.rs",
-"ui/async-await/track-caller/issue-105134.rs",
-"ui/async-await/issue-73541-3.rs",
-"ui/async-await/issue-73541.rs",
-"ui/async-await/issue-101715.rs",
-"ui/async-await/issue-105501.rs",
-"ui/async-await/issue-107036.rs",
-"ui/async-await/issue-108572.rs",
-"ui/async-await/issue-54239-private-type-triggers-lint.rs",
-"ui/async-await/issue-60709.rs",
-"ui/async-await/issue-61076.rs",
-"ui/async-await/issue-61452.rs",
-"ui/async-await/issue-61793.rs",
-"ui/async-await/issue-61949-self-return-type.rs",
-"ui/async-await/issue-62658.rs",
-"ui/async-await/issue-63832-await-short-temporary-lifetime-1.rs",
-"ui/async-await/issue-63832-await-short-temporary-lifetime.rs",
-"ui/async-await/issue-64130-1-sync.rs",
-"ui/async-await/issue-64130-2-send.rs",
-"ui/async-await/issue-64130-3-other.rs",
-"ui/async-await/issue-64130-4-async-move.rs",
-"ui/async-await/issue-64130-non-send-future-diags.rs",
-"ui/async-await/issue-64391.rs",
-"ui/async-await/issue-66312.rs",
-"ui/async-await/issue-66387-if-without-else.rs",
-"ui/async-await/issue-67252-unnamed-future.rs",
-"ui/async-await/issue-67651.rs",
-"ui/async-await/issue-67765-async-diagnostic.rs",
-"ui/async-await/issue-68112.rs",
-"ui/async-await/issue-68523-start.rs",
-"ui/async-await/issue-68523.rs",
-"ui/async-await/issue-69446-fnmut-capture.rs",
-"ui/async-await/issue-70594.rs",
-"ui/async-await/issue-70818.rs",
-"ui/async-await/issue-71137.rs",
-"ui/async-await/issue-72442.rs",
-"ui/async-await/issue-72470-llvm-dominate.rs",
-"ui/async-await/issue-72590-type-error-sized.rs",
-"ui/async-await/issue-73050.rs",
-"ui/async-await/issue-73137.rs",
-"ui/async-await/issue-73541-1.rs",
-"ui/async-await/issue-73541-2.rs",
-"ui/async-await/issue-73741-type-err-drop-tracking.rs",
-"ui/async-await/issue-73741-type-err.rs",
-"ui/async-await/issue-74047.rs",
-"ui/async-await/issue-74072-lifetime-name-annotations.rs",
-"ui/async-await/issue-74497-lifetime-in-opaque.rs",
-"ui/async-await/issue-75785-confusing-named-region.rs",
-"ui/async-await/issue-76547.rs",
-"ui/async-await/issue-77993-2.rs",
-"ui/async-await/issue-78115.rs",
-"ui/async-await/issue-84841.rs",
-"ui/async-await/issue-86507.rs",
-"ui/async-await/issue-93197.rs",
-"ui/async-await/issue-93648.rs",
-"ui/async-await/issue-98634.rs",
-"ui/async-await/issue-70935-complex-spans.rs",
-"ui/attributes/issue-100631.rs",
-"ui/attributes/issue-105594-invalid-attr-validation.rs",
-"ui/attributes/issue-90873.rs",
-"ui/attributes/issue-40962.rs",
-"ui/auto-traits/issue-23080.rs",
-"ui/auto-traits/issue-84075.rs",
-"ui/auto-traits/issue-23080-2.rs",
-"ui/auxiliary/issue-13560-1.rs",
-"ui/auxiliary/issue-13560-2.rs",
-"ui/auxiliary/issue-13560-3.rs",
-"ui/auxiliary/issue-16822.rs",
-"ui/auxiliary/issue-18502.rs",
-"ui/auxiliary/issue-24106.rs",
-"ui/auxiliary/issue-76387.rs",
-"ui/bench/issue-32062.rs",
-"ui/binding/issue-53114-borrow-checks.rs",
-"ui/binding/issue-53114-safety-checks.rs",
-"ui/binop/issue-25916.rs",
-"ui/binop/issue-28837.rs",
-"ui/binop/issue-3820.rs",
-"ui/binop/issue-77910-1.rs",
-"ui/binop/issue-77910-2.rs",
-"ui/binop/issue-93927.rs",
-"ui/block-result/issue-11714.rs",
-"ui/block-result/issue-13428.rs",
-"ui/block-result/issue-13624.rs",
-"ui/block-result/issue-20862.rs",
-"ui/block-result/issue-22645.rs",
-"ui/block-result/issue-3563.rs",
-"ui/block-result/issue-5500.rs",
-"ui/borrowck/issue-85765-closure.rs",
-"ui/borrowck/issue-101119.rs",
-"ui/borrowck/issue-102209.rs",
-"ui/borrowck/issue-17545.rs",
-"ui/borrowck/issue-17718-static-move.rs",
-"ui/borrowck/issue-20801.rs",
-"ui/borrowck/issue-23338-params-outlive-temps-of-body.rs",
-"ui/borrowck/issue-24267-flow-exit.rs",
-"ui/borrowck/issue-25793.rs",
-"ui/borrowck/issue-29166.rs",
-"ui/borrowck/issue-31287-drop-in-guard.rs",
-"ui/borrowck/issue-33819.rs",
-"ui/borrowck/issue-41962.rs",
-"ui/borrowck/issue-42344.rs",
-"ui/borrowck/issue-45983.rs",
-"ui/borrowck/issue-46095.rs",
-"ui/borrowck/issue-46471.rs",
-"ui/borrowck/issue-47215-ice-from-drop-elab.rs",
-"ui/borrowck/issue-47646.rs",
-"ui/borrowck/issue-51117.rs",
-"ui/borrowck/issue-51301.rs",
-"ui/borrowck/issue-51348-multi-ref-mut-in-guard.rs",
-"ui/borrowck/issue-52713-bug.rs",
-"ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.rs",
-"ui/borrowck/issue-54499-field-mutation-marks-mut-as-used.rs",
-"ui/borrowck/issue-54499-field-mutation-of-moved-out-with-mut.rs",
-"ui/borrowck/issue-54499-field-mutation-of-moved-out.rs",
-"ui/borrowck/issue-54499-field-mutation-of-never-init.rs",
-"ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs",
-"ui/borrowck/issue-55492-borrowck-migrate-scans-parents.rs",
-"ui/borrowck/issue-58776-borrowck-scans-children.rs",
-"ui/borrowck/issue-62007-assign-box.rs",
-"ui/borrowck/issue-62007-assign-field.rs",
-"ui/borrowck/issue-62107-match-arm-scopes.rs",
-"ui/borrowck/issue-64453.rs",
-"ui/borrowck/issue-69789-iterator-mut-suggestion.rs",
-"ui/borrowck/issue-7573.rs",
-"ui/borrowck/issue-81365-1.rs",
-"ui/borrowck/issue-81365-10.rs",
-"ui/borrowck/issue-81365-11.rs",
-"ui/borrowck/issue-81365-2.rs",
-"ui/borrowck/issue-81365-3.rs",
-"ui/borrowck/issue-81365-4.rs",
-"ui/borrowck/issue-81365-5.rs",
-"ui/borrowck/issue-81365-6.rs",
-"ui/borrowck/issue-81365-7.rs",
-"ui/borrowck/issue-81365-8.rs",
-"ui/borrowck/issue-81365-9.rs",
-"ui/borrowck/issue-81899.rs",
-"ui/borrowck/issue-82032.rs",
-"ui/borrowck/issue-82462.rs",
-"ui/borrowck/issue-83309-ice-immut-in-for-loop.rs",
-"ui/borrowck/issue-83760.rs",
-"ui/borrowck/issue-85581.rs",
-"ui/borrowck/issue-85765.rs",
-"ui/borrowck/issue-87456-point-to-closure.rs",
-"ui/borrowck/issue-88434-minimal-example.rs",
-"ui/borrowck/issue-88434-removal-index-should-be-less.rs",
-"ui/borrowck/issue-91206.rs",
-"ui/borrowck/issue-92015.rs",
-"ui/borrowck/issue-92157.rs",
-"ui/borrowck/issue-93078.rs",
-"ui/borrowck/issue-111554.rs",
-"ui/borrowck/issue-45199.rs",
-"ui/borrowck/issue-103095.rs",
-"ui/borrowck/issue-103250.rs",
-"ui/borrowck/issue-103624.rs",
-"ui/borrowck/issue-104639-lifetime-order.rs",
-"ui/borrowck/issue-10876.rs",
-"ui/borrowck/issue-109271-pass-self-into-closure.rs",
-"ui/borrowck/issue-11493.rs",
-"ui/borrowck/issue-17263.rs",
-"ui/borrowck/issue-28934.rs",
-"ui/borrowck/issue-36082.rs",
-"ui/borrowck/issue-51415.rs",
-"ui/borrowck/issue-52967-edition-2018-needs-two-phase-borrows.rs",
-"ui/borrowck/issue-55552-ascribe-wildcard-to-structured-pattern.rs",
-"ui/borrowck/issue-70919-drop-in-loop.rs",
-"ui/borrowck/issue-71546.rs",
-"ui/borrowck/issue-80772.rs",
-"ui/borrowck/issue-82126-mismatched-subst-and-hir.rs",
-"ui/borrowck/issue-83924.rs",
-"ui/borrowck/issue-93093.rs",
-"ui/borrowck/issue-95079-missing-move-in-nested-closure.rs",
-"ui/box/issue-82446.rs",
-"ui/box/issue-95036.rs",
-"ui/c-variadic/issue-32201.rs",
-"ui/c-variadic/issue-86053-2.rs",
-"ui/c-variadic/issue-86053-1.rs",
-"ui/cast/issue-106883-is-empty.rs",
-"ui/cast/issue-10991.rs",
-"ui/cast/issue-17444.rs",
-"ui/cast/issue-85586.rs",
-"ui/cast/issue-88621.rs",
-"ui/cast/issue-84213.rs",
-"ui/cast/issue-89497.rs",
-"ui/closure-expected-type/issue-24421.rs",
-"ui/closure_context/issue-26046-fn-mut.rs",
-"ui/closure_context/issue-26046-fn-once.rs",
-"ui/closure_context/issue-42065.rs",
-"ui/closures/2229_closure_analysis/match/issue-87097.rs",
-"ui/closures/2229_closure_analysis/match/issue-87426.rs",
-"ui/closures/2229_closure_analysis/match/issue-87988.rs",
-"ui/closures/2229_closure_analysis/match/issue-88331.rs",
-"ui/closures/2229_closure_analysis/migrations/issue-78720.rs",
-"ui/closures/2229_closure_analysis/migrations/issue-86753.rs",
-"ui/closures/2229_closure_analysis/migrations/issue-90024-adt-correct-subst.rs",
-"ui/closures/2229_closure_analysis/run_pass/issue-87378.rs",
-"ui/closures/2229_closure_analysis/run_pass/issue-88372.rs",
-"ui/closures/2229_closure_analysis/run_pass/issue-88431.rs",
-"ui/closures/2229_closure_analysis/run_pass/issue-88476.rs",
-"ui/closures/2229_closure_analysis/issue-87378.rs",
-"ui/closures/2229_closure_analysis/issue-87987.rs",
-"ui/closures/2229_closure_analysis/issue-88118-2.rs",
-"ui/closures/2229_closure_analysis/issue-88476.rs",
-"ui/closures/2229_closure_analysis/issue-89606.rs",
-"ui/closures/2229_closure_analysis/issue-90465.rs",
-"ui/closures/2229_closure_analysis/issue-92724-needsdrop-query-cycle.rs",
-"ui/closures/2229_closure_analysis/issue_88118.rs",
-"ui/closures/issue-10398.rs",
-"ui/closures/issue-109188.rs",
-"ui/closures/issue-42463.rs",
-"ui/closures/issue-52437.rs",
-"ui/closures/issue-67123.rs",
-"ui/closures/issue-6801.rs",
-"ui/closures/issue-78720.rs",
-"ui/closures/issue-80313-mutable-borrow-in-closure.rs",
-"ui/closures/issue-80313-mutable-borrow-in-move-closure.rs",
-"ui/closures/issue-80313-mutation-in-closure.rs",
-"ui/closures/issue-80313-mutation-in-move-closure.rs",
-"ui/closures/issue-81700-mut-borrow.rs",
-"ui/closures/issue-82438-mut-without-upvar.rs",
-"ui/closures/issue-84044-drop-non-mut.rs",
-"ui/closures/issue-84128.rs",
-"ui/closures/issue-868.rs",
-"ui/closures/issue-90871.rs",
-"ui/closures/issue-99565.rs",
-"ui/closures/issue-111932.rs",
-"ui/closures/issue-72408-nested-closures-exponential.rs",
-"ui/closures/issue-101696.rs",
-"ui/closures/issue-102089-multiple-opaque-cast.rs",
-"ui/closures/issue-23012-supertrait-signature-inference.rs",
-"ui/closures/issue-41366.rs",
-"ui/closures/issue-46742.rs",
-"ui/closures/issue-48109.rs",
-"ui/closures/issue-68025.rs",
-"ui/closures/issue-87461.rs",
-"ui/closures/issue-87814-1.rs",
-"ui/closures/issue-87814-2.rs",
-"ui/closures/issue-97607.rs",
-"ui/closures/issue-113087.rs",
-"ui/cmse-nonsecure/cmse-nonsecure-entry/issue-83475.rs",
-"ui/codegen/auxiliary/issue-97708-aux.rs",
-"ui/codegen/issue-101585-128bit-repeat.rs",
-"ui/codegen/issue-16602-1.rs",
-"ui/codegen/issue-16602-2.rs",
-"ui/codegen/issue-16602-3.rs",
-"ui/codegen/issue-55976.rs",
-"ui/codegen/issue-64401.rs",
-"ui/codegen/issue-97708.rs",
-"ui/codegen/issue-99551.rs",
-"ui/codegen/issue-28950.rs",
-"ui/codegen/issue-63787.rs",
-"ui/codegen/issue-82859-slice-miscompile.rs",
-"ui/codegen/issue-88043-bb-does-not-have-terminator.rs",
-"ui/codemap_tests/issue-11715.rs",
-"ui/codemap_tests/issue-28308.rs",
-"ui/coercion/auxiliary/issue-39823.rs",
-"ui/coercion/issue-14589.rs",
-"ui/coercion/issue-39823.rs",
-"ui/coercion/issue-53475.rs",
-"ui/coercion/issue-73886.rs",
-"ui/coercion/issue-3794.rs",
-"ui/coercion/issue-101066.rs",
-"ui/coercion/issue-36007.rs",
-"ui/coercion/issue-37655.rs",
-"ui/coercion/issue-88097.rs",
-"ui/coherence/issue-85026.rs",
-"ui/coherence/issue-99663-2.rs",
-"ui/coherence/issue-99663.rs",
-"ui/command/issue-10626.rs",
-"ui/compare-method/issue-90444.rs",
-"ui/conditional-compilation/issue-34028.rs",
-"ui/confuse-field-and-method/issue-18343.rs",
-"ui/confuse-field-and-method/issue-2392.rs",
-"ui/confuse-field-and-method/issue-32128.rs",
-"ui/confuse-field-and-method/issue-33784.rs",
-"ui/const-generics/generic_arg_infer/issue-91614.rs",
-"ui/const-generics/generic_const_exprs/auxiliary/issue-94287-aux.rs",
-"ui/const-generics/generic_const_exprs/issue-100217.rs",
-"ui/const-generics/generic_const_exprs/issue-102768.rs",
-"ui/const-generics/generic_const_exprs/issue-105257.rs",
-"ui/const-generics/generic_const_exprs/issue-105608.rs",
-"ui/const-generics/generic_const_exprs/issue-69654.rs",
-"ui/const-generics/generic_const_exprs/issue-73298.rs",
-"ui/const-generics/generic_const_exprs/issue-73899.rs",
-"ui/const-generics/generic_const_exprs/issue-74713.rs",
-"ui/const-generics/generic_const_exprs/issue-76595.rs",
-"ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs",
-"ui/const-generics/generic_const_exprs/issue-80742.rs",
-"ui/const-generics/generic_const_exprs/issue-82268.rs",
-"ui/const-generics/generic_const_exprs/issue-83765.rs",
-"ui/const-generics/generic_const_exprs/issue-83972.rs",
-"ui/const-generics/generic_const_exprs/issue-84669.rs",
-"ui/const-generics/generic_const_exprs/issue-85848.rs",
-"ui/const-generics/generic_const_exprs/issue-94287.rs",
-"ui/const-generics/generic_const_exprs/issue-86710.rs",
-"ui/const-generics/generic_const_exprs/issue-100360.rs",
-"ui/const-generics/generic_const_exprs/issue-102074.rs",
-"ui/const-generics/generic_const_exprs/issue-62504.rs",
-"ui/const-generics/generic_const_exprs/issue-72787.rs",
-"ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs",
-"ui/const-generics/generic_const_exprs/issue-74634.rs",
-"ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs",
-"ui/const-generics/generic_const_exprs/issue-84408.rs",
-"ui/const-generics/generic_const_exprs/issue-89851.rs",
-"ui/const-generics/generic_const_exprs/issue-90847.rs",
-"ui/const-generics/generic_const_exprs/issue-94293.rs",
-"ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs",
-"ui/const-generics/generic_const_exprs/issue-97047-ice-2.rs",
-"ui/const-generics/generic_const_exprs/issue-99647.rs",
-"ui/const-generics/generic_const_exprs/issue-99705.rs",
-"ui/const-generics/generic_const_exprs/issue-109141.rs",
-"ui/const-generics/generic_const_exprs/issue-96699.rs",
-"ui/const-generics/infer/issue-77092.rs",
-"ui/const-generics/issues/issue-105037.rs",
-"ui/const-generics/issues/issue-56445-2.rs",
-"ui/const-generics/issues/issue-56445-3.rs",
-"ui/const-generics/issues/issue-61336-1.rs",
-"ui/const-generics/issues/issue-61336-2.rs",
-"ui/const-generics/issues/issue-61336.rs",
-"ui/const-generics/issues/issue-61432.rs",
-"ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs",
-"ui/const-generics/issues/issue-67185-2.rs",
-"ui/const-generics/issues/issue-68104-print-stack-overflow.rs",
-"ui/const-generics/issues/issue-69654-run-pass.rs",
-"ui/const-generics/issues/issue-70125-1.rs",
-"ui/const-generics/issues/issue-70125-2.rs",
-"ui/const-generics/issues/issue-70180-1-stalled_on.rs",
-"ui/const-generics/issues/issue-70180-2-stalled_on.rs",
-"ui/const-generics/issues/issue-71202.rs",
-"ui/const-generics/issues/issue-72845.rs",
-"ui/const-generics/issues/issue-73260.rs",
-"ui/const-generics/issues/issue-76701-ty-param-in-const.rs",
-"ui/const-generics/issues/issue-79674.rs",
-"ui/const-generics/issues/issue-80062.rs",
-"ui/const-generics/issues/issue-80375.rs",
-"ui/const-generics/issues/issue-82956.rs",
-"ui/const-generics/issues/issue-83249.rs",
-"ui/const-generics/issues/issue-83288.rs",
-"ui/const-generics/issues/issue-83466.rs",
-"ui/const-generics/issues/issue-83765.rs",
-"ui/const-generics/issues/issue-84659.rs",
-"ui/const-generics/issues/issue-86530.rs",
-"ui/const-generics/issues/issue-86535-2.rs",
-"ui/const-generics/issues/issue-86535.rs",
-"ui/const-generics/issues/issue-86820.rs",
-"ui/const-generics/issues/issue-87470.rs",
-"ui/const-generics/issues/issue-87493.rs",
-"ui/const-generics/issues/issue-87964.rs",
-"ui/const-generics/issues/issue-88997.rs",
-"ui/const-generics/issues/issue-89146.rs",
-"ui/const-generics/issues/issue-89320.rs",
-"ui/const-generics/issues/issue-89334.rs",
-"ui/const-generics/issues/issue-90318.rs",
-"ui/const-generics/issues/issue-90364.rs",
-"ui/const-generics/issues/issue-90455.rs",
-"ui/const-generics/issues/issue-97634.rs",
-"ui/const-generics/issues/issue-98629.rs",
-"ui/const-generics/issues/issue-100313.rs",
-"ui/const-generics/issues/issue-87076.rs",
-"ui/const-generics/issues/issue-97278.rs",
-"ui/const-generics/issues/issue-99641.rs",
-"ui/const-generics/issues/issue-105821.rs",
-"ui/const-generics/issues/issue-56445-1.rs",
-"ui/const-generics/issues/issue-60818-struct-constructors.rs",
-"ui/const-generics/issues/issue-61422.rs",
-"ui/const-generics/issues/issue-62878.rs",
-"ui/const-generics/issues/issue-63322-forbid-dyn.rs",
-"ui/const-generics/issues/issue-64519.rs",
-"ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs",
-"ui/const-generics/issues/issue-66906.rs",
-"ui/const-generics/issues/issue-67185-1.rs",
-"ui/const-generics/issues/issue-67375.rs",
-"ui/const-generics/issues/issue-67739.rs",
-"ui/const-generics/issues/issue-67945-1.rs",
-"ui/const-generics/issues/issue-67945-2.rs",
-"ui/const-generics/issues/issue-67945-3.rs",
-"ui/const-generics/issues/issue-67945-4.rs",
-"ui/const-generics/issues/issue-68366.rs",
-"ui/const-generics/issues/issue-68596.rs",
-"ui/const-generics/issues/issue-68615-adt.rs",
-"ui/const-generics/issues/issue-68615-array.rs",
-"ui/const-generics/issues/issue-70167.rs",
-"ui/const-generics/issues/issue-70225.rs",
-"ui/const-generics/issues/issue-70273-assoc-fn.rs",
-"ui/const-generics/issues/issue-71169.rs",
-"ui/const-generics/issues/issue-71381.rs",
-"ui/const-generics/issues/issue-71382.rs",
-"ui/const-generics/issues/issue-71547.rs",
-"ui/const-generics/issues/issue-71611.rs",
-"ui/const-generics/issues/issue-71986.rs",
-"ui/const-generics/issues/issue-72352.rs",
-"ui/const-generics/issues/issue-73120.rs",
-"ui/const-generics/issues/issue-73491.rs",
-"ui/const-generics/issues/issue-73727-static-reference-array-const-param.rs",
-"ui/const-generics/issues/issue-74101.rs",
-"ui/const-generics/issues/issue-74255.rs",
-"ui/const-generics/issues/issue-74906.rs",
-"ui/const-generics/issues/issue-74950.rs",
-"ui/const-generics/issues/issue-75047.rs",
-"ui/const-generics/issues/issue-75299.rs",
-"ui/const-generics/issues/issue-85031-2.rs",
-"ui/const-generics/issues/issue-86033.rs",
-"ui/const-generics/issues/issue-88119.rs",
-"ui/const-generics/issues/issue-88468.rs",
-"ui/const-generics/issues/issue-89304.rs",
-"ui/const-generics/issues/issue-92186.rs",
-"ui/const-generics/issues/issue-96654.rs",
-"ui/const-generics/parser-error-recovery/issue-89013-no-assoc.rs",
-"ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs",
-"ui/const-generics/parser-error-recovery/issue-89013-type.rs",
-"ui/const-generics/parser-error-recovery/issue-89013.rs",
-"ui/const-generics/type-dependent/issue-61936.rs",
-"ui/const-generics/type-dependent/issue-63695.rs",
-"ui/const-generics/type-dependent/issue-69816.rs",
-"ui/const-generics/type-dependent/issue-70507.rs",
-"ui/const-generics/type-dependent/issue-71382.rs",
-"ui/const-generics/type-dependent/issue-71805.rs",
-"ui/const-generics/type-dependent/issue-67144-1.rs",
-"ui/const-generics/type-dependent/issue-67144-2.rs",
-"ui/const-generics/type-dependent/issue-70217.rs",
-"ui/const-generics/type-dependent/issue-70586.rs",
-"ui/const-generics/type-dependent/issue-71348.rs",
-"ui/const-generics/type-dependent/issue-73730.rs",
-"ui/const-generics/issue-46511.rs",
-"ui/const-generics/issue-70408.rs",
-"ui/const-generics/issue-93647.rs",
-"ui/const-generics/issue-112505-overflow.rs",
-"ui/const-generics/issue-66451.rs",
-"ui/const-generics/issue-80471.rs",
-"ui/const-generics/issue-102124.rs",
-"ui/const-generics/issue-105689.rs",
-"ui/const-generics/issue-106419-struct-with-multiple-const-params.rs",
-"ui/const-generics/issue-97007.rs",
-"ui/const_prop/issue-102553.rs",
-"ui/const_prop/issue-86351.rs",
-"ui/consts/auxiliary/issue-17718-aux.rs",
-"ui/consts/auxiliary/issue-63226.rs",
-"ui/consts/const-eval/issue-100878.rs",
-"ui/consts/const-eval/issue-104390.rs",
-"ui/consts/const-eval/issue-43197.rs",
-"ui/consts/const-eval/issue-44578.rs",
-"ui/consts/const-eval/issue-49296.rs",
-"ui/consts/const-eval/issue-50814-2.rs",
-"ui/consts/const-eval/issue-50814.rs",
-"ui/consts/const-eval/issue-64908.rs",
-"ui/consts/const-eval/issue-64970.rs",
-"ui/consts/const-eval/issue-65394.rs",
-"ui/consts/const-eval/issue-84957-const-str-as-bytes.rs",
-"ui/consts/const-eval/issue-85155.rs",
-"ui/consts/const-eval/issue-85907.rs",
-"ui/consts/const-eval/issue-91827-extern-types.rs",
-"ui/consts/const-eval/issue-52475.rs",
-"ui/consts/const-eval/issue-70723.rs",
-"ui/consts/const-eval/issue-47971.rs",
-"ui/consts/const-eval/issue-50706.rs",
-"ui/consts/const-eval/issue-51300.rs",
-"ui/consts/const-eval/issue-53157.rs",
-"ui/consts/const-eval/issue-53401.rs",
-"ui/consts/const-eval/issue-55541.rs",
-"ui/consts/const-eval/issue-70804-fn-subtyping.rs",
-"ui/consts/const-extern-fn/issue-68062-const-extern-fns-dont-need-fn-specifier-2.rs",
-"ui/consts/const-extern-fn/issue-68062-const-extern-fns-dont-need-fn-specifier.rs",
-"ui/consts/const-mut-refs/issue-76510.rs",
-"ui/consts/const_in_pattern/issue-44333.rs",
-"ui/consts/const_in_pattern/issue-62614.rs",
-"ui/consts/const_in_pattern/issue-78057.rs",
-"ui/consts/const_in_pattern/issue-53708.rs",
-"ui/consts/const_in_pattern/issue-65466.rs",
-"ui/consts/const_in_pattern/issue-73431.rs",
-"ui/consts/control-flow/issue-46843.rs",
-"ui/consts/control-flow/issue-50577.rs",
-"ui/consts/extra-const-ub/issue-100771.rs",
-"ui/consts/extra-const-ub/issue-101034.rs",
-"ui/consts/issue-102117.rs",
-"ui/consts/issue-103790.rs",
-"ui/consts/issue-104609.rs",
-"ui/consts/issue-104768.rs",
-"ui/consts/issue-13902.rs",
-"ui/consts/issue-17458.rs",
-"ui/consts/issue-17718-borrow-interior.rs",
-"ui/consts/issue-17718-const-bad-values.rs",
-"ui/consts/issue-17718-const-borrow.rs",
-"ui/consts/issue-17718-constants-not-static.rs",
-"ui/consts/issue-17718-references.rs",
-"ui/consts/issue-17718.rs",
-"ui/consts/issue-17756.rs",
-"ui/consts/issue-18294.rs",
-"ui/consts/issue-19244.rs",
-"ui/consts/issue-21562.rs",
-"ui/consts/issue-21721.rs",
-"ui/consts/issue-23833.rs",
-"ui/consts/issue-23968-const-not-overflow.rs",
-"ui/consts/issue-25826.rs",
-"ui/consts/issue-27890.rs",
-"ui/consts/issue-28113.rs",
-"ui/consts/issue-29914-2.rs",
-"ui/consts/issue-29914-3.rs",
-"ui/consts/issue-29914.rs",
-"ui/consts/issue-29927-1.rs",
-"ui/consts/issue-29927.rs",
-"ui/consts/issue-32829-2.rs",
-"ui/consts/issue-32829.rs",
-"ui/consts/issue-33537.rs",
-"ui/consts/issue-34784.rs",
-"ui/consts/issue-36163.rs",
-"ui/consts/issue-37222.rs",
-"ui/consts/issue-37550.rs",
-"ui/consts/issue-37991.rs",
-"ui/consts/issue-39974.rs",
-"ui/consts/issue-43105.rs",
-"ui/consts/issue-44415.rs",
-"ui/consts/issue-46553.rs",
-"ui/consts/issue-50439.rs",
-"ui/consts/issue-52023-array-size-pointer-cast.rs",
-"ui/consts/issue-52060.rs",
-"ui/consts/issue-54224.rs",
-"ui/consts/issue-54348.rs",
-"ui/consts/issue-54582.rs",
-"ui/consts/issue-54954.rs",
-"ui/consts/issue-56164.rs",
-"ui/consts/issue-58435-ice-with-assoc-const.rs",
-"ui/consts/issue-64506.rs",
-"ui/consts/issue-64662.rs",
-"ui/consts/issue-66693-panic-in-array-len.rs",
-"ui/consts/issue-66693.rs",
-"ui/consts/issue-68542-closure-in-array-len.rs",
-"ui/consts/issue-69191-ice-on-uninhabited-enum-field.rs",
-"ui/consts/issue-69310-array-size-lit-wrong-ty.rs",
-"ui/consts/issue-69312.rs",
-"ui/consts/issue-69488.rs",
-"ui/consts/issue-69532.rs",
-"ui/consts/issue-70773-mir-typeck-lt-norm.rs",
-"ui/consts/issue-70942-trait-vs-impl-mismatch.rs",
-"ui/consts/issue-73976-monomorphic.rs",
-"ui/consts/issue-73976-polymorphic.rs",
-"ui/consts/issue-76064.rs",
-"ui/consts/issue-77062-large-zst-array.rs",
-"ui/consts/issue-78655.rs",
-"ui/consts/issue-79137-toogeneric.rs",
-"ui/consts/issue-83182.rs",
-"ui/consts/issue-87046.rs",
-"ui/consts/issue-90762.rs",
-"ui/consts/issue-90878-2.rs",
-"ui/consts/issue-90878-3.rs",
-"ui/consts/issue-90878.rs",
-"ui/consts/issue-91434.rs",
-"ui/consts/issue-94675.rs",
-"ui/consts/issue-104155.rs",
-"ui/consts/issue-104396.rs",
-"ui/consts/issue-13837.rs",
-"ui/consts/issue-16538.rs",
-"ui/consts/issue-28822.rs",
-"ui/consts/issue-29798.rs",
-"ui/consts/issue-33903.rs",
-"ui/consts/issue-3521.rs",
-"ui/consts/issue-37550-1.rs",
-"ui/consts/issue-39161-bogus-error.rs",
-"ui/consts/issue-47789.rs",
-"ui/consts/issue-54387.rs",
-"ui/consts/issue-62045.rs",
-"ui/consts/issue-63226.rs",
-"ui/consts/issue-63952.rs",
-"ui/consts/issue-64059.rs",
-"ui/consts/issue-65348.rs",
-"ui/consts/issue-66342.rs",
-"ui/consts/issue-66345.rs",
-"ui/consts/issue-66397.rs",
-"ui/consts/issue-66787.rs",
-"ui/consts/issue-67529.rs",
-"ui/consts/issue-67640.rs",
-"ui/consts/issue-67641.rs",
-"ui/consts/issue-67696-const-prop-ice.rs",
-"ui/consts/issue-67862.rs",
-"ui/consts/issue-68264-overflow.rs",
-"ui/consts/issue-68684.rs",
-"ui/consts/issue-6991.rs",
-"ui/consts/issue-79137-monomorphic.rs",
-"ui/consts/issue-79152-const-array-index.rs",
-"ui/consts/issue-79690.rs",
-"ui/consts/issue-88071.rs",
-"ui/consts/issue-88649.rs",
-"ui/consts/issue-89088.rs",
-"ui/consts/issue-90870.rs",
-"ui/consts/issue-91560.rs",
-"ui/consts/issue-94371.rs",
-"ui/consts/issue-96169.rs",
-"ui/consts/issue-17074.rs",
-"ui/cross-crate/issue-64872/issue-64872.rs",
-"ui/cycle-trait/issue-12511.rs",
-"ui/debuginfo/issue-105386-debuginfo-ub.rs",
-"ui/deprecation/issue-66340-deprecated-attr-non-meta-grammar.rs",
-"ui/deprecation/issue-84637-deprecated-associated-function.rs",
-"ui/derived-errors/issue-30580.rs",
-"ui/derived-errors/issue-31997-1.rs",
-"ui/derived-errors/issue-31997.rs",
-"ui/derives/issue-36617.rs",
-"ui/derives/issue-43023.rs",
-"ui/derives/issue-91492.rs",
-"ui/derives/issue-91550.rs",
-"ui/derives/issue-97343.rs",
-"ui/deriving/issue-103157.rs",
-"ui/deriving/issue-15689-1.rs",
-"ui/deriving/issue-19358.rs",
-"ui/deriving/issue-3935.rs",
-"ui/deriving/issue-58319.rs",
-"ui/deriving/issue-105101.rs",
-"ui/deriving/issue-15689-2.rs",
-"ui/deriving/issue-6341.rs",
-"ui/deriving/issue-89188-gat-hrtb.rs",
-"ui/did_you_mean/issue-103909.rs",
-"ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs",
-"ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs",
-"ui/did_you_mean/issue-31424.rs",
-"ui/did_you_mean/issue-34126.rs",
-"ui/did_you_mean/issue-34337.rs",
-"ui/did_you_mean/issue-35937.rs",
-"ui/did_you_mean/issue-36798.rs",
-"ui/did_you_mean/issue-36798_unknown_field.rs",
-"ui/did_you_mean/issue-37139.rs",
-"ui/did_you_mean/issue-38054-do-not-show-unresolved-names.rs",
-"ui/did_you_mean/issue-38147-1.rs",
-"ui/did_you_mean/issue-38147-2.rs",
-"ui/did_you_mean/issue-38147-3.rs",
-"ui/did_you_mean/issue-38147-4.rs",
-"ui/did_you_mean/issue-39544.rs",
-"ui/did_you_mean/issue-39802-show-5-trait-impls.rs",
-"ui/did_you_mean/issue-40006.rs",
-"ui/did_you_mean/issue-40396.rs",
-"ui/did_you_mean/issue-40823.rs",
-"ui/did_you_mean/issue-42599_available_fields_note.rs",
-"ui/did_you_mean/issue-42764.rs",
-"ui/did_you_mean/issue-43871-enum-instead-of-variant.rs",
-"ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.rs",
-"ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.rs",
-"ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.rs",
-"ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.rs",
-"ui/did_you_mean/issue-53280-expected-float-found-integer-literal.rs",
-"ui/did_you_mean/issue-54109-and_instead_of_ampersands.rs",
-"ui/did_you_mean/issue-56028-there-is-an-enum-variant.rs",
-"ui/did_you_mean/issue-87830-try-brackets-for-arrays.rs",
-"ui/did_you_mean/issue-93210-ignore-doc-hidden.rs",
-"ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs",
-"ui/did_you_mean/issue-54109-without-witness.rs",
-"ui/drop/auxiliary/issue-10028.rs",
-"ui/drop/issue-10028.rs",
-"ui/drop/issue-21486.rs",
-"ui/drop/issue-23338-ensure-param-drop-order.rs",
-"ui/drop/issue-2734.rs",
-"ui/drop/issue-2735-2.rs",
-"ui/drop/issue-2735-3.rs",
-"ui/drop/issue-2735.rs",
-"ui/drop/issue-30018-nopanic.rs",
-"ui/drop/issue-35546.rs",
-"ui/drop/issue-48962.rs",
-"ui/drop/issue-90752-raw-ptr-shenanigans.rs",
-"ui/drop/issue-90752.rs",
-"ui/drop/issue-979.rs",
-"ui/drop/issue-100276.rs",
-"ui/drop/issue-103107.rs",
-"ui/drop/issue-110682.rs",
-"ui/drop/issue-17718-const-destructors.rs",
-"ui/dropck/issue-24805-dropck-itemless.rs",
-"ui/dropck/issue-28498-ugeh-with-lifetime-param.rs",
-"ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs",
-"ui/dropck/issue-28498-ugeh-with-trait-bound.rs",
-"ui/dropck/issue-29844.rs",
-"ui/dropck/issue-34053.rs",
-"ui/dropck/issue-38868.rs",
-"ui/dropck/issue-54943-1.rs",
-"ui/dropck/issue-54943-2.rs",
-"ui/dst/issue-90528-unsizing-suggestion-1.rs",
-"ui/dst/issue-90528-unsizing-suggestion-2.rs",
-"ui/dst/issue-90528-unsizing-suggestion-3.rs",
-"ui/dst/issue-90528-unsizing-suggestion-4.rs",
-"ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs",
-"ui/dyn-star/issue-102430.rs",
-"ui/empty/issue-37026.rs",
-"ui/enum-discriminant/auxiliary/issue-41394.rs",
-"ui/enum-discriminant/issue-104519.rs",
-"ui/enum-discriminant/issue-41394-rpass.rs",
-"ui/enum-discriminant/issue-41394.rs",
-"ui/enum-discriminant/issue-43398.rs",
-"ui/enum-discriminant/issue-51582.rs",
-"ui/enum-discriminant/issue-61696.rs",
-"ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs",
-"ui/enum-discriminant/issue-70453-generics-in-discr-ice.rs",
-"ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs",
-"ui/enum-discriminant/issue-70509-partial_eq.rs",
-"ui/enum-discriminant/issue-72554.rs",
-"ui/enum-discriminant/issue-90038.rs",
-"ui/enum-discriminant/issue-50689.rs",
-"ui/enum-discriminant/issue-46519.rs",
-"ui/enum/issue-42747.rs",
-"ui/enum/issue-67945-1.rs",
-"ui/enum/issue-67945-2.rs",
-"ui/enum/issue-1821.rs",
-"ui/error-codes/e0119/auxiliary/issue-23563-a.rs",
-"ui/error-codes/e0119/issue-23563.rs",
-"ui/error-codes/e0119/issue-27403.rs",
-"ui/error-codes/e0119/issue-28981.rs",
-"ui/errors/issue-99572-impl-trait-on-pointer.rs",
-"ui/errors/issue-104621-extern-bad-file.rs",
-"ui/errors/issue-104621-extern-not-file.rs",
-"ui/errors/issue-89280-emitter-overflow-splice-lines.rs",
-"ui/expr/if/issue-4201.rs",
-"ui/extenv/issue-55897.rs",
-"ui/extenv/issue-110547.rs",
-"ui/extern/auxiliary/issue-80074-macro.rs",
-"ui/extern/issue-10025.rs",
-"ui/extern/issue-10763.rs",
-"ui/extern/issue-10764-rpass.rs",
-"ui/extern/issue-13655.rs",
-"ui/extern/issue-36122-accessing-externed-dst.rs",
-"ui/extern/issue-112363-extern-item-where-clauses-debug-ice.rs",
-"ui/extern/issue-1251.rs",
-"ui/extern/issue-28324.rs",
-"ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs",
-"ui/extern/issue-64655-extern-rust-must-allow-unwind.rs",
-"ui/extern/issue-80074.rs",
-"ui/extern/issue-95829.rs",
-"ui/feature-gates/issue-43106-gating-of-bench.rs",
-"ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs",
-"ui/feature-gates/issue-43106-gating-of-derive-2.rs",
-"ui/feature-gates/issue-43106-gating-of-derive.rs",
-"ui/feature-gates/issue-43106-gating-of-macro_use.rs",
-"ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs",
-"ui/feature-gates/issue-43106-gating-of-stable.rs",
-"ui/feature-gates/issue-43106-gating-of-test.rs",
-"ui/feature-gates/issue-43106-gating-of-unstable.rs",
-"ui/feature-gates/issue-49983-see-issue-0.rs",
-"ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs",
-"ui/feature-gates/issue-43106-gating-of-deprecated.rs",
-"ui/feature-gates/issue-43106-gating-of-macro_escape.rs",
-"ui/fmt/issue-103826.rs",
-"ui/fmt/issue-104142.rs",
-"ui/fmt/issue-75307.rs",
-"ui/fmt/issue-86085.rs",
-"ui/fmt/issue-89173.rs",
-"ui/fmt/issue-91556.rs",
-"ui/fn/issue-3044.rs",
-"ui/fn/issue-3099.rs",
-"ui/fn/issue-3904.rs",
-"ui/fn/issue-39259.rs",
-"ui/fn/issue-80179.rs",
-"ui/for-loop-while/issue-2216.rs",
-"ui/for-loop-while/issue-51345.rs",
-"ui/for-loop-while/issue-69841.rs",
-"ui/for-loop-while/issue-1257.rs",
-"ui/for/issue-20605.rs",
-"ui/foreign/issue-91370-foreign-fn-block-impl.rs",
-"ui/foreign/issue-74120-lowering-of-ffi-block-bodies.rs",
-"ui/foreign/issue-99276-same-type-lifetimes.rs",
-"ui/function-pointer/issue-102289.rs",
-"ui/functions-closures/closure-expected-type/issue-38714.rs",
-"ui/generator/issue-113279.rs",
-"ui/generator/issue-44197.rs",
-"ui/generator/issue-48048.rs",
-"ui/generator/issue-52398.rs",
-"ui/generator/issue-64620-yield-array-element.rs",
-"ui/generator/issue-69039.rs",
-"ui/generator/issue-88653.rs",
-"ui/generator/issue-91477.rs",
-"ui/generator/issue-102645.rs",
-"ui/generator/issue-105084.rs",
-"ui/generator/issue-110929-generator-conflict-error-ice.rs",
-"ui/generator/issue-45729-unsafe-in-generator.rs",
-"ui/generator/issue-52304.rs",
-"ui/generator/issue-53548-1.rs",
-"ui/generator/issue-53548.rs",
-"ui/generator/issue-57017.rs",
-"ui/generator/issue-57084.rs",
-"ui/generator/issue-57478.rs",
-"ui/generator/issue-58888.rs",
-"ui/generator/issue-61442-stmt-expr-with-drop.rs",
-"ui/generator/issue-62506-two_awaits.rs",
-"ui/generator/issue-68112.rs",
-"ui/generator/issue-69017.rs",
-"ui/generator/issue-87142.rs",
-"ui/generator/issue-93161.rs",
-"ui/generic-associated-types/bugs/issue-87735.rs",
-"ui/generic-associated-types/bugs/issue-87755.rs",
-"ui/generic-associated-types/bugs/issue-87803.rs",
-"ui/generic-associated-types/bugs/issue-88382.rs",
-"ui/generic-associated-types/bugs/issue-88460.rs",
-"ui/generic-associated-types/bugs/issue-88526.rs",
-"ui/generic-associated-types/bugs/issue-91762.rs",
-"ui/generic-associated-types/bugs/issue-100013.rs",
-"ui/generic-associated-types/bugs/issue-80626.rs",
-"ui/generic-associated-types/issue-101020.rs",
-"ui/generic-associated-types/issue-102114.rs",
-"ui/generic-associated-types/issue-102335-gat.rs",
-"ui/generic-associated-types/issue-47206-where-clause.rs",
-"ui/generic-associated-types/issue-67510.rs",
-"ui/generic-associated-types/issue-68641-check-gat-bounds.rs",
-"ui/generic-associated-types/issue-68642-broken-llvm-ir.rs",
-"ui/generic-associated-types/issue-68643-broken-mir.rs",
-"ui/generic-associated-types/issue-68644-codegen-selection.rs",
-"ui/generic-associated-types/issue-68645-codegen-fulfillment.rs",
-"ui/generic-associated-types/issue-68648-2.rs",
-"ui/generic-associated-types/issue-68656-unsized-values.rs",
-"ui/generic-associated-types/issue-70304.rs",
-"ui/generic-associated-types/issue-71176.rs",
-"ui/generic-associated-types/issue-74684-1.rs",
-"ui/generic-associated-types/issue-74684-2.rs",
-"ui/generic-associated-types/issue-74816.rs",
-"ui/generic-associated-types/issue-74824.rs",
-"ui/generic-associated-types/issue-76826.rs",
-"ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs",
-"ui/generic-associated-types/issue-79636-1.rs",
-"ui/generic-associated-types/issue-79636-2.rs",
-"ui/generic-associated-types/issue-80433.rs",
-"ui/generic-associated-types/issue-81487.rs",
-"ui/generic-associated-types/issue-81712-cyclic-traits.rs",
-"ui/generic-associated-types/issue-81862.rs",
-"ui/generic-associated-types/issue-84931.rs",
-"ui/generic-associated-types/issue-86787.rs",
-"ui/generic-associated-types/issue-87258_a.rs",
-"ui/generic-associated-types/issue-87258_b.rs",
-"ui/generic-associated-types/issue-87429-associated-type-default.rs",
-"ui/generic-associated-types/issue-87429-specialization.rs",
-"ui/generic-associated-types/issue-91139.rs",
-"ui/generic-associated-types/issue-91883.rs",
-"ui/generic-associated-types/issue-92033.rs",
-"ui/generic-associated-types/issue-95305.rs",
-"ui/generic-associated-types/issue-102333.rs",
-"ui/generic-associated-types/issue-58694-parameter-out-of-range.rs",
-"ui/generic-associated-types/issue-62326-parameter-out-of-range.rs",
-"ui/generic-associated-types/issue-67424.rs",
-"ui/generic-associated-types/issue-67510-pass.rs",
-"ui/generic-associated-types/issue-68648-1.rs",
-"ui/generic-associated-types/issue-68649-pass.rs",
-"ui/generic-associated-types/issue-68653.rs",
-"ui/generic-associated-types/issue-70303.rs",
-"ui/generic-associated-types/issue-76407.rs",
-"ui/generic-associated-types/issue-76535.rs",
-"ui/generic-associated-types/issue-78671.rs",
-"ui/generic-associated-types/issue-79422.rs",
-"ui/generic-associated-types/issue-80433-reduced.rs",
-"ui/generic-associated-types/issue-85921.rs",
-"ui/generic-associated-types/issue-86218-2.rs",
-"ui/generic-associated-types/issue-86218.rs",
-"ui/generic-associated-types/issue-86483.rs",
-"ui/generic-associated-types/issue-87429-2.rs",
-"ui/generic-associated-types/issue-87429.rs",
-"ui/generic-associated-types/issue-87748.rs",
-"ui/generic-associated-types/issue-87750.rs",
-"ui/generic-associated-types/issue-88287.rs",
-"ui/generic-associated-types/issue-88360.rs",
-"ui/generic-associated-types/issue-88405.rs",
-"ui/generic-associated-types/issue-88459.rs",
-"ui/generic-associated-types/issue-89008.rs",
-"ui/generic-associated-types/issue-89352.rs",
-"ui/generic-associated-types/issue-90014.rs",
-"ui/generic-associated-types/issue-90729.rs",
-"ui/generic-associated-types/issue-92096.rs",
-"ui/generic-associated-types/issue-92280.rs",
-"ui/generic-associated-types/issue-92954.rs",
-"ui/generic-associated-types/issue-93141.rs",
-"ui/generic-associated-types/issue-93262.rs",
-"ui/generic-associated-types/issue-93340.rs",
-"ui/generic-associated-types/issue-93341.rs",
-"ui/generic-associated-types/issue-93342.rs",
-"ui/generic-associated-types/issue-93874.rs",
-"ui/generic-associated-types/issue-88595.rs",
-"ui/generic-associated-types/issue-90014-tait.rs",
-"ui/generic-associated-types/issue-90014-tait2.rs",
-"ui/generics/issue-106694.rs",
-"ui/generics/issue-1112.rs",
-"ui/generics/issue-2936.rs",
-"ui/generics/issue-32498.rs",
-"ui/generics/issue-333.rs",
-"ui/generics/issue-59508-1.rs",
-"ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.rs",
-"ui/generics/issue-61631-default-type-param-cannot-reference-self.rs",
-"ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.rs",
-"ui/generics/issue-79605.rs",
-"ui/generics/issue-80512-param-reordering-with-defaults.rs",
-"ui/generics/issue-94432-garbage-ice.rs",
-"ui/generics/issue-98432.rs",
-"ui/generics/issue-59508.rs",
-"ui/generics/issue-94923.rs",
-"ui/generics/issue-95208-ignore-qself.rs",
-"ui/generics/issue-95208.rs",
-"ui/hygiene/issue-15221.rs",
-"ui/hygiene/issue-40847.rs",
-"ui/hygiene/issue-77523-def-site-async-await.rs",
-"ui/hygiene/issue-32922.rs",
-"ui/hygiene/issue-44128.rs",
-"ui/hygiene/issue-47311.rs",
-"ui/hygiene/issue-47312.rs",
-"ui/hygiene/issue-61574-const-parameters.rs",
-"ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs",
-"ui/impl-trait/in-trait/issue-102140.rs",
-"ui/impl-trait/in-trait/issue-102301.rs",
-"ui/impl-trait/in-trait/issue-102571.rs",
-"ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs",
-"ui/impl-trait/issues/issue-54600.rs",
-"ui/impl-trait/issues/issue-54840.rs",
-"ui/impl-trait/issues/issue-54895.rs",
-"ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs",
-"ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs",
-"ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs",
-"ui/impl-trait/issues/issue-58504.rs",
-"ui/impl-trait/issues/issue-58956.rs",
-"ui/impl-trait/issues/issue-62742.rs",
-"ui/impl-trait/issues/issue-67830.rs",
-"ui/impl-trait/issues/issue-70971.rs",
-"ui/impl-trait/issues/issue-79099.rs",
-"ui/impl-trait/issues/issue-82139.rs",
-"ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs",
-"ui/impl-trait/issues/issue-84073.rs",
-"ui/impl-trait/issues/issue-84919.rs",
-"ui/impl-trait/issues/issue-86642.rs",
-"ui/impl-trait/issues/issue-86719.rs",
-"ui/impl-trait/issues/issue-87295.rs",
-"ui/impl-trait/issues/issue-87340.rs",
-"ui/impl-trait/issues/issue-88236-2.rs",
-"ui/impl-trait/issues/issue-88236.rs",
-"ui/impl-trait/issues/issue-99348-impl-compatibility.rs",
-"ui/impl-trait/issues/issue-104815.rs",
-"ui/impl-trait/issues/issue-105826.rs",
-"ui/impl-trait/issues/issue-42479.rs",
-"ui/impl-trait/issues/issue-49376.rs",
-"ui/impl-trait/issues/issue-52128.rs",
-"ui/impl-trait/issues/issue-53457.rs",
-"ui/impl-trait/issues/issue-55608-captures-empty-region.rs",
-"ui/impl-trait/issues/issue-57464-unexpected-regions.rs",
-"ui/impl-trait/issues/issue-77987.rs",
-"ui/impl-trait/issues/issue-83919.rs",
-"ui/impl-trait/issues/issue-86201.rs",
-"ui/impl-trait/issues/issue-86800.rs",
-"ui/impl-trait/issues/issue-89312.rs",
-"ui/impl-trait/issues/issue-92305.rs",
-"ui/impl-trait/issues/issue-93788.rs",
-"ui/impl-trait/issues/issue-65581.rs",
-"ui/impl-trait/issues/issue-70877.rs",
-"ui/impl-trait/issues/issue-74282.rs",
-"ui/impl-trait/issues/issue-78722-2.rs",
-"ui/impl-trait/issues/issue-78722.rs",
-"ui/impl-trait/issue-100075-2.rs",
-"ui/impl-trait/issue-100075.rs",
-"ui/impl-trait/issue-35668.rs",
-"ui/impl-trait/issue-36792.rs",
-"ui/impl-trait/issue-49685.rs",
-"ui/impl-trait/issue-51185.rs",
-"ui/impl-trait/issue-54966.rs",
-"ui/impl-trait/issue-55872-1.rs",
-"ui/impl-trait/issue-55872.rs",
-"ui/impl-trait/issue-72911.rs",
-"ui/impl-trait/issue-86465.rs",
-"ui/impl-trait/issue-87450.rs",
-"ui/impl-trait/issue-99073-2.rs",
-"ui/impl-trait/issue-99073.rs",
-"ui/impl-trait/issue-100187.rs",
-"ui/impl-trait/issue-102605.rs",
-"ui/impl-trait/issue-103181-1.rs",
-"ui/impl-trait/issue-103599.rs",
-"ui/impl-trait/issue-108591.rs",
-"ui/impl-trait/issue-108592.rs",
-"ui/impl-trait/issue-46959.rs",
-"ui/impl-trait/issue-49556.rs",
-"ui/impl-trait/issue-49579.rs",
-"ui/impl-trait/issue-55872-2.rs",
-"ui/impl-trait/issue-56445.rs",
-"ui/impl-trait/issue-68532.rs",
-"ui/impl-trait/issue-99642-2.rs",
-"ui/impl-trait/issue-99642.rs",
-"ui/impl-trait/issue-99914.rs",
-"ui/impl-trait/issue-103181-2.rs",
-"ui/impl-trait/issue-55872-3.rs",
-"ui/implied-bounds/issue-100690.rs",
-"ui/implied-bounds/issue-101951.rs",
-"ui/implied-bounds/issue-110161.rs",
-"ui/imports/auxiliary/issue-36881-aux.rs",
-"ui/imports/auxiliary/issue-52891.rs",
-"ui/imports/auxiliary/issue-55811.rs",
-"ui/imports/auxiliary/issue-56125.rs",
-"ui/imports/auxiliary/issue-59764.rs",
-"ui/imports/auxiliary/issue-85992-extern-1.rs",
-"ui/imports/auxiliary/issue-85992-extern-2.rs",
-"ui/imports/issue-26873-multifile/issue-26873-multifile.rs",
-"ui/imports/issue-26873-multifile/issue-26873-onefile.rs",
-"ui/imports/issue-45829/auxiliary/issue-45829-a.rs",
-"ui/imports/issue-45829/auxiliary/issue-45829-b.rs",
-"ui/imports/issue-45829/issue-45829.rs",
-"ui/imports/issue-113953.rs",
-"ui/imports/issue-109343.rs",
-"ui/imports/issue-13404.rs",
-"ui/imports/issue-1697.rs",
-"ui/imports/issue-19498.rs",
-"ui/imports/issue-24081.rs",
-"ui/imports/issue-25396.rs",
-"ui/imports/issue-26886.rs",
-"ui/imports/issue-28388-1.rs",
-"ui/imports/issue-28388-2.rs",
-"ui/imports/issue-2937.rs",
-"ui/imports/issue-30560.rs",
-"ui/imports/issue-31212.rs",
-"ui/imports/issue-32833.rs",
-"ui/imports/issue-33464.rs",
-"ui/imports/issue-36881.rs",
-"ui/imports/issue-37887.rs",
-"ui/imports/issue-38293.rs",
-"ui/imports/issue-4366-2.rs",
-"ui/imports/issue-4366.rs",
-"ui/imports/issue-47623.rs",
-"ui/imports/issue-4865-1.rs",
-"ui/imports/issue-4865-2.rs",
-"ui/imports/issue-4865-3.rs",
-"ui/imports/issue-53269.rs",
-"ui/imports/issue-53512.rs",
-"ui/imports/issue-53565.rs",
-"ui/imports/issue-55457.rs",
-"ui/imports/issue-55884-1.rs",
-"ui/imports/issue-57015.rs",
-"ui/imports/issue-8208.rs",
-"ui/imports/issue-8640.rs",
-"ui/imports/issue-55884-2.rs",
-"ui/imports/issue-109148.rs",
-"ui/imports/issue-18083.rs",
-"ui/imports/issue-24883.rs",
-"ui/imports/issue-26930.rs",
-"ui/imports/issue-28134.rs",
-"ui/imports/issue-32119.rs",
-"ui/imports/issue-32222.rs",
-"ui/imports/issue-32354-suggest-import-rename.rs",
-"ui/imports/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs",
-"ui/imports/issue-52891.rs",
-"ui/imports/issue-53140.rs",
-"ui/imports/issue-55811.rs",
-"ui/imports/issue-56125.rs",
-"ui/imports/issue-56263.rs",
-"ui/imports/issue-57539.rs",
-"ui/imports/issue-59764.rs",
-"ui/imports/issue-62767.rs",
-"ui/imports/issue-68103.rs",
-"ui/imports/issue-99695-b.rs",
-"ui/imports/issue-99695.rs",
-"ui/imports/issue-85992.rs",
-"ui/inference/need_type_info/issue-103053.rs",
-"ui/inference/need_type_info/issue-107745-avoid-expr-from-macro-expansion.rs",
-"ui/inference/need_type_info/issue-109905.rs",
-"ui/inference/need_type_info/issue-113264-incorrect-impl-trait-in-path-suggestion.rs",
-"ui/inference/issue-103587.rs",
-"ui/inference/issue-104649.rs",
-"ui/inference/issue-107090.rs",
-"ui/inference/issue-36053.rs",
-"ui/inference/issue-70082.rs",
-"ui/inference/issue-71309.rs",
-"ui/inference/issue-71584.rs",
-"ui/inference/issue-71732.rs",
-"ui/inference/issue-72616.rs",
-"ui/inference/issue-72690.rs",
-"ui/inference/issue-80816.rs",
-"ui/inference/issue-81522.rs",
-"ui/inference/issue-83606.rs",
-"ui/inference/issue-86162-1.rs",
-"ui/inference/issue-86162-2.rs",
-"ui/inference/issue-28935.rs",
-"ui/inference/issue-70703.rs",
-"ui/inference/issue-80409.rs",
-"ui/inference/issue-113354.rs",
-"ui/infinite/issue-41731-infinite-macro-print.rs",
-"ui/infinite/issue-41731-infinite-macro-println.rs",
-"ui/intrinsics/issue-28575.rs",
-"ui/intrinsics/issue-84297-reifying-copy.rs",
-"ui/issues/auxiliary/issue-11224.rs",
-"ui/issues/auxiliary/issue-11508.rs",
-"ui/issues/auxiliary/issue-11529.rs",
-"ui/issues/auxiliary/issue-11680.rs",
-"ui/issues/auxiliary/issue-12133-dylib.rs",
-"ui/issues/auxiliary/issue-12133-dylib2.rs",
-"ui/issues/auxiliary/issue-12133-rlib.rs",
-"ui/issues/auxiliary/issue-12612-1.rs",
-"ui/issues/auxiliary/issue-12612-2.rs",
-"ui/issues/auxiliary/issue-12660-aux.rs",
-"ui/issues/auxiliary/issue-13507.rs",
-"ui/issues/auxiliary/issue-13620-1.rs",
-"ui/issues/auxiliary/issue-13620-2.rs",
-"ui/issues/auxiliary/issue-13872-1.rs",
-"ui/issues/auxiliary/issue-13872-2.rs",
-"ui/issues/auxiliary/issue-13872-3.rs",
-"ui/issues/auxiliary/issue-14344-1.rs",
-"ui/issues/auxiliary/issue-14344-2.rs",
-"ui/issues/auxiliary/issue-14421.rs",
-"ui/issues/auxiliary/issue-14422.rs",
-"ui/issues/auxiliary/issue-15562.rs",
-"ui/issues/auxiliary/issue-16643.rs",
-"ui/issues/auxiliary/issue-16725.rs",
-"ui/issues/auxiliary/issue-17662.rs",
-"ui/issues/auxiliary/issue-18501.rs",
-"ui/issues/auxiliary/issue-18514.rs",
-"ui/issues/auxiliary/issue-18711.rs",
-"ui/issues/auxiliary/issue-18913-1.rs",
-"ui/issues/auxiliary/issue-18913-2.rs",
-"ui/issues/auxiliary/issue-1920.rs",
-"ui/issues/auxiliary/issue-19293.rs",
-"ui/issues/auxiliary/issue-19340-1.rs",
-"ui/issues/auxiliary/issue-20389.rs",
-"ui/issues/auxiliary/issue-21202.rs",
-"ui/issues/auxiliary/issue-2170-lib.rs",
-"ui/issues/auxiliary/issue-2316-a.rs",
-"ui/issues/auxiliary/issue-2316-b.rs",
-"ui/issues/auxiliary/issue-2380.rs",
-"ui/issues/auxiliary/issue-2414-a.rs",
-"ui/issues/auxiliary/issue-2414-b.rs",
-"ui/issues/auxiliary/issue-2472-b.rs",
-"ui/issues/auxiliary/issue-25185-1.rs",
-"ui/issues/auxiliary/issue-25185-2.rs",
-"ui/issues/auxiliary/issue-2526.rs",
-"ui/issues/auxiliary/issue-25467.rs",
-"ui/issues/auxiliary/issue-2631-a.rs",
-"ui/issues/auxiliary/issue-2723-a.rs",
-"ui/issues/auxiliary/issue-29181.rs",
-"ui/issues/auxiliary/issue-29265.rs",
-"ui/issues/auxiliary/issue-29485.rs",
-"ui/issues/auxiliary/issue-3012-1.rs",
-"ui/issues/auxiliary/issue-30123-aux.rs",
-"ui/issues/auxiliary/issue-3136-a.rs",
-"ui/issues/auxiliary/issue-31702-1.rs",
-"ui/issues/auxiliary/issue-34796-aux.rs",
-"ui/issues/auxiliary/issue-36954.rs",
-"ui/issues/auxiliary/issue-38190.rs",
-"ui/issues/auxiliary/issue-38226-aux.rs",
-"ui/issues/auxiliary/issue-3979-traits.rs",
-"ui/issues/auxiliary/issue-41053.rs",
-"ui/issues/auxiliary/issue-41549.rs",
-"ui/issues/auxiliary/issue-42007-s.rs",
-"ui/issues/auxiliary/issue-4208-cc.rs",
-"ui/issues/auxiliary/issue-4545.rs",
-"ui/issues/auxiliary/issue-48984-aux.rs",
-"ui/issues/auxiliary/issue-49544.rs",
-"ui/issues/auxiliary/issue-51798.rs",
-"ui/issues/auxiliary/issue-52489.rs",
-"ui/issues/auxiliary/issue-5518.rs",
-"ui/issues/auxiliary/issue-5521.rs",
-"ui/issues/auxiliary/issue-56943.rs",
-"ui/issues/auxiliary/issue-57271-lib.rs",
-"ui/issues/auxiliary/issue-5844-aux.rs",
-"ui/issues/auxiliary/issue-7178.rs",
-"ui/issues/auxiliary/issue-73112.rs",
-"ui/issues/auxiliary/issue-7899.rs",
-"ui/issues/auxiliary/issue-8044.rs",
-"ui/issues/auxiliary/issue-8259.rs",
-"ui/issues/auxiliary/issue-8401.rs",
-"ui/issues/auxiliary/issue-9123.rs",
-"ui/issues/auxiliary/issue-9155.rs",
-"ui/issues/auxiliary/issue-9188.rs",
-"ui/issues/auxiliary/issue-9906.rs",
-"ui/issues/auxiliary/issue-9968.rs",
-"ui/issues/auxiliary/issue-111011.rs",
-"ui/issues/auxiliary/issue-31702-2.rs",
-"ui/issues/issue-24687-embed-debuginfo/auxiliary/issue-24687-lib.rs",
-"ui/issues/issue-24687-embed-debuginfo/auxiliary/issue-24687-mbcs-in-comments.rs",
-"ui/issues/issue-37311-type-length-limit/issue-37311.rs",
-"ui/issues/issue-38875/auxiliary/issue-38875-b.rs",
-"ui/issues/issue-38875/issue-38875.rs",
-"ui/issues/issue-40402-ref-hints/issue-40402-1.rs",
-"ui/issues/issue-40402-ref-hints/issue-40402-2.rs",
-"ui/issues/issue-41652/auxiliary/issue-41652-b.rs",
-"ui/issues/issue-41652/issue-41652.rs",
-"ui/issues/issue-70093/issue-70093-link-directives.rs",
-"ui/issues/issue-70093/issue-70093.rs",
-"ui/issues/issue-77218/issue-77218-2.rs",
-"ui/issues/issue-77218/issue-77218.rs",
-"ui/issues/issue-100605.rs",
-"ui/issues/issue-10228.rs",
-"ui/issues/issue-10291.rs",
-"ui/issues/issue-102964.rs",
-"ui/issues/issue-10412.rs",
-"ui/issues/issue-10436.rs",
-"ui/issues/issue-10465.rs",
-"ui/issues/issue-10545.rs",
-"ui/issues/issue-10638.rs",
-"ui/issues/issue-10656.rs",
-"ui/issues/issue-10682.rs",
-"ui/issues/issue-10683.rs",
-"ui/issues/issue-10718.rs",
-"ui/issues/issue-10734.rs",
-"ui/issues/issue-10764.rs",
-"ui/issues/issue-10767.rs",
-"ui/issues/issue-10802.rs",
-"ui/issues/issue-10806.rs",
-"ui/issues/issue-10877.rs",
-"ui/issues/issue-11004.rs",
-"ui/issues/issue-11192.rs",
-"ui/issues/issue-11205.rs",
-"ui/issues/issue-11224.rs",
-"ui/issues/issue-11267.rs",
-"ui/issues/issue-11374.rs",
-"ui/issues/issue-11382.rs",
-"ui/issues/issue-11508.rs",
-"ui/issues/issue-11529.rs",
-"ui/issues/issue-11552.rs",
-"ui/issues/issue-11593.rs",
-"ui/issues/issue-11677.rs",
-"ui/issues/issue-11680.rs",
-"ui/issues/issue-11681.rs",
-"ui/issues/issue-11692-1.rs",
-"ui/issues/issue-11692-2.rs",
-"ui/issues/issue-11771.rs",
-"ui/issues/issue-11820.rs",
-"ui/issues/issue-11844.rs",
-"ui/issues/issue-11873.rs",
-"ui/issues/issue-11958.rs",
-"ui/issues/issue-12028.rs",
-"ui/issues/issue-12033.rs",
-"ui/issues/issue-12041.rs",
-"ui/issues/issue-12127.rs",
-"ui/issues/issue-12133-1.rs",
-"ui/issues/issue-12133-2.rs",
-"ui/issues/issue-12187-1.rs",
-"ui/issues/issue-12187-2.rs",
-"ui/issues/issue-12285.rs",
-"ui/issues/issue-12567.rs",
-"ui/issues/issue-12612.rs",
-"ui/issues/issue-12660.rs",
-"ui/issues/issue-12677.rs",
-"ui/issues/issue-12699.rs",
-"ui/issues/issue-12744.rs",
-"ui/issues/issue-12860.rs",
-"ui/issues/issue-12863.rs",
-"ui/issues/issue-12909.rs",
-"ui/issues/issue-13027.rs",
-"ui/issues/issue-13033.rs",
-"ui/issues/issue-13058.rs",
-"ui/issues/issue-13204.rs",
-"ui/issues/issue-13214.rs",
-"ui/issues/issue-13259-windows-tcb-trash.rs",
-"ui/issues/issue-13264.rs",
-"ui/issues/issue-13323.rs",
-"ui/issues/issue-13359.rs",
-"ui/issues/issue-13407.rs",
-"ui/issues/issue-13434.rs",
-"ui/issues/issue-13446.rs",
-"ui/issues/issue-13466.rs",
-"ui/issues/issue-13482.rs",
-"ui/issues/issue-13497-2.rs",
-"ui/issues/issue-13497.rs",
-"ui/issues/issue-13507-2.rs",
-"ui/issues/issue-1362.rs",
-"ui/issues/issue-13620.rs",
-"ui/issues/issue-13665.rs",
-"ui/issues/issue-13763.rs",
-"ui/issues/issue-13808.rs",
-"ui/issues/issue-13847.rs",
-"ui/issues/issue-13867.rs",
-"ui/issues/issue-13872.rs",
-"ui/issues/issue-14091-2.rs",
-"ui/issues/issue-14091.rs",
-"ui/issues/issue-14092.rs",
-"ui/issues/issue-14229.rs",
-"ui/issues/issue-14285.rs",
-"ui/issues/issue-14308.rs",
-"ui/issues/issue-14344.rs",
-"ui/issues/issue-14366.rs",
-"ui/issues/issue-14382.rs",
-"ui/issues/issue-14393.rs",
-"ui/issues/issue-14399.rs",
-"ui/issues/issue-14421.rs",
-"ui/issues/issue-14422.rs",
-"ui/issues/issue-1448-2.rs",
-"ui/issues/issue-1451.rs",
-"ui/issues/issue-14541.rs",
-"ui/issues/issue-1460.rs",
-"ui/issues/issue-14721.rs",
-"ui/issues/issue-1476.rs",
-"ui/issues/issue-14821.rs",
-"ui/issues/issue-14845.rs",
-"ui/issues/issue-14853.rs",
-"ui/issues/issue-14865.rs",
-"ui/issues/issue-14875.rs",
-"ui/issues/issue-14915.rs",
-"ui/issues/issue-14919.rs",
-"ui/issues/issue-15034.rs",
-"ui/issues/issue-15043.rs",
-"ui/issues/issue-15063.rs",
-"ui/issues/issue-15094.rs",
-"ui/issues/issue-15104.rs",
-"ui/issues/issue-15129-rpass.rs",
-"ui/issues/issue-15155.rs",
-"ui/issues/issue-15167.rs",
-"ui/issues/issue-15189.rs",
-"ui/issues/issue-15207.rs",
-"ui/issues/issue-15260.rs",
-"ui/issues/issue-15381.rs",
-"ui/issues/issue-15444.rs",
-"ui/issues/issue-15523-big.rs",
-"ui/issues/issue-15523.rs",
-"ui/issues/issue-15562.rs",
-"ui/issues/issue-15571.rs",
-"ui/issues/issue-15673.rs",
-"ui/issues/issue-15756.rs",
-"ui/issues/issue-15763.rs",
-"ui/issues/issue-15774.rs",
-"ui/issues/issue-15783.rs",
-"ui/issues/issue-15793.rs",
-"ui/issues/issue-15858.rs",
-"ui/issues/issue-15896.rs",
-"ui/issues/issue-15965.rs",
-"ui/issues/issue-16048.rs",
-"ui/issues/issue-16149.rs",
-"ui/issues/issue-16151.rs",
-"ui/issues/issue-16250.rs",
-"ui/issues/issue-16256.rs",
-"ui/issues/issue-16278.rs",
-"ui/issues/issue-16338.rs",
-"ui/issues/issue-16401.rs",
-"ui/issues/issue-16441.rs",
-"ui/issues/issue-16452.rs",
-"ui/issues/issue-16492.rs",
-"ui/issues/issue-16530.rs",
-"ui/issues/issue-16560.rs",
-"ui/issues/issue-16562.rs",
-"ui/issues/issue-1660.rs",
-"ui/issues/issue-16643.rs",
-"ui/issues/issue-16648.rs",
-"ui/issues/issue-16671.rs",
-"ui/issues/issue-16683.rs",
-"ui/issues/issue-16725.rs",
-"ui/issues/issue-16739.rs",
-"ui/issues/issue-16745.rs",
-"ui/issues/issue-16774.rs",
-"ui/issues/issue-16783.rs",
-"ui/issues/issue-16819.rs",
-"ui/issues/issue-16922-rpass.rs",
-"ui/issues/issue-16922.rs",
-"ui/issues/issue-16939.rs",
-"ui/issues/issue-1696.rs",
-"ui/issues/issue-16966.rs",
-"ui/issues/issue-17001.rs",
-"ui/issues/issue-17033.rs",
-"ui/issues/issue-17068.rs",
-"ui/issues/issue-17216.rs",
-"ui/issues/issue-17252.rs",
-"ui/issues/issue-17302.rs",
-"ui/issues/issue-17322.rs",
-"ui/issues/issue-17336.rs",
-"ui/issues/issue-17337.rs",
-"ui/issues/issue-17351.rs",
-"ui/issues/issue-17361.rs",
-"ui/issues/issue-17373.rs",
-"ui/issues/issue-17385.rs",
-"ui/issues/issue-17405.rs",
-"ui/issues/issue-17431-1.rs",
-"ui/issues/issue-17431-2.rs",
-"ui/issues/issue-17431-3.rs",
-"ui/issues/issue-17431-4.rs",
-"ui/issues/issue-17431-5.rs",
-"ui/issues/issue-17431-6.rs",
-"ui/issues/issue-17431-7.rs",
-"ui/issues/issue-17441.rs",
-"ui/issues/issue-17450.rs",
-"ui/issues/issue-17503.rs",
-"ui/issues/issue-17546.rs",
-"ui/issues/issue-17551.rs",
-"ui/issues/issue-17651.rs",
-"ui/issues/issue-17662.rs",
-"ui/issues/issue-17734.rs",
-"ui/issues/issue-17740.rs",
-"ui/issues/issue-17758.rs",
-"ui/issues/issue-17771.rs",
-"ui/issues/issue-17800.rs",
-"ui/issues/issue-17816.rs",
-"ui/issues/issue-17877.rs",
-"ui/issues/issue-17897.rs",
-"ui/issues/issue-17904-2.rs",
-"ui/issues/issue-17905-2.rs",
-"ui/issues/issue-17905.rs",
-"ui/issues/issue-17933.rs",
-"ui/issues/issue-17954.rs",
-"ui/issues/issue-17959.rs",
-"ui/issues/issue-17994.rs",
-"ui/issues/issue-17999.rs",
-"ui/issues/issue-18058.rs",
-"ui/issues/issue-18107.rs",
-"ui/issues/issue-18110.rs",
-"ui/issues/issue-18119.rs",
-"ui/issues/issue-18159.rs",
-"ui/issues/issue-18173.rs",
-"ui/issues/issue-18183.rs",
-"ui/issues/issue-18232.rs",
-"ui/issues/issue-18352.rs",
-"ui/issues/issue-18353.rs",
-"ui/issues/issue-18423.rs",
-"ui/issues/issue-18446.rs",
-"ui/issues/issue-18464.rs",
-"ui/issues/issue-18501.rs",
-"ui/issues/issue-18514.rs",
-"ui/issues/issue-18532.rs",
-"ui/issues/issue-18539.rs",
-"ui/issues/issue-18566.rs",
-"ui/issues/issue-18611.rs",
-"ui/issues/issue-18685.rs",
-"ui/issues/issue-18711.rs",
-"ui/issues/issue-18767.rs",
-"ui/issues/issue-18783.rs",
-"ui/issues/issue-18819.rs",
-"ui/issues/issue-18845.rs",
-"ui/issues/issue-18859.rs",
-"ui/issues/issue-18913.rs",
-"ui/issues/issue-18919.rs",
-"ui/issues/issue-18952.rs",
-"ui/issues/issue-18959.rs",
-"ui/issues/issue-1900.rs",
-"ui/issues/issue-19001.rs",
-"ui/issues/issue-19086.rs",
-"ui/issues/issue-19127.rs",
-"ui/issues/issue-19135.rs",
-"ui/issues/issue-1920-1.rs",
-"ui/issues/issue-1920-2.rs",
-"ui/issues/issue-1920-3.rs",
-"ui/issues/issue-19244-1.rs",
-"ui/issues/issue-19244-2.rs",
-"ui/issues/issue-19293.rs",
-"ui/issues/issue-19340-1.rs",
-"ui/issues/issue-19340-2.rs",
-"ui/issues/issue-19367.rs",
-"ui/issues/issue-19380.rs",
-"ui/issues/issue-19404.rs",
-"ui/issues/issue-19482.rs",
-"ui/issues/issue-19499.rs",
-"ui/issues/issue-19521.rs",
-"ui/issues/issue-19692.rs",
-"ui/issues/issue-19707.rs",
-"ui/issues/issue-19734.rs",
-"ui/issues/issue-1974.rs",
-"ui/issues/issue-19811-escape-unicode.rs",
-"ui/issues/issue-19922.rs",
-"ui/issues/issue-19991.rs",
-"ui/issues/issue-20055-box-trait.rs",
-"ui/issues/issue-20055-box-unsized-array.rs",
-"ui/issues/issue-20162.rs",
-"ui/issues/issue-20174.rs",
-"ui/issues/issue-20225.rs",
-"ui/issues/issue-20261.rs",
-"ui/issues/issue-20313-rpass.rs",
-"ui/issues/issue-20313.rs",
-"ui/issues/issue-20389.rs",
-"ui/issues/issue-20413.rs",
-"ui/issues/issue-20427.rs",
-"ui/issues/issue-20433.rs",
-"ui/issues/issue-20544.rs",
-"ui/issues/issue-20575.rs",
-"ui/issues/issue-20616.rs",
-"ui/issues/issue-20676.rs",
-"ui/issues/issue-20714.rs",
-"ui/issues/issue-2074.rs",
-"ui/issues/issue-20772.rs",
-"ui/issues/issue-20797.rs",
-"ui/issues/issue-20803.rs",
-"ui/issues/issue-20831-debruijn.rs",
-"ui/issues/issue-20847.rs",
-"ui/issues/issue-20939.rs",
-"ui/issues/issue-20953.rs",
-"ui/issues/issue-21033.rs",
-"ui/issues/issue-21160.rs",
-"ui/issues/issue-21174.rs",
-"ui/issues/issue-21177.rs",
-"ui/issues/issue-21202.rs",
-"ui/issues/issue-21291.rs",
-"ui/issues/issue-21306.rs",
-"ui/issues/issue-21332.rs",
-"ui/issues/issue-21361.rs",
-"ui/issues/issue-21384.rs",
-"ui/issues/issue-21400.rs",
-"ui/issues/issue-21449.rs",
-"ui/issues/issue-2150.rs",
-"ui/issues/issue-2151.rs",
-"ui/issues/issue-21546.rs",
-"ui/issues/issue-21554.rs",
-"ui/issues/issue-21596.rs",
-"ui/issues/issue-21600.rs",
-"ui/issues/issue-21634.rs",
-"ui/issues/issue-21655.rs",
-"ui/issues/issue-2170-exe.rs",
-"ui/issues/issue-21701.rs",
-"ui/issues/issue-21763.rs",
-"ui/issues/issue-21837.rs",
-"ui/issues/issue-21891.rs",
-"ui/issues/issue-2190-1.rs",
-"ui/issues/issue-21909.rs",
-"ui/issues/issue-21922.rs",
-"ui/issues/issue-21946.rs",
-"ui/issues/issue-21950.rs",
-"ui/issues/issue-21974.rs",
-"ui/issues/issue-22008.rs",
-"ui/issues/issue-22034.rs",
-"ui/issues/issue-22036.rs",
-"ui/issues/issue-2214.rs",
-"ui/issues/issue-22258.rs",
-"ui/issues/issue-22289.rs",
-"ui/issues/issue-22312.rs",
-"ui/issues/issue-22346.rs",
-"ui/issues/issue-22370.rs",
-"ui/issues/issue-22403.rs",
-"ui/issues/issue-22426.rs",
-"ui/issues/issue-22434.rs",
-"ui/issues/issue-22468.rs",
-"ui/issues/issue-22577.rs",
-"ui/issues/issue-22599.rs",
-"ui/issues/issue-22629.rs",
-"ui/issues/issue-22638.rs",
-"ui/issues/issue-22644.rs",
-"ui/issues/issue-22684.rs",
-"ui/issues/issue-22706.rs",
-"ui/issues/issue-2281-part1.rs",
-"ui/issues/issue-2284.rs",
-"ui/issues/issue-22864-1.rs",
-"ui/issues/issue-22864-2.rs",
-"ui/issues/issue-22872.rs",
-"ui/issues/issue-22874.rs",
-"ui/issues/issue-2288.rs",
-"ui/issues/issue-22886.rs",
-"ui/issues/issue-22894.rs",
-"ui/issues/issue-22933-2.rs",
-"ui/issues/issue-22992-2.rs",
-"ui/issues/issue-22992.rs",
-"ui/issues/issue-23024.rs",
-"ui/issues/issue-23036.rs",
-"ui/issues/issue-23041.rs",
-"ui/issues/issue-23046.rs",
-"ui/issues/issue-23073.rs",
-"ui/issues/issue-23122-1.rs",
-"ui/issues/issue-23122-2.rs",
-"ui/issues/issue-2316-c.rs",
-"ui/issues/issue-23173.rs",
-"ui/issues/issue-23189.rs",
-"ui/issues/issue-23217.rs",
-"ui/issues/issue-23253.rs",
-"ui/issues/issue-23261.rs",
-"ui/issues/issue-23281.rs",
-"ui/issues/issue-23302-1.rs",
-"ui/issues/issue-23302-2.rs",
-"ui/issues/issue-23302-3.rs",
-"ui/issues/issue-23304-1.rs",
-"ui/issues/issue-23304-2.rs",
-"ui/issues/issue-23311.rs",
-"ui/issues/issue-23336.rs",
-"ui/issues/issue-23406.rs",
-"ui/issues/issue-23433.rs",
-"ui/issues/issue-23485.rs",
-"ui/issues/issue-23491.rs",
-"ui/issues/issue-23543.rs",
-"ui/issues/issue-23544.rs",
-"ui/issues/issue-23550.rs",
-"ui/issues/issue-23589.rs",
-"ui/issues/issue-23611-enum-swap-in-drop.rs",
-"ui/issues/issue-23649-1.rs",
-"ui/issues/issue-23649-2.rs",
-"ui/issues/issue-23649-3.rs",
-"ui/issues/issue-23699.rs",
-"ui/issues/issue-23781.rs",
-"ui/issues/issue-2380-b.rs",
-"ui/issues/issue-2383.rs",
-"ui/issues/issue-23891.rs",
-"ui/issues/issue-23898.rs",
-"ui/issues/issue-23958.rs",
-"ui/issues/issue-23966.rs",
-"ui/issues/issue-23992.rs",
-"ui/issues/issue-24013.rs",
-"ui/issues/issue-24036.rs",
-"ui/issues/issue-24086.rs",
-"ui/issues/issue-2414-c.rs",
-"ui/issues/issue-2428.rs",
-"ui/issues/issue-24308.rs",
-"ui/issues/issue-24322.rs",
-"ui/issues/issue-24352.rs",
-"ui/issues/issue-24353.rs",
-"ui/issues/issue-24357.rs",
-"ui/issues/issue-24363.rs",
-"ui/issues/issue-24365.rs",
-"ui/issues/issue-24424.rs",
-"ui/issues/issue-24446.rs",
-"ui/issues/issue-2445-b.rs",
-"ui/issues/issue-2445.rs",
-"ui/issues/issue-24533.rs",
-"ui/issues/issue-24589.rs",
-"ui/issues/issue-2463.rs",
-"ui/issues/issue-24682.rs",
-"ui/issues/issue-2472.rs",
-"ui/issues/issue-24779.rs",
-"ui/issues/issue-24819.rs",
-"ui/issues/issue-2487-a.rs",
-"ui/issues/issue-24947.rs",
-"ui/issues/issue-24954.rs",
-"ui/issues/issue-25076.rs",
-"ui/issues/issue-25089.rs",
-"ui/issues/issue-25145.rs",
-"ui/issues/issue-25185.rs",
-"ui/issues/issue-2526-a.rs",
-"ui/issues/issue-25279.rs",
-"ui/issues/issue-25343.rs",
-"ui/issues/issue-25368.rs",
-"ui/issues/issue-25386.rs",
-"ui/issues/issue-25439.rs",
-"ui/issues/issue-25467.rs",
-"ui/issues/issue-25497.rs",
-"ui/issues/issue-2550.rs",
-"ui/issues/issue-25515.rs",
-"ui/issues/issue-25549-multiple-drop.rs",
-"ui/issues/issue-25679.rs",
-"ui/issues/issue-25693.rs",
-"ui/issues/issue-25746-bool-transmute.rs",
-"ui/issues/issue-25757.rs",
-"ui/issues/issue-25810.rs",
-"ui/issues/issue-2590.rs",
-"ui/issues/issue-25901.rs",
-"ui/issues/issue-26056.rs",
-"ui/issues/issue-26093.rs",
-"ui/issues/issue-26127.rs",
-"ui/issues/issue-26217.rs",
-"ui/issues/issue-26237.rs",
-"ui/issues/issue-26262.rs",
-"ui/issues/issue-2631-b.rs",
-"ui/issues/issue-2642.rs",
-"ui/issues/issue-26468.rs",
-"ui/issues/issue-26472.rs",
-"ui/issues/issue-26619.rs",
-"ui/issues/issue-26641.rs",
-"ui/issues/issue-26655.rs",
-"ui/issues/issue-26709.rs",
-"ui/issues/issue-26802.rs",
-"ui/issues/issue-26805.rs",
-"ui/issues/issue-26812.rs",
-"ui/issues/issue-26905-rpass.rs",
-"ui/issues/issue-26905.rs",
-"ui/issues/issue-26948.rs",
-"ui/issues/issue-27008.rs",
-"ui/issues/issue-27033.rs",
-"ui/issues/issue-27042.rs",
-"ui/issues/issue-27054-primitive-binary-ops.rs",
-"ui/issues/issue-27078.rs",
-"ui/issues/issue-2708.rs",
-"ui/issues/issue-2723-b.rs",
-"ui/issues/issue-27240.rs",
-"ui/issues/issue-27268.rs",
-"ui/issues/issue-27340.rs",
-"ui/issues/issue-27401-dropflag-reinit.rs",
-"ui/issues/issue-27592.rs",
-"ui/issues/issue-27639.rs",
-"ui/issues/issue-27815.rs",
-"ui/issues/issue-27842.rs",
-"ui/issues/issue-27859.rs",
-"ui/issues/issue-27942.rs",
-"ui/issues/issue-27949.rs",
-"ui/issues/issue-27997.rs",
-"ui/issues/issue-28105.rs",
-"ui/issues/issue-28109.rs",
-"ui/issues/issue-28181.rs",
-"ui/issues/issue-2823.rs",
-"ui/issues/issue-28344.rs",
-"ui/issues/issue-28433.rs",
-"ui/issues/issue-28472.rs",
-"ui/issues/issue-2848.rs",
-"ui/issues/issue-2849.rs",
-"ui/issues/issue-28498-must-work-ex1.rs",
-"ui/issues/issue-28498-must-work-ex2.rs",
-"ui/issues/issue-28498-ugeh-ex1.rs",
-"ui/issues/issue-28550.rs",
-"ui/issues/issue-28568.rs",
-"ui/issues/issue-28586.rs",
-"ui/issues/issue-28625.rs",
-"ui/issues/issue-28777.rs",
-"ui/issues/issue-28828.rs",
-"ui/issues/issue-28839.rs",
-"ui/issues/issue-2895.rs",
-"ui/issues/issue-28971.rs",
-"ui/issues/issue-28983.rs",
-"ui/issues/issue-28992-empty.rs",
-"ui/issues/issue-2904.rs",
-"ui/issues/issue-29053.rs",
-"ui/issues/issue-29071-2.rs",
-"ui/issues/issue-29092.rs",
-"ui/issues/issue-29147-rpass.rs",
-"ui/issues/issue-29147.rs",
-"ui/issues/issue-29181.rs",
-"ui/issues/issue-2935.rs",
-"ui/issues/issue-29466.rs",
-"ui/issues/issue-29485.rs",
-"ui/issues/issue-2951.rs",
-"ui/issues/issue-29522.rs",
-"ui/issues/issue-29540.rs",
-"ui/issues/issue-29663.rs",
-"ui/issues/issue-29668.rs",
-"ui/issues/issue-29723.rs",
-"ui/issues/issue-29746.rs",
-"ui/issues/issue-29821.rs",
-"ui/issues/issue-29861.rs",
-"ui/issues/issue-2989.rs",
-"ui/issues/issue-29948.rs",
-"ui/issues/issue-2995.rs",
-"ui/issues/issue-30007.rs",
-"ui/issues/issue-30018-panic.rs",
-"ui/issues/issue-30081.rs",
-"ui/issues/issue-3012-2.rs",
-"ui/issues/issue-30123.rs",
-"ui/issues/issue-3021-b.rs",
-"ui/issues/issue-3021-d.rs",
-"ui/issues/issue-30236.rs",
-"ui/issues/issue-30255.rs",
-"ui/issues/issue-3026.rs",
-"ui/issues/issue-3037.rs",
-"ui/issues/issue-30371.rs",
-"ui/issues/issue-3038.rs",
-"ui/issues/issue-30490.rs",
-"ui/issues/issue-3052.rs",
-"ui/issues/issue-30530.rs",
-"ui/issues/issue-30589.rs",
-"ui/issues/issue-30615.rs",
-"ui/issues/issue-30756.rs",
-"ui/issues/issue-30891.rs",
-"ui/issues/issue-3091.rs",
-"ui/issues/issue-31011.rs",
-"ui/issues/issue-3109.rs",
-"ui/issues/issue-3121.rs",
-"ui/issues/issue-31267-additional.rs",
-"ui/issues/issue-31267.rs",
-"ui/issues/issue-31299.rs",
-"ui/issues/issue-3136-b.rs",
-"ui/issues/issue-31511.rs",
-"ui/issues/issue-3154.rs",
-"ui/issues/issue-31702.rs",
-"ui/issues/issue-31769.rs",
-"ui/issues/issue-31776.rs",
-"ui/issues/issue-31910.rs",
-"ui/issues/issue-32004.rs",
-"ui/issues/issue-32008.rs",
-"ui/issues/issue-32086.rs",
-"ui/issues/issue-3214.rs",
-"ui/issues/issue-3220.rs",
-"ui/issues/issue-32292.rs",
-"ui/issues/issue-32323.rs",
-"ui/issues/issue-32326.rs",
-"ui/issues/issue-32377.rs",
-"ui/issues/issue-32389.rs",
-"ui/issues/issue-32518.rs",
-"ui/issues/issue-32655.rs",
-"ui/issues/issue-32709.rs",
-"ui/issues/issue-32782.rs",
-"ui/issues/issue-32805.rs",
-"ui/issues/issue-3290.rs",
-"ui/issues/issue-32950.rs",
-"ui/issues/issue-32995-2.rs",
-"ui/issues/issue-32995.rs",
-"ui/issues/issue-33187.rs",
-"ui/issues/issue-33202.rs",
-"ui/issues/issue-33287.rs",
-"ui/issues/issue-33293.rs",
-"ui/issues/issue-33387.rs",
-"ui/issues/issue-3344.rs",
-"ui/issues/issue-33461.rs",
-"ui/issues/issue-33504.rs",
-"ui/issues/issue-33525.rs",
-"ui/issues/issue-33571.rs",
-"ui/issues/issue-33687.rs",
-"ui/issues/issue-33770.rs",
-"ui/issues/issue-3389.rs",
-"ui/issues/issue-33992.rs",
-"ui/issues/issue-34047.rs",
-"ui/issues/issue-34074.rs",
-"ui/issues/issue-34209.rs",
-"ui/issues/issue-34229.rs",
-"ui/issues/issue-3429.rs",
-"ui/issues/issue-34334.rs",
-"ui/issues/issue-34349.rs",
-"ui/issues/issue-34373.rs",
-"ui/issues/issue-34427.rs",
-"ui/issues/issue-3447.rs",
-"ui/issues/issue-34503.rs",
-"ui/issues/issue-34571.rs",
-"ui/issues/issue-3477.rs",
-"ui/issues/issue-34796.rs",
-"ui/issues/issue-3500.rs",
-"ui/issues/issue-35139.rs",
-"ui/issues/issue-35241.rs",
-"ui/issues/issue-35423.rs",
-"ui/issues/issue-3556.rs",
-"ui/issues/issue-3559.rs",
-"ui/issues/issue-35600.rs",
-"ui/issues/issue-3563-3.rs",
-"ui/issues/issue-3574.rs",
-"ui/issues/issue-35815.rs",
-"ui/issues/issue-35988.rs",
-"ui/issues/issue-36023.rs",
-"ui/issues/issue-36036-associated-type-layout.rs",
-"ui/issues/issue-36260.rs",
-"ui/issues/issue-36278-prefix-nesting.rs",
-"ui/issues/issue-36299.rs",
-"ui/issues/issue-36400.rs",
-"ui/issues/issue-36401.rs",
-"ui/issues/issue-36474.rs",
-"ui/issues/issue-3668.rs",
-"ui/issues/issue-36744-bitcast-args-if-needed.rs",
-"ui/issues/issue-36786-resolve-call.rs",
-"ui/issues/issue-3680.rs",
-"ui/issues/issue-36816.rs",
-"ui/issues/issue-36836.rs",
-"ui/issues/issue-36936.rs",
-"ui/issues/issue-36954.rs",
-"ui/issues/issue-3702-2.rs",
-"ui/issues/issue-3702.rs",
-"ui/issues/issue-3707.rs",
-"ui/issues/issue-37109.rs",
-"ui/issues/issue-3743.rs",
-"ui/issues/issue-3753.rs",
-"ui/issues/issue-37534.rs",
-"ui/issues/issue-37576.rs",
-"ui/issues/issue-3763.rs",
-"ui/issues/issue-37686.rs",
-"ui/issues/issue-37725.rs",
-"ui/issues/issue-37733.rs",
-"ui/issues/issue-3779.rs",
-"ui/issues/issue-37884.rs",
-"ui/issues/issue-38190.rs",
-"ui/issues/issue-38412.rs",
-"ui/issues/issue-38437.rs",
-"ui/issues/issue-38458.rs",
-"ui/issues/issue-3847.rs",
-"ui/issues/issue-38556.rs",
-"ui/issues/issue-38727.rs",
-"ui/issues/issue-3874.rs",
-"ui/issues/issue-38763.rs",
-"ui/issues/issue-3878.rs",
-"ui/issues/issue-38857.rs",
-"ui/issues/issue-38919.rs",
-"ui/issues/issue-38942.rs",
-"ui/issues/issue-3895.rs",
-"ui/issues/issue-38954.rs",
-"ui/issues/issue-38987.rs",
-"ui/issues/issue-39175.rs",
-"ui/issues/issue-39211.rs",
-"ui/issues/issue-39548.rs",
-"ui/issues/issue-39687.rs",
-"ui/issues/issue-39709.rs",
-"ui/issues/issue-3979-generics.rs",
-"ui/issues/issue-3979-xcrate.rs",
-"ui/issues/issue-3979.rs",
-"ui/issues/issue-39808.rs",
-"ui/issues/issue-39827.rs",
-"ui/issues/issue-39848.rs",
-"ui/issues/issue-3993.rs",
-"ui/issues/issue-39970.rs",
-"ui/issues/issue-40000.rs",
-"ui/issues/issue-40085.rs",
-"ui/issues/issue-40235.rs",
-"ui/issues/issue-40288-2.rs",
-"ui/issues/issue-40288.rs",
-"ui/issues/issue-40408.rs",
-"ui/issues/issue-40510-1.rs",
-"ui/issues/issue-40510-3.rs",
-"ui/issues/issue-40610.rs",
-"ui/issues/issue-40749.rs",
-"ui/issues/issue-40827.rs",
-"ui/issues/issue-40845.rs",
-"ui/issues/issue-40861.rs",
-"ui/issues/issue-40883.rs",
-"ui/issues/issue-40951.rs",
-"ui/issues/issue-41053.rs",
-"ui/issues/issue-41139.rs",
-"ui/issues/issue-41213.rs",
-"ui/issues/issue-41229-ref-str.rs",
-"ui/issues/issue-41479.rs",
-"ui/issues/issue-41498.rs",
-"ui/issues/issue-41549.rs",
-"ui/issues/issue-41604.rs",
-"ui/issues/issue-41677.rs",
-"ui/issues/issue-41696.rs",
-"ui/issues/issue-41726.rs",
-"ui/issues/issue-41742.rs",
-"ui/issues/issue-41744.rs",
-"ui/issues/issue-41849-variance-req.rs",
-"ui/issues/issue-41880.rs",
-"ui/issues/issue-41888.rs",
-"ui/issues/issue-41974.rs",
-"ui/issues/issue-42007.rs",
-"ui/issues/issue-4208.rs",
-"ui/issues/issue-42106.rs",
-"ui/issues/issue-42148.rs",
-"ui/issues/issue-4228.rs",
-"ui/issues/issue-42312.rs",
-"ui/issues/issue-42453.rs",
-"ui/issues/issue-4252.rs",
-"ui/issues/issue-42552.rs",
-"ui/issues/issue-4265.rs",
-"ui/issues/issue-42755.rs",
-"ui/issues/issue-42796.rs",
-"ui/issues/issue-42880.rs",
-"ui/issues/issue-43162.rs",
-"ui/issues/issue-43205.rs",
-"ui/issues/issue-43250.rs",
-"ui/issues/issue-43291.rs",
-"ui/issues/issue-4333.rs",
-"ui/issues/issue-4335.rs",
-"ui/issues/issue-43355.rs",
-"ui/issues/issue-43420-no-over-suggest.rs",
-"ui/issues/issue-43424.rs",
-"ui/issues/issue-43431.rs",
-"ui/issues/issue-43692.rs",
-"ui/issues/issue-43853.rs",
-"ui/issues/issue-4387.rs",
-"ui/issues/issue-43910.rs",
-"ui/issues/issue-43923.rs",
-"ui/issues/issue-43925.rs",
-"ui/issues/issue-43926.rs",
-"ui/issues/issue-43988.rs",
-"ui/issues/issue-44023.rs",
-"ui/issues/issue-44078.rs",
-"ui/issues/issue-44255.rs",
-"ui/issues/issue-44405.rs",
-"ui/issues/issue-4517.rs",
-"ui/issues/issue-4541.rs",
-"ui/issues/issue-4542.rs",
-"ui/issues/issue-4545.rs",
-"ui/issues/issue-45510.rs",
-"ui/issues/issue-45730.rs",
-"ui/issues/issue-45801.rs",
-"ui/issues/issue-45965.rs",
-"ui/issues/issue-46069.rs",
-"ui/issues/issue-46101.rs",
-"ui/issues/issue-46302.rs",
-"ui/issues/issue-46311.rs",
-"ui/issues/issue-46332.rs",
-"ui/issues/issue-46438.rs",
-"ui/issues/issue-46471-1.rs",
-"ui/issues/issue-46472.rs",
-"ui/issues/issue-46604.rs",
-"ui/issues/issue-46771.rs",
-"ui/issues/issue-46983.rs",
-"ui/issues/issue-47073-zero-padded-tuple-struct-indices.rs",
-"ui/issues/issue-47094.rs",
-"ui/issues/issue-47184.rs",
-"ui/issues/issue-4734.rs",
-"ui/issues/issue-4735.rs",
-"ui/issues/issue-4736.rs",
-"ui/issues/issue-47377.rs",
-"ui/issues/issue-47380.rs",
-"ui/issues/issue-47486.rs",
-"ui/issues/issue-4759-1.rs",
-"ui/issues/issue-4759.rs",
-"ui/issues/issue-47638.rs",
-"ui/issues/issue-47715.rs",
-"ui/issues/issue-47725.rs",
-"ui/issues/issue-48006.rs",
-"ui/issues/issue-48132.rs",
-"ui/issues/issue-48159.rs",
-"ui/issues/issue-48276.rs",
-"ui/issues/issue-48364.rs",
-"ui/issues/issue-48728.rs",
-"ui/issues/issue-4875.rs",
-"ui/issues/issue-48838.rs",
-"ui/issues/issue-48984.rs",
-"ui/issues/issue-49298.rs",
-"ui/issues/issue-4935.rs",
-"ui/issues/issue-49632.rs",
-"ui/issues/issue-4968.rs",
-"ui/issues/issue-4972.rs",
-"ui/issues/issue-49824.rs",
-"ui/issues/issue-49854.rs",
-"ui/issues/issue-49919.rs",
-"ui/issues/issue-49934-errors.rs",
-"ui/issues/issue-49934.rs",
-"ui/issues/issue-49955.rs",
-"ui/issues/issue-49973.rs",
-"ui/issues/issue-5008-borrowed-traitobject-method-call.rs",
-"ui/issues/issue-50403.rs",
-"ui/issues/issue-50415.rs",
-"ui/issues/issue-50442.rs",
-"ui/issues/issue-50581.rs",
-"ui/issues/issue-50582.rs",
-"ui/issues/issue-50585.rs",
-"ui/issues/issue-50600.rs",
-"ui/issues/issue-50618.rs",
-"ui/issues/issue-5062.rs",
-"ui/issues/issue-50688.rs",
-"ui/issues/issue-50714-1.rs",
-"ui/issues/issue-50714.rs",
-"ui/issues/issue-50761.rs",
-"ui/issues/issue-50781.rs",
-"ui/issues/issue-50802.rs",
-"ui/issues/issue-5100.rs",
-"ui/issues/issue-51022.rs",
-"ui/issues/issue-51044.rs",
-"ui/issues/issue-51102.rs",
-"ui/issues/issue-51116.rs",
-"ui/issues/issue-51154.rs",
-"ui/issues/issue-51515.rs",
-"ui/issues/issue-5153.rs",
-"ui/issues/issue-51632-try-desugar-incompatible-types.rs",
-"ui/issues/issue-51874.rs",
-"ui/issues/issue-5192.rs",
-"ui/issues/issue-51947.rs",
-"ui/issues/issue-52049.rs",
-"ui/issues/issue-52126-assign-op-invariance.rs",
-"ui/issues/issue-52262.rs",
-"ui/issues/issue-5239-1.rs",
-"ui/issues/issue-5239-2.rs",
-"ui/issues/issue-52533.rs",
-"ui/issues/issue-52717.rs",
-"ui/issues/issue-5280.rs",
-"ui/issues/issue-5315.rs",
-"ui/issues/issue-5321-immediates-with-bare-self.rs",
-"ui/issues/issue-53251.rs",
-"ui/issues/issue-53275.rs",
-"ui/issues/issue-53300.rs",
-"ui/issues/issue-53348.rs",
-"ui/issues/issue-53498.rs",
-"ui/issues/issue-5358-1.rs",
-"ui/issues/issue-53728.rs",
-"ui/issues/issue-53843.rs",
-"ui/issues/issue-54044.rs",
-"ui/issues/issue-54062.rs",
-"ui/issues/issue-5439.rs",
-"ui/issues/issue-54410.rs",
-"ui/issues/issue-54477-reduced-2.rs",
-"ui/issues/issue-54696.rs",
-"ui/issues/issue-5518.rs",
-"ui/issues/issue-5521.rs",
-"ui/issues/issue-55376.rs",
-"ui/issues/issue-55380.rs",
-"ui/issues/issue-5550.rs",
-"ui/issues/issue-5554.rs",
-"ui/issues/issue-55587.rs",
-"ui/issues/issue-55731.rs",
-"ui/issues/issue-56199.rs",
-"ui/issues/issue-56237.rs",
-"ui/issues/issue-5666.rs",
-"ui/issues/issue-56806.rs",
-"ui/issues/issue-56835.rs",
-"ui/issues/issue-56870.rs",
-"ui/issues/issue-5688.rs",
-"ui/issues/issue-56943.rs",
-"ui/issues/issue-5708.rs",
-"ui/issues/issue-5718.rs",
-"ui/issues/issue-57198-pass.rs",
-"ui/issues/issue-57271.rs",
-"ui/issues/issue-57362-1.rs",
-"ui/issues/issue-57362-2.rs",
-"ui/issues/issue-5741.rs",
-"ui/issues/issue-57741-1.rs",
-"ui/issues/issue-57781.rs",
-"ui/issues/issue-57924.rs",
-"ui/issues/issue-58712.rs",
-"ui/issues/issue-58734.rs",
-"ui/issues/issue-5884.rs",
-"ui/issues/issue-58857.rs",
-"ui/issues/issue-5917.rs",
-"ui/issues/issue-59488.rs",
-"ui/issues/issue-59494.rs",
-"ui/issues/issue-5988.rs",
-"ui/issues/issue-5997-enum.rs",
-"ui/issues/issue-5997-struct.rs",
-"ui/issues/issue-5997.rs",
-"ui/issues/issue-60218.rs",
-"ui/issues/issue-60622.rs",
-"ui/issues/issue-60989.rs",
-"ui/issues/issue-61106.rs",
-"ui/issues/issue-61108.rs",
-"ui/issues/issue-6117.rs",
-"ui/issues/issue-6130.rs",
-"ui/issues/issue-61475.rs",
-"ui/issues/issue-6153.rs",
-"ui/issues/issue-61623.rs",
-"ui/issues/issue-61894.rs",
-"ui/issues/issue-62375.rs",
-"ui/issues/issue-62480.rs",
-"ui/issues/issue-6318.rs",
-"ui/issues/issue-6344-let.rs",
-"ui/issues/issue-6344-match.rs",
-"ui/issues/issue-63983.rs",
-"ui/issues/issue-64559.rs",
-"ui/issues/issue-64792-bad-unicode-ctor.rs",
-"ui/issues/issue-65131.rs",
-"ui/issues/issue-65230.rs",
-"ui/issues/issue-65462.rs",
-"ui/issues/issue-6596-2.rs",
-"ui/issues/issue-66353.rs",
-"ui/issues/issue-6642.rs",
-"ui/issues/issue-66667-function-cmp-cycle.rs",
-"ui/issues/issue-66702-break-outside-loop-val.rs",
-"ui/issues/issue-66706.rs",
-"ui/issues/issue-66923-show-error-for-correct-call.rs",
-"ui/issues/issue-67039-unsound-pin-partialeq.rs",
-"ui/issues/issue-6738.rs",
-"ui/issues/issue-67535.rs",
-"ui/issues/issue-68010-large-zst-consts.rs",
-"ui/issues/issue-68696-catch-during-unwind.rs",
-"ui/issues/issue-6892.rs",
-"ui/issues/issue-69130.rs",
-"ui/issues/issue-6919.rs",
-"ui/issues/issue-69306.rs",
-"ui/issues/issue-6936.rs",
-"ui/issues/issue-69455.rs",
-"ui/issues/issue-69602-type-err-during-codegen-ice.rs",
-"ui/issues/issue-69683.rs",
-"ui/issues/issue-7012.rs",
-"ui/issues/issue-70381.rs",
-"ui/issues/issue-7044.rs",
-"ui/issues/issue-7061.rs",
-"ui/issues/issue-70673.rs",
-"ui/issues/issue-70724-add_type_neq_err_label-unwrap.rs",
-"ui/issues/issue-7092.rs",
-"ui/issues/issue-71406.rs",
-"ui/issues/issue-71676-2.rs",
-"ui/issues/issue-7178.rs",
-"ui/issues/issue-72076.rs",
-"ui/issues/issue-72278.rs",
-"ui/issues/issue-7246.rs",
-"ui/issues/issue-72839-error-overflow.rs",
-"ui/issues/issue-72933-match-stack-overflow.rs",
-"ui/issues/issue-73112.rs",
-"ui/issues/issue-7344.rs",
-"ui/issues/issue-7364.rs",
-"ui/issues/issue-74082.rs",
-"ui/issues/issue-74564-if-expr-stack-overflow.rs",
-"ui/issues/issue-7519-match-unit-in-arg.rs",
-"ui/issues/issue-75283.rs",
-"ui/issues/issue-7563.rs",
-"ui/issues/issue-75704.rs",
-"ui/issues/issue-7575.rs",
-"ui/issues/issue-7607-1.rs",
-"ui/issues/issue-76077.rs",
-"ui/issues/issue-76191.rs",
-"ui/issues/issue-7660.rs",
-"ui/issues/issue-7663.rs",
-"ui/issues/issue-7784.rs",
-"ui/issues/issue-77919.rs",
-"ui/issues/issue-78192.rs",
-"ui/issues/issue-78622.rs",
-"ui/issues/issue-7867.rs",
-"ui/issues/issue-78957.rs",
-"ui/issues/issue-7899.rs",
-"ui/issues/issue-7911.rs",
-"ui/issues/issue-7950.rs",
-"ui/issues/issue-7970a.rs",
-"ui/issues/issue-8044.rs",
-"ui/issues/issue-80607.rs",
-"ui/issues/issue-8248.rs",
-"ui/issues/issue-8249.rs",
-"ui/issues/issue-8259.rs",
-"ui/issues/issue-8391.rs",
-"ui/issues/issue-8401.rs",
-"ui/issues/issue-8498.rs",
-"ui/issues/issue-8506.rs",
-"ui/issues/issue-86756.rs",
-"ui/issues/issue-87199.rs",
-"ui/issues/issue-8727.rs",
-"ui/issues/issue-87490.rs",
-"ui/issues/issue-8761.rs",
-"ui/issues/issue-8767.rs",
-"ui/issues/issue-8783.rs",
-"ui/issues/issue-8860.rs",
-"ui/issues/issue-8898.rs",
-"ui/issues/issue-9047.rs",
-"ui/issues/issue-9123.rs",
-"ui/issues/issue-9129.rs",
-"ui/issues/issue-9155.rs",
-"ui/issues/issue-9188.rs",
-"ui/issues/issue-9243.rs",
-"ui/issues/issue-9259.rs",
-"ui/issues/issue-9382.rs",
-"ui/issues/issue-9446.rs",
-"ui/issues/issue-9575.rs",
-"ui/issues/issue-9719.rs",
-"ui/issues/issue-9725.rs",
-"ui/issues/issue-9737.rs",
-"ui/issues/issue-9814.rs",
-"ui/issues/issue-98299.rs",
-"ui/issues/issue-9837.rs",
-"ui/issues/issue-9906.rs",
-"ui/issues/issue-9918.rs",
-"ui/issues/issue-9942.rs",
-"ui/issues/issue-9951.rs",
-"ui/issues/issue-9968.rs",
-"ui/issues/issue-99838.rs",
-"ui/issues/issue-11047.rs",
-"ui/issues/issue-11709.rs",
-"ui/issues/issue-20644.rs",
-"ui/issues/issue-23808.rs",
-"ui/issues/issue-26997.rs",
-"ui/issues/issue-28600.rs",
-"ui/issues/issue-3656.rs",
-"ui/issues/issue-50811.rs",
-"ui/issues/issue-51907.rs",
-"ui/issues/issue-5754.rs",
-"ui/issues/issue-10396.rs",
-"ui/issues/issue-10456.rs",
-"ui/issues/issue-106755.rs",
-"ui/issues/issue-10853.rs",
-"ui/issues/issue-10902.rs",
-"ui/issues/issue-11085.rs",
-"ui/issues/issue-11384.rs",
-"ui/issues/issue-11592.rs",
-"ui/issues/issue-11740.rs",
-"ui/issues/issue-11869.rs",
-"ui/issues/issue-12729.rs",
-"ui/issues/issue-12920.rs",
-"ui/issues/issue-13105.rs",
-"ui/issues/issue-13167.rs",
-"ui/issues/issue-13202.rs",
-"ui/issues/issue-13405.rs",
-"ui/issues/issue-13482-2.rs",
-"ui/issues/issue-13703.rs",
-"ui/issues/issue-13775.rs",
-"ui/issues/issue-14082.rs",
-"ui/issues/issue-14254.rs",
-"ui/issues/issue-14330.rs",
-"ui/issues/issue-14901.rs",
-"ui/issues/issue-14959.rs",
-"ui/issues/issue-15734.rs",
-"ui/issues/issue-15735.rs",
-"ui/issues/issue-16596.rs",
-"ui/issues/issue-16668.rs",
-"ui/issues/issue-16994.rs",
-"ui/issues/issue-17121.rs",
-"ui/issues/issue-17732.rs",
-"ui/issues/issue-17746.rs",
-"ui/issues/issue-17904.rs",
-"ui/issues/issue-18088.rs",
-"ui/issues/issue-18188.rs",
-"ui/issues/issue-18446-2.rs",
-"ui/issues/issue-18576.rs",
-"ui/issues/issue-18738.rs",
-"ui/issues/issue-18809.rs",
-"ui/issues/issue-18906.rs",
-"ui/issues/issue-18988.rs",
-"ui/issues/issue-19037.rs",
-"ui/issues/issue-19097.rs",
-"ui/issues/issue-19098.rs",
-"ui/issues/issue-19100.rs",
-"ui/issues/issue-19102.rs",
-"ui/issues/issue-19129-1.rs",
-"ui/issues/issue-19129-2.rs",
-"ui/issues/issue-19398.rs",
-"ui/issues/issue-19479.rs",
-"ui/issues/issue-19601.rs",
-"ui/issues/issue-1962.rs",
-"ui/issues/issue-19631.rs",
-"ui/issues/issue-19632.rs",
-"ui/issues/issue-19850.rs",
-"ui/issues/issue-19982.rs",
-"ui/issues/issue-20009.rs",
-"ui/issues/issue-20186.rs",
-"ui/issues/issue-20396.rs",
-"ui/issues/issue-20414.rs",
-"ui/issues/issue-20454.rs",
-"ui/issues/issue-20763-1.rs",
-"ui/issues/issue-20763-2.rs",
-"ui/issues/issue-20971.rs",
-"ui/issues/issue-21140.rs",
-"ui/issues/issue-21174-2.rs",
-"ui/issues/issue-21245.rs",
-"ui/issues/issue-21402.rs",
-"ui/issues/issue-21622.rs",
-"ui/issues/issue-22356.rs",
-"ui/issues/issue-22471.rs",
-"ui/issues/issue-22603.rs",
-"ui/issues/issue-22673.rs",
-"ui/issues/issue-22777.rs",
-"ui/issues/issue-22781.rs",
-"ui/issues/issue-22789.rs",
-"ui/issues/issue-22814.rs",
-"ui/issues/issue-22933-1.rs",
-"ui/issues/issue-2311-2.rs",
-"ui/issues/issue-2311.rs",
-"ui/issues/issue-2312.rs",
-"ui/issues/issue-23354-2.rs",
-"ui/issues/issue-23354.rs",
-"ui/issues/issue-23442.rs",
-"ui/issues/issue-23477.rs",
-"ui/issues/issue-24161.rs",
-"ui/issues/issue-24227.rs",
-"ui/issues/issue-24389.rs",
-"ui/issues/issue-24434.rs",
-"ui/issues/issue-2470-bounds-check-overflow.rs",
-"ui/issues/issue-24945-repeat-dash-opts.rs",
-"ui/issues/issue-2502.rs",
-"ui/issues/issue-25180.rs",
-"ui/issues/issue-25394.rs",
-"ui/issues/issue-25579.rs",
-"ui/issues/issue-26095.rs",
-"ui/issues/issue-2611-3.rs",
-"ui/issues/issue-26186.rs",
-"ui/issues/issue-26205.rs",
-"ui/issues/issue-26484.rs",
-"ui/issues/issue-26614.rs",
-"ui/issues/issue-26646.rs",
-"ui/issues/issue-27105.rs",
-"ui/issues/issue-27281.rs",
-"ui/issues/issue-27433.rs",
-"ui/issues/issue-2761.rs",
-"ui/issues/issue-27697.rs",
-"ui/issues/issue-27889.rs",
-"ui/issues/issue-28279.rs",
-"ui/issues/issue-28561.rs",
-"ui/issues/issue-28776.rs",
-"ui/issues/issue-28936.rs",
-"ui/issues/issue-28999.rs",
-"ui/issues/issue-29030.rs",
-"ui/issues/issue-29037.rs",
-"ui/issues/issue-29048.rs",
-"ui/issues/issue-29071.rs",
-"ui/issues/issue-29265.rs",
-"ui/issues/issue-29276.rs",
-"ui/issues/issue-29516.rs",
-"ui/issues/issue-29710.rs",
-"ui/issues/issue-29740.rs",
-"ui/issues/issue-29743.rs",
-"ui/issues/issue-29857.rs",
-"ui/issues/issue-3029.rs",
-"ui/issues/issue-30380.rs",
-"ui/issues/issue-31260.rs",
-"ui/issues/issue-3149.rs",
-"ui/issues/issue-32122-1.rs",
-"ui/issues/issue-32122-2.rs",
-"ui/issues/issue-32324.rs",
-"ui/issues/issue-32797.rs",
-"ui/issues/issue-33096.rs",
-"ui/issues/issue-33241.rs",
-"ui/issues/issue-33941.rs",
-"ui/issues/issue-3424.rs",
-"ui/issues/issue-34418.rs",
-"ui/issues/issue-34569.rs",
-"ui/issues/issue-34721.rs",
-"ui/issues/issue-34751.rs",
-"ui/issues/issue-34780.rs",
-"ui/issues/issue-34839.rs",
-"ui/issues/issue-3521-2.rs",
-"ui/issues/issue-35976.rs",
-"ui/issues/issue-36075.rs",
-"ui/issues/issue-3609.rs",
-"ui/issues/issue-36116.rs",
-"ui/issues/issue-36379.rs",
-"ui/issues/issue-3668-2.rs",
-"ui/issues/issue-36839.rs",
-"ui/issues/issue-36856.rs",
-"ui/issues/issue-37051.rs",
-"ui/issues/issue-37131.rs",
-"ui/issues/issue-37510.rs",
-"ui/issues/issue-37598.rs",
-"ui/issues/issue-37665.rs",
-"ui/issues/issue-38160.rs",
-"ui/issues/issue-38226.rs",
-"ui/issues/issue-38381.rs",
-"ui/issues/issue-3888-2.rs",
-"ui/issues/issue-39089.rs",
-"ui/issues/issue-39367.rs",
-"ui/issues/issue-39467.rs",
-"ui/issues/issue-3979-2.rs",
-"ui/issues/issue-3991.rs",
-"ui/issues/issue-39984.rs",
-"ui/issues/issue-40136.rs",
-"ui/issues/issue-4025.rs",
-"ui/issues/issue-40350.rs",
-"ui/issues/issue-40510-2.rs",
-"ui/issues/issue-40510-4.rs",
-"ui/issues/issue-40782.rs",
-"ui/issues/issue-41272.rs",
-"ui/issues/issue-41298.rs",
-"ui/issues/issue-41628.rs",
-"ui/issues/issue-41936-variance-coerce-unsized-cycle.rs",
-"ui/issues/issue-41998.rs",
-"ui/issues/issue-42210.rs",
-"ui/issues/issue-42467.rs",
-"ui/issues/issue-42956.rs",
-"ui/issues/issue-43057.rs",
-"ui/issues/issue-43357.rs",
-"ui/issues/issue-43483.rs",
-"ui/issues/issue-43806.rs",
-"ui/issues/issue-44056.rs",
-"ui/issues/issue-44216-add-instant.rs",
-"ui/issues/issue-44216-add-system-time.rs",
-"ui/issues/issue-44216-sub-instant.rs",
-"ui/issues/issue-44216-sub-system-time.rs",
-"ui/issues/issue-44239.rs",
-"ui/issues/issue-44247.rs",
-"ui/issues/issue-4464.rs",
-"ui/issues/issue-44730.rs",
-"ui/issues/issue-44851.rs",
-"ui/issues/issue-45425.rs",
-"ui/issues/issue-45562.rs",
-"ui/issues/issue-45697-1.rs",
-"ui/issues/issue-45697.rs",
-"ui/issues/issue-45731.rs",
-"ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.rs",
-"ui/issues/issue-46855.rs",
-"ui/issues/issue-46964.rs",
-"ui/issues/issue-47309.rs",
-"ui/issues/issue-47364.rs",
-"ui/issues/issue-47673.rs",
-"ui/issues/issue-47703-1.rs",
-"ui/issues/issue-47703-tuple.rs",
-"ui/issues/issue-47703.rs",
-"ui/issues/issue-47722.rs",
-"ui/issues/issue-48131.rs",
-"ui/issues/issue-4830.rs",
-"ui/issues/issue-49544.rs",
-"ui/issues/issue-50187.rs",
-"ui/issues/issue-50411.rs",
-"ui/issues/issue-50471.rs",
-"ui/issues/issue-50518.rs",
-"ui/issues/issue-50571.rs",
-"ui/issues/issue-5067.rs",
-"ui/issues/issue-51655.rs",
-"ui/issues/issue-51798.rs",
-"ui/issues/issue-52489.rs",
-"ui/issues/issue-53333.rs",
-"ui/issues/issue-53419.rs",
-"ui/issues/issue-53568.rs",
-"ui/issues/issue-54094.rs",
-"ui/issues/issue-54462-mutable-noalias-correctness.rs",
-"ui/issues/issue-5572.rs",
-"ui/issues/issue-56128.rs",
-"ui/issues/issue-56175.rs",
-"ui/issues/issue-56229.rs",
-"ui/issues/issue-57156.rs",
-"ui/issues/issue-57162.rs",
-"ui/issues/issue-57399-self-return-impl-trait.rs",
-"ui/issues/issue-57741.rs",
-"ui/issues/issue-58212.rs",
-"ui/issues/issue-58344.rs",
-"ui/issues/issue-58375-monomorphize-default-impls.rs",
-"ui/issues/issue-5844.rs",
-"ui/issues/issue-58463.rs",
-"ui/issues/issue-5900.rs",
-"ui/issues/issue-59020.rs",
-"ui/issues/issue-59326.rs",
-"ui/issues/issue-5950.rs",
-"ui/issues/issue-59756.rs",
-"ui/issues/issue-64430.rs",
-"ui/issues/issue-64593.rs",
-"ui/issues/issue-6557.rs",
-"ui/issues/issue-65634-raw-ident-suggestion.rs",
-"ui/issues/issue-66308.rs",
-"ui/issues/issue-66768.rs",
-"ui/issues/issue-68951.rs",
-"ui/issues/issue-6898.rs",
-"ui/issues/issue-69225-SCEVAddExpr-wrap-flag.rs",
-"ui/issues/issue-69225-layout-repeated-checked-add.rs",
-"ui/issues/issue-70746.rs",
-"ui/issues/issue-71676-1.rs",
-"ui/issues/issue-72002.rs",
-"ui/issues/issue-7268.rs",
-"ui/issues/issue-73229.rs",
-"ui/issues/issue-76042.rs",
-"ui/issues/issue-7607-2.rs",
-"ui/issues/issue-76077-1.rs",
-"ui/issues/issue-7673-cast-generically-implemented-trait.rs",
-"ui/issues/issue-81584.rs",
-"ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs",
-"ui/issues/issue-81918.rs",
-"ui/issues/issue-82833-slice-miscompile.rs",
-"ui/issues/issue-83048.rs",
-"ui/issues/issue-8398.rs",
-"ui/issues/issue-8521.rs",
-"ui/issues/issue-8578.rs",
-"ui/issues/issue-87707.rs",
-"ui/issues/issue-88150.rs",
-"ui/issues/issue-9110.rs",
-"ui/issues/issue-91489.rs",
-"ui/issues/issue-9249.rs",
-"ui/issues/issue-92741.rs",
-"ui/issues/issue-12133-3.rs",
-"ui/issues/issue-18389.rs",
-"ui/issues/issue-35570.rs",
-"ui/issues/issue-51714.rs",
-"ui/issues/issue-5883.rs",
-"ui/issues/issue-67552.rs",
-"ui/issues/issue-85461.rs",
-"ui/iterators/issue-28098.rs",
-"ui/iterators/issue-58952-filter-type-length.rs",
-"ui/lang-items/issue-31076.rs",
-"ui/lang-items/issue-83471.rs",
-"ui/lang-items/issue-86238.rs",
-"ui/lang-items/issue-87573.rs",
-"ui/lang-items/issue-19660.rs",
-"ui/late-bound-lifetimes/issue-36381.rs",
-"ui/late-bound-lifetimes/issue-80618.rs",
-"ui/late-bound-lifetimes/issue-47511.rs",
-"ui/layout/issue-60431-unsized-tail-behind-projection.rs",
-"ui/layout/issue-84108.rs",
-"ui/layout/issue-113941.rs",
-"ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs",
-"ui/layout/issue-96185-overaligned-enum.rs",
-"ui/layout/issue-112048-unsizing-field-order.rs",
-"ui/layout/issue-112048-unsizing-niche.rs",
-"ui/let-else/issue-94176.rs",
-"ui/let-else/issue-100103.rs",
-"ui/let-else/issue-102317.rs",
-"ui/let-else/issue-99975.rs",
-"ui/lifetimes/auxiliary/issue-91763-aux.rs",
-"ui/lifetimes/lifetime-errors/issue_74400.rs",
-"ui/lifetimes/issue-105675.rs",
-"ui/lifetimes/issue-107492-default-value-for-lifetime.rs",
-"ui/lifetimes/issue-107988.rs",
-"ui/lifetimes/issue-17728.rs",
-"ui/lifetimes/issue-26638.rs",
-"ui/lifetimes/issue-34979.rs",
-"ui/lifetimes/issue-36744-without-calls.rs",
-"ui/lifetimes/issue-55796.rs",
-"ui/lifetimes/issue-64173-unused-lifetimes.rs",
-"ui/lifetimes/issue-79187-2.rs",
-"ui/lifetimes/issue-79187.rs",
-"ui/lifetimes/issue-83753-invalid-associated-type-supertrait-hrtb.rs",
-"ui/lifetimes/issue-83907-invalid-fn-like-path.rs",
-"ui/lifetimes/issue-90600-expected-return-static-indirect.rs",
-"ui/lifetimes/issue-91763.rs",
-"ui/lifetimes/issue-95023.rs",
-"ui/lifetimes/issue-97193.rs",
-"ui/lifetimes/issue-97194.rs",
-"ui/lifetimes/issue-103582-hint-for-missing-lifetime-bound-on-trait-object-using-type-alias.rs",
-"ui/lifetimes/issue-104432-unused-lifetimes-in-expansion.rs",
-"ui/lifetimes/issue-105227.rs",
-"ui/lifetimes/issue-105507.rs",
-"ui/lifetimes/issue-54378.rs",
-"ui/lifetimes/issue-67498.rs",
-"ui/lifetimes/issue-69314.rs",
-"ui/lifetimes/issue-70917-lifetimes-in-fn-def.rs",
-"ui/lifetimes/issue-76168-hr-outlives-2.rs",
-"ui/lifetimes/issue-76168-hr-outlives.rs",
-"ui/lifetimes/issue-77175.rs",
-"ui/lifetimes/issue-83737-binders-across-types.rs",
-"ui/lifetimes/issue-83737-erasing-bound-vars.rs",
-"ui/lifetimes/issue-84398.rs",
-"ui/lifetimes/issue-84604.rs",
-"ui/lifetimes/issue-90170-elision-mismatch.rs",
-"ui/lifetimes/issue-93911.rs",
-"ui/limits/issue-75158-64.rs",
-"ui/limits/issue-55878.rs",
-"ui/limits/issue-69485-var-size-diffs-too-large.rs",
-"ui/limits/issue-15919-32.rs",
-"ui/limits/issue-15919-64.rs",
-"ui/limits/issue-17913.rs",
-"ui/limits/issue-56762.rs",
-"ui/linkage-attr/issue-109144.rs",
-"ui/linkage-attr/issue-10755.rs",
-"ui/lint/dead-code/issue-59003.rs",
-"ui/lint/dead-code/issue-68408-false-positive.rs",
-"ui/lint/dead-code/issue-85071-2.rs",
-"ui/lint/dead-code/issue-85071.rs",
-"ui/lint/dead-code/issue-85255.rs",
-"ui/lint/must_not_suspend/issue-89562.rs",
-"ui/lint/unused/issue-105061-array-lint.rs",
-"ui/lint/unused/issue-105061-should-lint.rs",
-"ui/lint/unused/issue-105061.rs",
-"ui/lint/unused/issue-30730.rs",
-"ui/lint/unused/issue-46576.rs",
-"ui/lint/unused/issue-59896.rs",
-"ui/lint/unused/issue-67691-unused-field-in-or-pattern.rs",
-"ui/lint/unused/issue-74883-unused-paren-baren-yield.rs",
-"ui/lint/unused/issue-85913.rs",
-"ui/lint/unused/issue-90807-unused-paren-error.rs",
-"ui/lint/unused/issue-92751.rs",
-"ui/lint/unused/issue-96606.rs",
-"ui/lint/unused/issue-103320-must-use-ops.rs",
-"ui/lint/unused/issue-104397.rs",
-"ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.rs",
-"ui/lint/unused/issue-54180-unused-ref-field.rs",
-"ui/lint/unused/issue-54538-unused-parens-lint.rs",
-"ui/lint/unused/issue-70041.rs",
-"ui/lint/unused/issue-71290-unused-paren-binop.rs",
-"ui/lint/unused/issue-81314-unused-span-ident.rs",
-"ui/lint/unused/issue-88519-unused-paren.rs",
-"ui/lint/unused/issue-90807-unused-paren.rs",
-"ui/lint/use-redundant/issue-92904.rs",
-"ui/lint/issue-104392.rs",
-"ui/lint/issue-106991.rs",
-"ui/lint/issue-109152.rs",
-"ui/lint/issue-111359.rs",
-"ui/lint/issue-14309.rs",
-"ui/lint/issue-17718-const-naming.rs",
-"ui/lint/issue-1866.rs",
-"ui/lint/issue-20343.rs",
-"ui/lint/issue-30302.rs",
-"ui/lint/issue-34798.rs",
-"ui/lint/issue-35075.rs",
-"ui/lint/issue-49588-non-shorthand-field-patterns-in-pattern-macro.rs",
-"ui/lint/issue-63364.rs",
-"ui/lint/issue-66362-no-snake-case-warning-for-field-puns.rs",
-"ui/lint/issue-79744.rs",
-"ui/lint/issue-97094.rs",
-"ui/lint/issue-101284.rs",
-"ui/lint/issue-102705.rs",
-"ui/lint/issue-103317.rs",
-"ui/lint/issue-103435-extra-parentheses.rs",
-"ui/lint/issue-104897.rs",
-"ui/lint/issue-108155.rs",
-"ui/lint/issue-109529.rs",
-"ui/lint/issue-110573.rs",
-"ui/lint/issue-112489.rs",
-"ui/lint/issue-14837.rs",
-"ui/lint/issue-31924-non-snake-ffi.rs",
-"ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs",
-"ui/lint/issue-54099-camel-case-underscore-types.rs",
-"ui/lint/issue-57410-1.rs",
-"ui/lint/issue-57410.rs",
-"ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs",
-"ui/lint/issue-79546-fuel-ice.rs",
-"ui/lint/issue-80988.rs",
-"ui/lint/issue-81218.rs",
-"ui/lint/issue-83477.rs",
-"ui/lint/issue-86600-lint-twice.rs",
-"ui/lint/issue-87274-paren-parent.rs",
-"ui/lint/issue-89469.rs",
-"ui/lint/issue-90614-accept-allow-text-direction-codepoint-in-comment-lint.rs",
-"ui/lint/issue-99387.rs",
-"ui/loops/issue-50576.rs",
-"ui/loops/issue-82916.rs",
-"ui/lowering/issue-96847.rs",
-"ui/lto/issue-105637.rs",
-"ui/lto/issue-100772.rs",
-"ui/lto/issue-11154.rs",
-"ui/macros/auxiliary/issue-100199.rs",
-"ui/macros/auxiliary/issue-19163.rs",
-"ui/macros/auxiliary/issue-40469.rs",
-"ui/macros/auxiliary/issue-75982.rs",
-"ui/macros/issue-100199.rs",
-"ui/macros/issue-102878.rs",
-"ui/macros/issue-103529.rs",
-"ui/macros/issue-104769-concat_bytes-invalid-literal.rs",
-"ui/macros/issue-105011.rs",
-"ui/macros/issue-10536.rs",
-"ui/macros/issue-106837.rs",
-"ui/macros/issue-109237.rs",
-"ui/macros/issue-111749.rs",
-"ui/macros/issue-16098.rs",
-"ui/macros/issue-19163.rs",
-"ui/macros/issue-21356.rs",
-"ui/macros/issue-22463.rs",
-"ui/macros/issue-25274.rs",
-"ui/macros/issue-25385.rs",
-"ui/macros/issue-26094.rs",
-"ui/macros/issue-26322.rs",
-"ui/macros/issue-29084.rs",
-"ui/macros/issue-30143.rs",
-"ui/macros/issue-33185.rs",
-"ui/macros/issue-34421-mac-expr-bad-stmt-good-add-semi.rs",
-"ui/macros/issue-35450.rs",
-"ui/macros/issue-37175.rs",
-"ui/macros/issue-38715.rs",
-"ui/macros/issue-39388.rs",
-"ui/macros/issue-39404.rs",
-"ui/macros/issue-40469.rs",
-"ui/macros/issue-40770.rs",
-"ui/macros/issue-41776.rs",
-"ui/macros/issue-41803.rs",
-"ui/macros/issue-44127.rs",
-"ui/macros/issue-5060.rs",
-"ui/macros/issue-51848.rs",
-"ui/macros/issue-52169.rs",
-"ui/macros/issue-54441.rs",
-"ui/macros/issue-58490.rs",
-"ui/macros/issue-61033-1.rs",
-"ui/macros/issue-61033-2.rs",
-"ui/macros/issue-61053-different-kleene.rs",
-"ui/macros/issue-61053-duplicate-binder.rs",
-"ui/macros/issue-61053-missing-repetition.rs",
-"ui/macros/issue-61053-unbound.rs",
-"ui/macros/issue-6596-1.rs",
-"ui/macros/issue-68060.rs",
-"ui/macros/issue-69396-const-no-type-in-macro.rs",
-"ui/macros/issue-78325-inconsistent-resolution.rs",
-"ui/macros/issue-78333.rs",
-"ui/macros/issue-81006.rs",
-"ui/macros/issue-83340.rs",
-"ui/macros/issue-83344.rs",
-"ui/macros/issue-84195-lint-anon-const.rs",
-"ui/macros/issue-84632-eager-expansion-recursion-limit.rs",
-"ui/macros/issue-86865.rs",
-"ui/macros/issue-8709.rs",
-"ui/macros/issue-8851.rs",
-"ui/macros/issue-92267.rs",
-"ui/macros/issue-98790.rs",
-"ui/macros/issue-112342-1.rs",
-"ui/macros/issue-112342-2.rs",
-"ui/macros/issue-2804-2.rs",
-"ui/macros/issue-34171.rs",
-"ui/macros/issue-42954.rs",
-"ui/macros/issue-57597.rs",
-"ui/macros/issue-63102.rs",
-"ui/macros/issue-68058.rs",
-"ui/macros/issue-69838-mods-relative-to-included-path.rs",
-"ui/macros/issue-70446.rs",
-"ui/macros/issue-75982-foreign-macro-weird-mod.rs",
-"ui/macros/issue-77475.rs",
-"ui/macros/issue-78892-substitution-in-statement-attr.rs",
-"ui/macros/issue-84429-matches-edition.rs",
-"ui/macros/issue-86082-option-env-invalid-char.rs",
-"ui/macros/issue-87877.rs",
-"ui/macros/issue-88206.rs",
-"ui/macros/issue-88228.rs",
-"ui/macros/issue-95267.rs",
-"ui/macros/issue-95533.rs",
-"ui/macros/issue-98466-allow.rs",
-"ui/macros/issue-98466.rs",
-"ui/macros/issue-99261.rs",
-"ui/macros/issue-99265.rs",
-"ui/macros/issue-99907.rs",
-"ui/malformed/issue-69341-malformed-derive-inert.rs",
-"ui/malformed/issue-107423-unused-delim-only-one-no-pair.rs",
-"ui/marker_trait_attr/issue-61651-type-mismatch.rs",
-"ui/match/issue-11319.rs",
-"ui/match/issue-11940.rs",
-"ui/match/issue-12552.rs",
-"ui/match/issue-18060.rs",
-"ui/match/issue-26251.rs",
-"ui/match/issue-26996.rs",
-"ui/match/issue-27021.rs",
-"ui/match/issue-33498.rs",
-"ui/match/issue-41255.rs",
-"ui/match/issue-42679.rs",
-"ui/match/issue-46920-byte-array-patterns.rs",
-"ui/match/issue-5530.rs",
-"ui/match/issue-56685.rs",
-"ui/match/issue-72680.rs",
-"ui/match/issue-72896.rs",
-"ui/match/issue-74050-end-span.rs",
-"ui/match/issue-82866.rs",
-"ui/match/issue-91058.rs",
-"ui/match/issue-92100.rs",
-"ui/match/issue-112438.rs",
-"ui/match/issue-70972-dyn-trait.rs",
-"ui/match/issue-82392.rs",
-"ui/match/issue-84434.rs",
-"ui/match/issue-113012.rs",
-"ui/methods/issues/issue-105732.rs",
-"ui/methods/issues/issue-61525.rs",
-"ui/methods/issues/issue-84495.rs",
-"ui/methods/issues/issue-90315.rs",
-"ui/methods/issues/issue-94581.rs",
-"ui/mir/auxiliary/issue_76375_aux.rs",
-"ui/mir/validate/issue-95978-validator-lifetime-comparison.rs",
-"ui/mir/issue-102389.rs",
-"ui/mir/issue-107678-projection-with-lifetime.rs",
-"ui/mir/issue-29227.rs",
-"ui/mir/issue-67947.rs",
-"ui/mir/issue-75419-validation-impl-trait.rs",
-"ui/mir/issue-76803-branches-not-same.rs",
-"ui/mir/issue-77359-simplify-arm-identity.rs",
-"ui/mir/issue-83499-input-output-iteration-ice.rs",
-"ui/mir/issue-89485.rs",
-"ui/mir/issue-92893.rs",
-"ui/mir/issue-112269.rs",
-"ui/mir/issue-80949.rs",
-"ui/mir/issue-101844.rs",
-"ui/mir/issue-105809.rs",
-"ui/mir/issue-106062.rs",
-"ui/mir/issue-107691.rs",
-"ui/mir/issue-109004-drop-large-array.rs",
-"ui/mir/issue-109743.rs",
-"ui/mir/issue-46845.rs",
-"ui/mir/issue-60390.rs",
-"ui/mir/issue-66851.rs",
-"ui/mir/issue-66930.rs",
-"ui/mir/issue-67639-normalization-ice.rs",
-"ui/mir/issue-67710-inline-projection.rs",
-"ui/mir/issue-68841.rs",
-"ui/mir/issue-71793-inline-args-storage.rs",
-"ui/mir/issue-73914.rs",
-"ui/mir/issue-74739.rs",
-"ui/mir/issue-75053.rs",
-"ui/mir/issue-76248.rs",
-"ui/mir/issue-76375.rs",
-"ui/mir/issue-76740-copy-propagation.rs",
-"ui/mir/issue-77002.rs",
-"ui/mir/issue-77911.rs",
-"ui/mir/issue-78496.rs",
-"ui/mir/issue-91745.rs",
-"ui/mir/issue-99852.rs",
-"ui/mir/issue-99866.rs",
-"ui/mir/issue66339.rs",
-"ui/mismatched_types/issue-19109.rs",
-"ui/mismatched_types/issue-26480.rs",
-"ui/mismatched_types/issue-35030.rs",
-"ui/mismatched_types/issue-36053-2.rs",
-"ui/mismatched_types/issue-38371-unfixable.rs",
-"ui/mismatched_types/issue-47706-trait.rs",
-"ui/mismatched_types/issue-47706.rs",
-"ui/mismatched_types/issue-74918-missing-lifetime.rs",
-"ui/mismatched_types/issue-75361-mismatched-impl.rs",
-"ui/mismatched_types/issue-84976.rs",
-"ui/mismatched_types/issue-112036.rs",
-"ui/mismatched_types/issue-106182.rs",
-"ui/mismatched_types/issue-38371.rs",
-"ui/missing-trait-bounds/auxiliary/issue-69725.rs",
-"ui/missing-trait-bounds/issue-35677.rs",
-"ui/missing-trait-bounds/issue-69725.rs",
-"ui/modules/issue-56411.rs",
-"ui/modules/issue-107649.rs",
-"ui/modules/issue-56411-aux.rs",
-"ui/moves/issue-22536-copy-mustnt-zero.rs",
-"ui/moves/issue-46099-move-in-macro.rs",
-"ui/moves/issue-72649-uninit-in-loop.rs",
-"ui/moves/issue-75904-move-closure-loop.rs",
-"ui/moves/issue-99470-move-out-of-some.rs",
-"ui/never_type/issue-10176.rs",
-"ui/never_type/issue-13352.rs",
-"ui/never_type/issue-2149.rs",
-"ui/never_type/issue-51506.rs",
-"ui/never_type/issue-52443.rs",
-"ui/never_type/issue-96335.rs",
-"ui/never_type/issue-44402.rs",
-"ui/never_type/issue-5500-1.rs",
-"ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs",
-"ui/nll/polonius/issue-46589.rs",
-"ui/nll/relate_tys/issue-48071.rs",
-"ui/nll/ty-outlives/issue-53789-1.rs",
-"ui/nll/ty-outlives/issue-53789-2.rs",
-"ui/nll/ty-outlives/issue-55756.rs",
-"ui/nll/user-annotations/issue-54124.rs",
-"ui/nll/user-annotations/issue-55241.rs",
-"ui/nll/user-annotations/issue-55748-pat-types-constrain-bindings.rs",
-"ui/nll/user-annotations/issue-57731-ascibed-coupled-types.rs",
-"ui/nll/user-annotations/issue-54570-bootstrapping.rs",
-"ui/nll/user-annotations/issue-55219.rs",
-"ui/nll/issue-21232-partial-init-and-erroneous-use.rs",
-"ui/nll/issue-21232-partial-init-and-use.rs",
-"ui/nll/issue-24535-allow-mutable-borrow-in-match-guard.rs",
-"ui/nll/issue-27282-move-match-input-into-guard.rs",
-"ui/nll/issue-27282-move-ref-mut-into-guard.rs",
-"ui/nll/issue-27282-mutate-before-diverging-arm-1.rs",
-"ui/nll/issue-27282-mutate-before-diverging-arm-2.rs",
-"ui/nll/issue-27282-mutate-before-diverging-arm-3.rs",
-"ui/nll/issue-27282-mutation-in-guard.rs",
-"ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs",
-"ui/nll/issue-27868.rs",
-"ui/nll/issue-30438-a.rs",
-"ui/nll/issue-30438-b.rs",
-"ui/nll/issue-30438-c.rs",
-"ui/nll/issue-31567.rs",
-"ui/nll/issue-42574-diagnostic-in-nested-closure.rs",
-"ui/nll/issue-45157.rs",
-"ui/nll/issue-45696-long-live-borrows-in-boxes.rs",
-"ui/nll/issue-45696-no-variant-box-recur.rs",
-"ui/nll/issue-45696-scribble-on-boxed-borrow.rs",
-"ui/nll/issue-46023.rs",
-"ui/nll/issue-46036.rs",
-"ui/nll/issue-46589.rs",
-"ui/nll/issue-47153-generic-const.rs",
-"ui/nll/issue-47388.rs",
-"ui/nll/issue-47470.rs",
-"ui/nll/issue-47589.rs",
-"ui/nll/issue-48070.rs",
-"ui/nll/issue-48238.rs",
-"ui/nll/issue-48623-closure.rs",
-"ui/nll/issue-48623-generator.rs",
-"ui/nll/issue-48697.rs",
-"ui/nll/issue-48803.rs",
-"ui/nll/issue-50343.rs",
-"ui/nll/issue-50461-used-mut-from-moves.rs",
-"ui/nll/issue-50716.rs",
-"ui/nll/issue-51191.rs",
-"ui/nll/issue-51244.rs",
-"ui/nll/issue-51268.rs",
-"ui/nll/issue-51512.rs",
-"ui/nll/issue-52057.rs",
-"ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs",
-"ui/nll/issue-52086.rs",
-"ui/nll/issue-52113.rs",
-"ui/nll/issue-52213.rs",
-"ui/nll/issue-52533-1.rs",
-"ui/nll/issue-52534-1.rs",
-"ui/nll/issue-52534-2.rs",
-"ui/nll/issue-52534.rs",
-"ui/nll/issue-52663-span-decl-captured-variable.rs",
-"ui/nll/issue-52663-trait-object.rs",
-"ui/nll/issue-52669.rs",
-"ui/nll/issue-52742.rs",
-"ui/nll/issue-53040.rs",
-"ui/nll/issue-53123-raw-pointer-cast.rs",
-"ui/nll/issue-53773.rs",
-"ui/nll/issue-53807.rs",
-"ui/nll/issue-54189.rs",
-"ui/nll/issue-54302-cases.rs",
-"ui/nll/issue-54302.rs",
-"ui/nll/issue-54382-use-span-of-tail-of-block.rs",
-"ui/nll/issue-54556-niconii.rs",
-"ui/nll/issue-54556-stephaneyfx.rs",
-"ui/nll/issue-54556-temps-in-tail-diagnostic.rs",
-"ui/nll/issue-54556-used-vs-unused-tails.rs",
-"ui/nll/issue-54556-wrap-it-up.rs",
-"ui/nll/issue-54779-anon-static-lifetime.rs",
-"ui/nll/issue-54943.rs",
-"ui/nll/issue-55394.rs",
-"ui/nll/issue-55401.rs",
-"ui/nll/issue-55511.rs",
-"ui/nll/issue-55850.rs",
-"ui/nll/issue-57100.rs",
-"ui/nll/issue-57265-return-type-wf-check.rs",
-"ui/nll/issue-57280-1-flipped.rs",
-"ui/nll/issue-57642-higher-ranked-subtype.rs",
-"ui/nll/issue-57843.rs",
-"ui/nll/issue-57960.rs",
-"ui/nll/issue-57989.rs",
-"ui/nll/issue-58053.rs",
-"ui/nll/issue-58299.rs",
-"ui/nll/issue-62007-assign-const-index.rs",
-"ui/nll/issue-62007-assign-differing-fields.rs",
-"ui/nll/issue-67007-escaping-data.rs",
-"ui/nll/issue-68550.rs",
-"ui/nll/issue-69114-static-mut-ty.rs",
-"ui/nll/issue-69114-static-ty.rs",
-"ui/nll/issue-73159-rpit-static.rs",
-"ui/nll/issue-75777.rs",
-"ui/nll/issue-95272.rs",
-"ui/nll/issue-97997.rs",
-"ui/nll/issue-98170.rs",
-"ui/nll/issue-98589-closures-relate-named-regions.rs",
-"ui/nll/issue-98693.rs",
-"ui/nll/issue-112604-closure-output-normalize.rs",
-"ui/nll/issue-16223.rs",
-"ui/nll/issue-21114-ebfull.rs",
-"ui/nll/issue-21114-kixunil.rs",
-"ui/nll/issue-22323-temp-destruction.rs",
-"ui/nll/issue-27583.rs",
-"ui/nll/issue-30104.rs",
-"ui/nll/issue-32382-index-assoc-type-with-lifetime.rs",
-"ui/nll/issue-43058.rs",
-"ui/nll/issue-47022.rs",
-"ui/nll/issue-48179.rs",
-"ui/nll/issue-50716-1.rs",
-"ui/nll/issue-51345-2.rs",
-"ui/nll/issue-51351.rs",
-"ui/nll/issue-51770.rs",
-"ui/nll/issue-52078.rs",
-"ui/nll/issue-52992.rs",
-"ui/nll/issue-53119.rs",
-"ui/nll/issue-53570.rs",
-"ui/nll/issue-54943-3.rs",
-"ui/nll/issue-55288.rs",
-"ui/nll/issue-55344.rs",
-"ui/nll/issue-55651.rs",
-"ui/nll/issue-55825-const-fn.rs",
-"ui/nll/issue-57280-1.rs",
-"ui/nll/issue-57280.rs",
-"ui/nll/issue-61311-normalize.rs",
-"ui/nll/issue-61320-normalize.rs",
-"ui/nll/issue-61424.rs",
-"ui/nll/issue-63154-normalize.rs",
-"ui/nll/issue-78561.rs",
-"ui/numbers-arithmetic/issue-8460.rs",
-"ui/numbers-arithmetic/issue-105626.rs",
-"ui/numbers-arithmetic/issue-8460-const.rs",
-"ui/object-safety/issue-19538.rs",
-"ui/object-safety/issue-102762.rs",
-"ui/object-safety/issue-102933.rs",
-"ui/object-safety/issue-106247.rs",
-"ui/on-unimplemented/issue-104140.rs",
-"ui/or-patterns/issue-64879-trailing-before-guard.rs",
-"ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs",
-"ui/or-patterns/issue-67514-irrefutable-param.rs",
-"ui/or-patterns/issue-68785-irrefutable-param-with-at.rs",
-"ui/or-patterns/issue-69875-should-have-been-expanded-earlier.rs",
-"ui/or-patterns/issue-70413-no-unreachable-pat-and-guard.rs",
-"ui/overloaded/issue-14958.rs",
-"ui/packed/issue-27060-2.rs",
-"ui/packed/issue-27060.rs",
-"ui/packed/issue-46152.rs",
-"ui/panics/issue-47429-short-backtraces.rs",
-"ui/parser/issues/auxiliary/issue-21146-inc.rs",
-"ui/parser/issues/auxiliary/issue-89971-outer-attr-following-inner-attr-ice.rs",
-"ui/parser/issues/auxiliary/issue-94340-inc.rs",
-"ui/parser/issues/issue-101540.rs",
-"ui/parser/issues/issue-102182-impl-trait-recover.rs",
-"ui/parser/issues/issue-10392.rs",
-"ui/parser/issues/issue-104088.rs",
-"ui/parser/issues/issue-104367.rs",
-"ui/parser/issues/issue-10636-1.rs",
-"ui/parser/issues/issue-108242-semicolon-recovery.rs",
-"ui/parser/issues/issue-110014.rs",
-"ui/parser/issues/issue-111416.rs",
-"ui/parser/issues/issue-13483.rs",
-"ui/parser/issues/issue-14303.rs",
-"ui/parser/issues/issue-15914.rs",
-"ui/parser/issues/issue-15980.rs",
-"ui/parser/issues/issue-1655.rs",
-"ui/parser/issues/issue-17718-const-mut.rs",
-"ui/parser/issues/issue-17904-2.rs",
-"ui/parser/issues/issue-1802-1.rs",
-"ui/parser/issues/issue-1802-2.rs",
-"ui/parser/issues/issue-19096.rs",
-"ui/parser/issues/issue-19398.rs",
-"ui/parser/issues/issue-20616-1.rs",
-"ui/parser/issues/issue-20616-2.rs",
-"ui/parser/issues/issue-20616-3.rs",
-"ui/parser/issues/issue-20616-4.rs",
-"ui/parser/issues/issue-20616-5.rs",
-"ui/parser/issues/issue-20616-6.rs",
-"ui/parser/issues/issue-20616-7.rs",
-"ui/parser/issues/issue-20616-8.rs",
-"ui/parser/issues/issue-20616-9.rs",
-"ui/parser/issues/issue-20711-2.rs",
-"ui/parser/issues/issue-20711.rs",
-"ui/parser/issues/issue-21153.rs",
-"ui/parser/issues/issue-21475.rs",
-"ui/parser/issues/issue-22647.rs",
-"ui/parser/issues/issue-22712.rs",
-"ui/parser/issues/issue-2354-1.rs",
-"ui/parser/issues/issue-2354.rs",
-"ui/parser/issues/issue-23620-invalid-escapes.rs",
-"ui/parser/issues/issue-24197.rs",
-"ui/parser/issues/issue-24375.rs",
-"ui/parser/issues/issue-24780.rs",
-"ui/parser/issues/issue-27255.rs",
-"ui/parser/issues/issue-31804.rs",
-"ui/parser/issues/issue-32214.rs",
-"ui/parser/issues/issue-32446.rs",
-"ui/parser/issues/issue-32501.rs",
-"ui/parser/issues/issue-32505.rs",
-"ui/parser/issues/issue-33262.rs",
-"ui/parser/issues/issue-33413.rs",
-"ui/parser/issues/issue-33418.rs",
-"ui/parser/issues/issue-33455.rs",
-"ui/parser/issues/issue-34222-1.rs",
-"ui/parser/issues/issue-34255-1.rs",
-"ui/parser/issues/issue-41155.rs",
-"ui/parser/issues/issue-43196.rs",
-"ui/parser/issues/issue-43692.rs",
-"ui/parser/issues/issue-44021.rs",
-"ui/parser/issues/issue-44406.rs",
-"ui/parser/issues/issue-45296.rs",
-"ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items-bad-variants.rs",
-"ui/parser/issues/issue-48508-aux.rs",
-"ui/parser/issues/issue-49040.rs",
-"ui/parser/issues/issue-51602.rs",
-"ui/parser/issues/issue-52496.rs",
-"ui/parser/issues/issue-5544-a.rs",
-"ui/parser/issues/issue-5544-b.rs",
-"ui/parser/issues/issue-56031.rs",
-"ui/parser/issues/issue-57198.rs",
-"ui/parser/issues/issue-5806.rs",
-"ui/parser/issues/issue-58856-1.rs",
-"ui/parser/issues/issue-58856-2.rs",
-"ui/parser/issues/issue-59418.rs",
-"ui/parser/issues/issue-60075.rs",
-"ui/parser/issues/issue-62546.rs",
-"ui/parser/issues/issue-62660.rs",
-"ui/parser/issues/issue-62881.rs",
-"ui/parser/issues/issue-62895.rs",
-"ui/parser/issues/issue-62913.rs",
-"ui/parser/issues/issue-64732.rs",
-"ui/parser/issues/issue-65122-mac-invoc-in-mut-patterns.rs",
-"ui/parser/issues/issue-65257-invalid-var-decl-recovery.rs",
-"ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs",
-"ui/parser/issues/issue-6610.rs",
-"ui/parser/issues/issue-66357-unexpected-unreachable.rs",
-"ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.rs",
-"ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.rs",
-"ui/parser/issues/issue-68890-2.rs",
-"ui/parser/issues/issue-68890.rs",
-"ui/parser/issues/issue-69259.rs",
-"ui/parser/issues/issue-70388-recover-dotdotdot-rest-pat.rs",
-"ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.rs",
-"ui/parser/issues/issue-70552-ascription-in-parens-after-call.rs",
-"ui/parser/issues/issue-70583-block-is-empty-1.rs",
-"ui/parser/issues/issue-70583-block-is-empty-2.rs",
-"ui/parser/issues/issue-7222.rs",
-"ui/parser/issues/issue-72253.rs",
-"ui/parser/issues/issue-72373.rs",
-"ui/parser/issues/issue-73568-lifetime-after-mut.rs",
-"ui/parser/issues/issue-7970b.rs",
-"ui/parser/issues/issue-81806.rs",
-"ui/parser/issues/issue-83639.rs",
-"ui/parser/issues/issue-84117.rs",
-"ui/parser/issues/issue-84148-1.rs",
-"ui/parser/issues/issue-8537.rs",
-"ui/parser/issues/issue-86895.rs",
-"ui/parser/issues/issue-87086-colon-path-sep.rs",
-"ui/parser/issues/issue-87635.rs",
-"ui/parser/issues/issue-87812-path.rs",
-"ui/parser/issues/issue-87812.rs",
-"ui/parser/issues/issue-88818.rs",
-"ui/parser/issues/issue-89388.rs",
-"ui/parser/issues/issue-89574.rs",
-"ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs",
-"ui/parser/issues/issue-90993.rs",
-"ui/parser/issues/issue-91461.rs",
-"ui/parser/issues/issue-93282.rs",
-"ui/parser/issues/issue-93867.rs",
-"ui/parser/issues/issue-94340.rs",
-"ui/parser/issues/issue-111148.rs",
-"ui/parser/issues/issue-111692.rs",
-"ui/parser/issues/issue-10392-2.rs",
-"ui/parser/issues/issue-105209.rs",
-"ui/parser/issues/issue-10636-2.rs",
-"ui/parser/issues/issue-14303-fncall.rs",
-"ui/parser/issues/issue-17904.rs",
-"ui/parser/issues/issue-21146.rs",
-"ui/parser/issues/issue-30318.rs",
-"ui/parser/issues/issue-3036.rs",
-"ui/parser/issues/issue-35813-postfix-after-cast.rs",
-"ui/parser/issues/issue-46186.rs",
-"ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs",
-"ui/parser/issues/issue-48508.rs",
-"ui/parser/issues/issue-48636.rs",
-"ui/parser/issues/issue-54521-1.rs",
-"ui/parser/issues/issue-54521-2.rs",
-"ui/parser/issues/issue-54521-3.rs",
-"ui/parser/issues/issue-57684.rs",
-"ui/parser/issues/issue-57819.rs",
-"ui/parser/issues/issue-58094-missing-right-square-bracket.rs",
-"ui/parser/issues/issue-62524.rs",
-"ui/parser/issues/issue-62554.rs",
-"ui/parser/issues/issue-62894.rs",
-"ui/parser/issues/issue-62973.rs",
-"ui/parser/issues/issue-63115-range-pat-interpolated.rs",
-"ui/parser/issues/issue-63116.rs",
-"ui/parser/issues/issue-63135.rs",
-"ui/parser/issues/issue-65041-empty-vis-matcher-in-enum.rs",
-"ui/parser/issues/issue-65041-empty-vis-matcher-in-trait.rs",
-"ui/parser/issues/issue-66473.rs",
-"ui/parser/issues/issue-67146-negative-outlives-bound-syntactic-fail.rs",
-"ui/parser/issues/issue-68629.rs",
-"ui/parser/issues/issue-68730.rs",
-"ui/parser/issues/issue-68788-in-trait-item-propagation.rs",
-"ui/parser/issues/issue-70050-ntliteral-accepts-negated-lit.rs",
-"ui/parser/issues/issue-70388-without-witness.rs",
-"ui/parser/issues/issue-75599.rs",
-"ui/parser/issues/issue-76437-async.rs",
-"ui/parser/issues/issue-76437-const-async-unsafe.rs",
-"ui/parser/issues/issue-76437-const-async.rs",
-"ui/parser/issues/issue-76437-const.rs",
-"ui/parser/issues/issue-76437-pub-crate-unsafe.rs",
-"ui/parser/issues/issue-76437-unsafe.rs",
-"ui/parser/issues/issue-76597.rs",
-"ui/parser/issues/issue-84104.rs",
-"ui/parser/issues/issue-84148-2.rs",
-"ui/parser/issues/issue-87197-missing-semicolon.rs",
-"ui/parser/issues/issue-88276-unary-plus.rs",
-"ui/parser/issues/issue-88583-union-as-ident.rs",
-"ui/parser/issues/issue-88770.rs",
-"ui/parser/issues/issue-89396.rs",
-"ui/parser/issues/issue-112458.rs",
-"ui/parser/macro/issue-33569.rs",
-"ui/parser/macro/issue-37113.rs",
-"ui/parser/macro/issue-37234.rs",
-"ui/parser/raw/issue-70677-panic-on-unterminated-raw-str-at-eof.rs",
-"ui/parser/shebang/issue-71471-ignore-tidy.rs",
-"ui/parser/issue-102806.rs",
-"ui/parser/issue-103143.rs",
-"ui/parser/issue-103425.rs",
-"ui/parser/issue-103748-ICE-wrong-braces.rs",
-"ui/parser/issue-104620.rs",
-"ui/parser/issue-104867-inc-dec-2.rs",
-"ui/parser/issue-104867-inc-dec.rs",
-"ui/parser/issue-108495-dec.rs",
-"ui/parser/issue-17718-parse-const.rs",
-"ui/parser/issue-39616.rs",
-"ui/parser/issue-49257.rs",
-"ui/parser/issue-61858.rs",
-"ui/parser/issue-68091-unicode-ident-after-if.rs",
-"ui/parser/issue-68092-unicode-ident-after-incomplete-expr.rs",
-"ui/parser/issue-68987-unmatch-issue-1.rs",
-"ui/parser/issue-68987-unmatch-issue-2.rs",
-"ui/parser/issue-68987-unmatch-issue-3.rs",
-"ui/parser/issue-68987-unmatch-issue.rs",
-"ui/parser/issue-87694-duplicated-pub.rs",
-"ui/parser/issue-87694-misplaced-pub.rs",
-"ui/parser/issue-90728.rs",
-"ui/parser/issue-91421.rs",
-"ui/parser/issue-100197-mut-let.rs",
-"ui/parser/issue-101477-enum.rs",
-"ui/parser/issue-101477-let.rs",
-"ui/parser/issue-103381.rs",
-"ui/parser/issue-103451.rs",
-"ui/parser/issue-105366.rs",
-"ui/parser/issue-105634.rs",
-"ui/parser/issue-107705.rs",
-"ui/parser/issue-112188.rs",
-"ui/parser/issue-81804.rs",
-"ui/parser/issue-81827.rs",
-"ui/parser/issue-99625-enum-struct-mutually-exclusive.rs",
-"ui/parser/issue-99910-const-let-mutually-exclusive.rs",
-"ui/parser/issue-113342.rs",
-"ui/pattern/move-ref-patterns/issue-53840.rs",
-"ui/pattern/usefulness/issue-12116.rs",
-"ui/pattern/usefulness/issue-12369.rs",
-"ui/pattern/usefulness/issue-13727.rs",
-"ui/pattern/usefulness/issue-15129.rs",
-"ui/pattern/usefulness/issue-2111.rs",
-"ui/pattern/usefulness/issue-30240-b.rs",
-"ui/pattern/usefulness/issue-30240-rpass.rs",
-"ui/pattern/usefulness/issue-30240.rs",
-"ui/pattern/usefulness/issue-3096-1.rs",
-"ui/pattern/usefulness/issue-3096-2.rs",
-"ui/pattern/usefulness/issue-31221.rs",
-"ui/pattern/usefulness/issue-31561.rs",
-"ui/pattern/usefulness/issue-35609.rs",
-"ui/pattern/usefulness/issue-39362.rs",
-"ui/pattern/usefulness/issue-40221.rs",
-"ui/pattern/usefulness/issue-4321.rs",
-"ui/pattern/usefulness/issue-50900.rs",
-"ui/pattern/usefulness/issue-56379.rs",
-"ui/pattern/usefulness/issue-57472.rs",
-"ui/pattern/usefulness/issue-72377.rs",
-"ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs",
-"ui/pattern/usefulness/issue-82772-match-box-as-struct.rs",
-"ui/pattern/usefulness/issue-53820-slice-pattern-large-array.rs",
-"ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs",
-"ui/pattern/usefulness/issue-66501.rs",
-"ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs",
-"ui/pattern/usefulness/issue-72476-and-89393-associated-type.rs",
-"ui/pattern/usefulness/issue-78549-ref-pat-and-str.rs",
-"ui/pattern/usefulness/issue-80501-or-pat-and-macro.rs",
-"ui/pattern/usefulness/issue-88747.rs",
-"ui/pattern/usefulness/issue-3601.rs",
-"ui/pattern/issue-10392.rs",
-"ui/pattern/issue-106552.rs",
-"ui/pattern/issue-11577.rs",
-"ui/pattern/issue-12582.rs",
-"ui/pattern/issue-14221.rs",
-"ui/pattern/issue-15080.rs",
-"ui/pattern/issue-17718-patterns.rs",
-"ui/pattern/issue-22546.rs",
-"ui/pattern/issue-27320.rs",
-"ui/pattern/issue-52240.rs",
-"ui/pattern/issue-6449.rs",
-"ui/pattern/issue-66270-pat-struct-parser-recovery.rs",
-"ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs",
-"ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs",
-"ui/pattern/issue-68393-let-pat-assoc-constant.rs",
-"ui/pattern/issue-72574-1.rs",
-"ui/pattern/issue-72574-2.rs",
-"ui/pattern/issue-74539.rs",
-"ui/pattern/issue-74702.rs",
-"ui/pattern/issue-80186-mut-binding-help-suggestion.rs",
-"ui/pattern/issue-8351-1.rs",
-"ui/pattern/issue-8351-2.rs",
-"ui/pattern/issue-88074-pat-range-type-inference-err.rs",
-"ui/pattern/issue-92074-macro-ice.rs",
-"ui/pattern/issue-95878.rs",
-"ui/pattern/issue-72565.rs",
-"ui/pattern/issue-94866.rs",
-"ui/pattern/issue-106862.rs",
-"ui/pattern/issue-74954.rs",
-"ui/pattern/issue-88074-pat-range-type-inference.rs",
-"ui/pattern/issue-110508.rs",
-"ui/polymorphization/issue-74614.rs",
-"ui/polymorphization/issue-74636.rs",
-"ui/privacy/auxiliary/issue-17718-const-privacy.rs",
-"ui/privacy/auxiliary/issue-57264-1.rs",
-"ui/privacy/auxiliary/issue-57264-2.rs",
-"ui/privacy/auxiliary/issue-75907.rs",
-"ui/privacy/auxiliary/issue-92755.rs",
-"ui/privacy/issue-13641.rs",
-"ui/privacy/issue-17718-const-privacy.rs",
-"ui/privacy/issue-29161.rs",
-"ui/privacy/issue-30079.rs",
-"ui/privacy/issue-46209-private-enum-variant-reexport.rs",
-"ui/privacy/issue-75062-fieldless-tuple-struct.rs",
-"ui/privacy/issue-75906.rs",
-"ui/privacy/issue-75907.rs",
-"ui/privacy/issue-75907_b.rs",
-"ui/privacy/issue-79593.rs",
-"ui/privacy/issue-92755.rs",
-"ui/privacy/issue-111220-2-tuple-struct-fields-projection.rs",
-"ui/privacy/issue-111220-tuple-struct-fields.rs",
-"ui/privacy/issue-57264-1.rs",
-"ui/privacy/issue-57264-2.rs",
-"ui/proc-macro/auxiliary/issue-104884.rs",
-"ui/proc-macro/auxiliary/issue-38586.rs",
-"ui/proc-macro/auxiliary/issue-39889.rs",
-"ui/proc-macro/auxiliary/issue-42708.rs",
-"ui/proc-macro/auxiliary/issue-50061.rs",
-"ui/proc-macro/auxiliary/issue-50493.rs",
-"ui/proc-macro/auxiliary/issue-66286.rs",
-"ui/proc-macro/auxiliary/issue-75801.rs",
-"ui/proc-macro/auxiliary/issue-79242.rs",
-"ui/proc-macro/auxiliary/issue-79825.rs",
-"ui/proc-macro/auxiliary/issue-83510.rs",
-"ui/proc-macro/auxiliary/issue-91800-macro.rs",
-"ui/proc-macro/auxiliary/issue-59191.rs",
-"ui/proc-macro/issue-104884-trait-impl-sugg-err.rs",
-"ui/proc-macro/issue-36935.rs",
-"ui/proc-macro/issue-37788.rs",
-"ui/proc-macro/issue-38586.rs",
-"ui/proc-macro/issue-39889.rs",
-"ui/proc-macro/issue-42708.rs",
-"ui/proc-macro/issue-50061.rs",
-"ui/proc-macro/issue-50493.rs",
-"ui/proc-macro/issue-53481.rs",
-"ui/proc-macro/issue-66286.rs",
-"ui/proc-macro/issue-75801.rs",
-"ui/proc-macro/issue-81543-item-parse-err.rs",
-"ui/proc-macro/issue-83469-global-alloc-invalid-stmt.rs",
-"ui/proc-macro/issue-83510.rs",
-"ui/proc-macro/issue-91800.rs",
-"ui/proc-macro/issue-59191-replace-root-with-fn.rs",
-"ui/proc-macro/issue-73933-procedural-masquerade.rs",
-"ui/proc-macro/issue-75734-pp-paren.rs",
-"ui/proc-macro/issue-75930-derive-cfg.rs",
-"ui/proc-macro/issue-76182-leading-vert-pat.rs",
-"ui/proc-macro/issue-76270-panic-in-libproc-macro.rs",
-"ui/proc-macro/issue-78675-captured-inner-attrs.rs",
-"ui/proc-macro/issue-79148.rs",
-"ui/proc-macro/issue-79242-slow-retokenize-check.rs",
-"ui/proc-macro/issue-79825.rs",
-"ui/proc-macro/issue-80760-empty-stmt.rs",
-"ui/proc-macro/issue-81007-item-attrs.rs",
-"ui/proc-macro/issue-81555.rs",
-"ui/proc-macro/issue-86781-bad-inner-doc.rs",
-"ui/process/issue-13304.rs",
-"ui/process/issue-14456.rs",
-"ui/process/issue-14940.rs",
-"ui/process/issue-16272.rs",
-"ui/process/issue-20091.rs",
-"ui/ptr_ops/issue-80309-safe.rs",
-"ui/ptr_ops/issue-80309.rs",
-"ui/pub/issue-33174-restricted-type-in-public-interface.rs",
-"ui/query-system/issue-83479.rs",
-"ui/range/issue-54505-no-std.rs",
-"ui/range/issue-73553-misinterp-range-literal.rs",
-"ui/range/issue-54505-no-literals.rs",
-"ui/range/issue-54505.rs",
-"ui/reachable/auxiliary/issue-11225-1.rs",
-"ui/reachable/auxiliary/issue-11225-2.rs",
-"ui/reachable/auxiliary/issue-11225-3.rs",
-"ui/reachable/issue-11225-1.rs",
-"ui/reachable/issue-11225-2.rs",
-"ui/reachable/issue-11225-3.rs",
-"ui/reachable/issue-948.rs",
-"ui/recursion/issue-26548-recursion-via-normalize.rs",
-"ui/recursion/issue-38591-non-regular-dropck-recursion.rs",
-"ui/recursion/issue-86784.rs",
-"ui/recursion/issue-83150.rs",
-"ui/recursion/issue-95134.rs",
-"ui/recursion_limit/issue-105700.rs",
-"ui/recursion_limit/issue-40003.rs",
-"ui/regions/issue-101280.rs",
-"ui/regions/issue-102374.rs",
-"ui/regions/issue-102392.rs",
-"ui/regions/issue-12470.rs",
-"ui/regions/issue-26448-1.rs",
-"ui/regions/issue-28848.rs",
-"ui/regions/issue-5243.rs",
-"ui/regions/issue-6157.rs",
-"ui/regions/issue-11612.rs",
-"ui/regions/issue-21520.rs",
-"ui/regions/issue-24085.rs",
-"ui/regions/issue-26448-2.rs",
-"ui/regions/issue-26448-3.rs",
-"ui/regions/issue-56537-closure-uses-region-from-container.rs",
-"ui/regions/issue-72051-member-region-hang.rs",
-"ui/regions/issue-78262.rs",
-"ui/repr/issue-83505-repr-simd.rs",
-"ui/repr/issue-83921-ice.rs",
-"ui/resolve/auxiliary/issue-19452-aux.rs",
-"ui/resolve/auxiliary/issue-21221-3.rs",
-"ui/resolve/auxiliary/issue-21221-4.rs",
-"ui/resolve/auxiliary/issue-30535.rs",
-"ui/resolve/auxiliary/issue-3907.rs",
-"ui/resolve/auxiliary/issue-80079.rs",
-"ui/resolve/auxiliary/issue-112831-aux.rs",
-"ui/resolve/issue-113808-invalid-unused-qualifications-suggestion.rs",
-"ui/resolve/issue-100365.rs",
-"ui/resolve/issue-101749-2.rs",
-"ui/resolve/issue-10200.rs",
-"ui/resolve/issue-102946.rs",
-"ui/resolve/issue-103202.rs",
-"ui/resolve/issue-103474.rs",
-"ui/resolve/issue-104700-inner_scope.rs",
-"ui/resolve/issue-105069.rs",
-"ui/resolve/issue-107563-ambiguous-glob-reexports.rs",
-"ui/resolve/issue-108529.rs",
-"ui/resolve/issue-109250.rs",
-"ui/resolve/issue-12796.rs",
-"ui/resolve/issue-14254.rs",
-"ui/resolve/issue-16058.rs",
-"ui/resolve/issue-17518.rs",
-"ui/resolve/issue-18252.rs",
-"ui/resolve/issue-19452.rs",
-"ui/resolve/issue-21221-1.rs",
-"ui/resolve/issue-21221-2.rs",
-"ui/resolve/issue-21221-3.rs",
-"ui/resolve/issue-21221-4.rs",
-"ui/resolve/issue-22692.rs",
-"ui/resolve/issue-2330.rs",
-"ui/resolve/issue-23305.rs",
-"ui/resolve/issue-2356.rs",
-"ui/resolve/issue-23716.rs",
-"ui/resolve/issue-24968.rs",
-"ui/resolve/issue-26545.rs",
-"ui/resolve/issue-3021-c.rs",
-"ui/resolve/issue-3021.rs",
-"ui/resolve/issue-30535.rs",
-"ui/resolve/issue-3099-a.rs",
-"ui/resolve/issue-3099-b.rs",
-"ui/resolve/issue-31845.rs",
-"ui/resolve/issue-33876.rs",
-"ui/resolve/issue-35675.rs",
-"ui/resolve/issue-3907-2.rs",
-"ui/resolve/issue-3907.rs",
-"ui/resolve/issue-39226.rs",
-"ui/resolve/issue-39559-2.rs",
-"ui/resolve/issue-39559.rs",
-"ui/resolve/issue-42944.rs",
-"ui/resolve/issue-49074.rs",
-"ui/resolve/issue-5035-2.rs",
-"ui/resolve/issue-5035.rs",
-"ui/resolve/issue-50599.rs",
-"ui/resolve/issue-5099.rs",
-"ui/resolve/issue-54379.rs",
-"ui/resolve/issue-55673.rs",
-"ui/resolve/issue-5927.rs",
-"ui/resolve/issue-60057.rs",
-"ui/resolve/issue-65025-extern-static-parent-generics.rs",
-"ui/resolve/issue-65035-static-with-parent-generics.rs",
-"ui/resolve/issue-6702.rs",
-"ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs",
-"ui/resolve/issue-73427.rs",
-"ui/resolve/issue-80079.rs",
-"ui/resolve/issue-81508.rs",
-"ui/resolve/issue-82156.rs",
-"ui/resolve/issue-82865.rs",
-"ui/resolve/issue-85348.rs",
-"ui/resolve/issue-88472.rs",
-"ui/resolve/issue-90113.rs",
-"ui/resolve/issue-109153.rs",
-"ui/resolve/issue-101749.rs",
-"ui/resolve/issue-111312.rs",
-"ui/resolve/issue-111727.rs",
-"ui/resolve/issue-112472-multi-generics-suggestion.rs",
-"ui/resolve/issue-112831.rs",
-"ui/resolve/issue-57523.rs",
-"ui/resolve/issue-70736-async-fn-no-body-def-collector.rs",
-"ui/resolve/issue-85671.rs",
-"ui/return/issue-82612-return-mutable-reference.rs",
-"ui/return/issue-64620.rs",
-"ui/return/issue-86188-return-not-in-fn-body.rs",
-"ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs",
-"ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs",
-"ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs",
-"ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-main.rs",
-"ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs",
-"ui/rfcs/rfc-2396-target_feature-11/issue-99876.rs",
-"ui/rfcs/rfc-2396-target_feature-11/issue-108655-inline-always-closure.rs",
-"ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.rs",
-"ui/rfcs/rfc-2528-type-changing-struct-update/issue-96878.rs",
-"ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs",
-"ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs",
-"ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs",
-"ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs",
-"ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs",
-"ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs",
-"ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs",
-"ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs",
-"ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs",
-"ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs",
-"ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs",
-"ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs",
-"ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs",
-"ui/rust-2018/uniform-paths/auxiliary/issue-55779-extern-trait.rs",
-"ui/rust-2018/uniform-paths/auxiliary/issue-56596-2.rs",
-"ui/rust-2018/uniform-paths/auxiliary/issue-56596.rs",
-"ui/rust-2018/uniform-paths/auxiliary/issue-87932-a.rs",
-"ui/rust-2018/uniform-paths/issue-54253.rs",
-"ui/rust-2018/uniform-paths/issue-55779.rs",
-"ui/rust-2018/uniform-paths/issue-56596-2.rs",
-"ui/rust-2018/uniform-paths/issue-56596.rs",
-"ui/rust-2018/uniform-paths/issue-87932.rs",
-"ui/rust-2018/issue-51008-1.rs",
-"ui/rust-2018/issue-51008.rs",
-"ui/rust-2018/issue-52202-use-suggestions.rs",
-"ui/rust-2018/issue-54006.rs",
-"ui/rust-2018/issue-54400-unused-extern-crate-attr-span.rs",
-"ui/sanitize/issue-111184-generator-witness.rs",
-"ui/sanitize/issue-72154-lifetime-markers.rs",
-"ui/self/issue-61882-2.rs",
-"ui/self/issue-61882.rs",
-"ui/simd/intrinsic/issue-85855.rs",
-"ui/simd/issue-17170.rs",
-"ui/simd/issue-32947.rs",
-"ui/simd/issue-39720.rs",
-"ui/simd/issue-85915-simd-ptrs.rs",
-"ui/simd/issue-89193.rs",
-"ui/simd/issue-105439.rs",
-"ui/single-use-lifetime/issue-104440.rs",
-"ui/single-use-lifetime/issue-107998.rs",
-"ui/span/issue28498-reject-ex1.rs",
-"ui/span/issue28498-reject-lifetime-param.rs",
-"ui/span/issue28498-reject-passed-to-fn.rs",
-"ui/span/issue28498-reject-trait-bound.rs",
-"ui/span/issue-11925.rs",
-"ui/span/issue-23338-locals-die-before-temps-of-body.rs",
-"ui/span/issue-23729.rs",
-"ui/span/issue-23827.rs",
-"ui/span/issue-24356.rs",
-"ui/span/issue-24805-dropck-child-has-items-via-parent.rs",
-"ui/span/issue-24805-dropck-trait-has-items.rs",
-"ui/span/issue-24895-copy-clone-dropck.rs",
-"ui/span/issue-25199.rs",
-"ui/span/issue-26656.rs",
-"ui/span/issue-27522.rs",
-"ui/span/issue-29106.rs",
-"ui/span/issue-29595.rs",
-"ui/span/issue-33884.rs",
-"ui/span/issue-34264.rs",
-"ui/span/issue-35987.rs",
-"ui/span/issue-36537.rs",
-"ui/span/issue-37767.rs",
-"ui/span/issue-39018.rs",
-"ui/span/issue-39698.rs",
-"ui/span/issue-40157.rs",
-"ui/span/issue-43927-non-ADT-derive.rs",
-"ui/span/issue-81800.rs",
-"ui/span/issue-107353.rs",
-"ui/span/issue-15480.rs",
-"ui/span/issue-24690.rs",
-"ui/span/issue-42234-unknown-receiver-type.rs",
-"ui/span/issue-71363.rs",
-"ui/specialization/min_specialization/issue-79224.rs",
-"ui/specialization/issue-111232.rs",
-"ui/specialization/issue-33017.rs",
-"ui/specialization/issue-38091-2.rs",
-"ui/specialization/issue-38091.rs",
-"ui/specialization/issue-39448.rs",
-"ui/specialization/issue-44861.rs",
-"ui/specialization/issue-50452-fail.rs",
-"ui/specialization/issue-50452.rs",
-"ui/specialization/issue-51892.rs",
-"ui/specialization/issue-52050.rs",
-"ui/specialization/issue-59435.rs",
-"ui/specialization/issue-68830-spurious-diagnostics.rs",
-"ui/specialization/issue-35376.rs",
-"ui/specialization/issue-36804.rs",
-"ui/specialization/issue-39618.rs",
-"ui/specialization/issue-40582.rs",
-"ui/specialization/issue-43037.rs",
-"ui/specialization/issue-45814.rs",
-"ui/specialization/issue-63716-parse-async.rs",
-"ui/specialization/issue-70442.rs",
-"ui/stability-attribute/issue-106589.rs",
-"ui/stability-attribute/issue-109177.rs",
-"ui/stability-attribute/issue-28075.rs",
-"ui/stability-attribute/issue-28388-3.rs",
-"ui/stability-attribute/issue-99286-stable-intrinsics.rs",
-"ui/static/auxiliary/issue_24843.rs",
-"ui/static/issue-18118-2.rs",
-"ui/static/issue-18118.rs",
-"ui/static/issue-34194.rs",
-"ui/static/issue-5216.rs",
-"ui/static/issue-24843.rs",
-"ui/statics/issue-15261.rs",
-"ui/statics/issue-17233.rs",
-"ui/statics/issue-17718-static-sync.rs",
-"ui/statics/issue-17718-static-unsafe-interior.rs",
-"ui/statics/issue-44373.rs",
-"ui/statics/issue-14227.rs",
-"ui/statics/issue-44373-2.rs",
-"ui/statics/issue-91050-1.rs",
-"ui/statics/issue-91050-2.rs",
-"ui/std/issue-15149.rs",
-"ui/std/issue-81357-unsound-file-methods.rs",
-"ui/stdlib-unit-tests/issue-21058.rs",
-"ui/structs-enums/struct-rec/issue-74224.rs",
-"ui/structs-enums/struct-rec/issue-84611.rs",
-"ui/structs-enums/issue-1701.rs",
-"ui/structs-enums/issue-2718-a.rs",
-"ui/structs-enums/issue-38002.rs",
-"ui/structs-enums/issue-50731.rs",
-"ui/structs-enums/issue-3008-1.rs",
-"ui/structs-enums/issue-3008-2.rs",
-"ui/structs-enums/issue-3008-3.rs",
-"ui/structs-enums/issue-103869.rs",
-"ui/structs/issue-80853.rs",
-"ui/suggestions/auxiliary/issue-61963-1.rs",
-"ui/suggestions/auxiliary/issue-61963.rs",
-"ui/suggestions/auxiliary/issue-81839.rs",
-"ui/suggestions/lifetimes/issue-105544.rs",
-"ui/suggestions/issue-101421.rs",
-"ui/suggestions/issue-101465.rs",
-"ui/suggestions/issue-101623.rs",
-"ui/suggestions/issue-101984.rs",
-"ui/suggestions/issue-102354.rs",
-"ui/suggestions/issue-102892.rs",
-"ui/suggestions/issue-103112.rs",
-"ui/suggestions/issue-104086-suggest-let.rs",
-"ui/suggestions/issue-104287.rs",
-"ui/suggestions/issue-104327.rs",
-"ui/suggestions/issue-104328.rs",
-"ui/suggestions/issue-105226.rs",
-"ui/suggestions/issue-105494.rs",
-"ui/suggestions/issue-105645.rs",
-"ui/suggestions/issue-106443-sugg-clone-for-arg.rs",
-"ui/suggestions/issue-106443-sugg-clone-for-bound.rs",
-"ui/suggestions/issue-109291.rs",
-"ui/suggestions/issue-109396.rs",
-"ui/suggestions/issue-109436.rs",
-"ui/suggestions/issue-109854.rs",
-"ui/suggestions/issue-21673.rs",
-"ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.rs",
-"ui/suggestions/issue-61963.rs",
-"ui/suggestions/issue-62843.rs",
-"ui/suggestions/issue-64252-self-type.rs",
-"ui/suggestions/issue-66968-suggest-sorted-words.rs",
-"ui/suggestions/issue-68049-1.rs",
-"ui/suggestions/issue-68049-2.rs",
-"ui/suggestions/issue-71394-no-from-impl.rs",
-"ui/suggestions/issue-81098.rs",
-"ui/suggestions/issue-82566-1.rs",
-"ui/suggestions/issue-82566-2.rs",
-"ui/suggestions/issue-84592.rs",
-"ui/suggestions/issue-84700.rs",
-"ui/suggestions/issue-84973-2.rs",
-"ui/suggestions/issue-84973-blacklist.rs",
-"ui/suggestions/issue-84973-negative.rs",
-"ui/suggestions/issue-84973.rs",
-"ui/suggestions/issue-85347.rs",
-"ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs",
-"ui/suggestions/issue-85945-check-where-clause-before-suggesting-unsized.rs",
-"ui/suggestions/issue-86100-tuple-paren-comma.rs",
-"ui/suggestions/issue-88730.rs",
-"ui/suggestions/issue-89064.rs",
-"ui/suggestions/issue-89333.rs",
-"ui/suggestions/issue-90974.rs",
-"ui/suggestions/issue-94171.rs",
-"ui/suggestions/issue-96223.rs",
-"ui/suggestions/issue-97760.rs",
-"ui/suggestions/issue-98500.rs",
-"ui/suggestions/issue-99080.rs",
-"ui/suggestions/issue-99240-2.rs",
-"ui/suggestions/issue-99240.rs",
-"ui/suggestions/issue-99597.rs",
-"ui/suggestions/issue-103646.rs",
-"ui/suggestions/issue-88696.rs",
-"ui/suggestions/issue-101065.rs",
-"ui/suggestions/issue-104961.rs",
-"ui/suggestions/issue-105761-suggest-self-for-closure.rs",
-"ui/suggestions/issue-107860.rs",
-"ui/suggestions/issue-108470.rs",
-"ui/suggestions/issue-52820.rs",
-"ui/suggestions/issue-53692.rs",
-"ui/suggestions/issue-57672.rs",
-"ui/suggestions/issue-59819.rs",
-"ui/suggestions/issue-61226.rs",
-"ui/suggestions/issue-72766.rs",
-"ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs",
-"ui/suggestions/issue-81839.rs",
-"ui/suggestions/issue-82361.rs",
-"ui/suggestions/issue-83892.rs",
-"ui/suggestions/issue-83943.rs",
-"ui/suggestions/issue-86667.rs",
-"ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs",
-"ui/suggestions/issue-96555.rs",
-"ui/suggestions/issue-97677.rs",
-"ui/suggestions/issue-97704.rs",
-"ui/suggestions/issue-102972.rs",
-"ui/suggestions/issue-109991.rs",
-"ui/suggestions/issue-112590-suggest-import.rs",
-"ui/suggestions/issue-89640.rs",
-"ui/symbol-names/issue-53912.rs",
-"ui/symbol-names/issue-60925.rs",
-"ui/symbol-names/issue-75326.rs",
-"ui/symbol-names/issue-76365.rs",
-"ui/test-attrs/custom-test-frameworks/issue-107454.rs",
-"ui/test-attrs/issue-109816.rs",
-"ui/test-attrs/issue-12997-1.rs",
-"ui/test-attrs/issue-12997-2.rs",
-"ui/test-attrs/issue-16597-empty.rs",
-"ui/test-attrs/issue-16597.rs",
-"ui/test-attrs/issue-20823.rs",
-"ui/test-attrs/issue-34932.rs",
-"ui/test-attrs/issue-36768.rs",
-"ui/test-attrs/issue-52557.rs",
-"ui/test-attrs/issue-53675-a-test-called-panic.rs",
-"ui/threads-sendsync/issue-24313.rs",
-"ui/threads-sendsync/issue-29488.rs",
-"ui/threads-sendsync/issue-43733-2.rs",
-"ui/threads-sendsync/issue-4446.rs",
-"ui/threads-sendsync/issue-4448.rs",
-"ui/threads-sendsync/issue-8827.rs",
-"ui/threads-sendsync/issue-9396.rs",
-"ui/threads-sendsync/issue-43733.rs",
-"ui/trait-bounds/issue-75961.rs",
-"ui/trait-bounds/issue-93008.rs",
-"ui/trait-bounds/issue-94680.rs",
-"ui/trait-bounds/issue-94999.rs",
-"ui/trait-bounds/issue-95640.rs",
-"ui/traits/alias/issue-108072-unmet-trait-alias-bound.rs",
-"ui/traits/alias/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs",
-"ui/traits/alias/issue-83613.rs",
-"ui/traits/alias/issue-107747-do-not-assemble-supertraits.rs",
-"ui/traits/alias/issue-60021-assoc-method-resolve.rs",
-"ui/traits/alias/issue-60755.rs",
-"ui/traits/alias/issue-72415-assoc-const-resolve.rs",
-"ui/traits/alias/issue-75983.rs",
-"ui/traits/associated_type_bound/issue-51446.rs",
-"ui/traits/auxiliary/issue_89119_intercrate_caching.rs",
-"ui/traits/new-solver/coherence/issue-102048.rs",
-"ui/traits/object/issue-44454-1.rs",
-"ui/traits/object/issue-44454-2.rs",
-"ui/traits/object/issue-44454-3.rs",
-"ui/traits/object/issue-33140-traitobject-crate.rs",
-"ui/traits/suggest-deferences/issue-39029.rs",
-"ui/traits/suggest-deferences/issue-62530.rs",
-"ui/traits/trait-upcasting/issue-11515.rs",
-"ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs",
-"ui/traits/vtable/issue-97381.rs",
-"ui/traits/vtable/issue-91807.rs",
-"ui/traits/issue-102989.rs",
-"ui/traits/issue-103563.rs",
-"ui/traits/issue-104322.rs",
-"ui/traits/issue-106072.rs",
-"ui/traits/issue-18400.rs",
-"ui/traits/issue-18412.rs",
-"ui/traits/issue-20692.rs",
-"ui/traits/issue-22019.rs",
-"ui/traits/issue-22110.rs",
-"ui/traits/issue-22384.rs",
-"ui/traits/issue-22655.rs",
-"ui/traits/issue-23003.rs",
-"ui/traits/issue-23825.rs",
-"ui/traits/issue-24010.rs",
-"ui/traits/issue-26339.rs",
-"ui/traits/issue-28576.rs",
-"ui/traits/issue-32963.rs",
-"ui/traits/issue-33140-hack-boundaries.rs",
-"ui/traits/issue-33140.rs",
-"ui/traits/issue-35869.rs",
-"ui/traits/issue-3683.rs",
-"ui/traits/issue-38033.rs",
-"ui/traits/issue-38404.rs",
-"ui/traits/issue-38604.rs",
-"ui/traits/issue-3973.rs",
-"ui/traits/issue-4107.rs",
-"ui/traits/issue-43132.rs",
-"ui/traits/issue-43784-supertrait.rs",
-"ui/traits/issue-50480.rs",
-"ui/traits/issue-52893.rs",
-"ui/traits/issue-56202.rs",
-"ui/traits/issue-56488.rs",
-"ui/traits/issue-59029-1.rs",
-"ui/traits/issue-59029-2.rs",
-"ui/traits/issue-6128.rs",
-"ui/traits/issue-6334.rs",
-"ui/traits/issue-65284-suggest-generic-trait-bound.rs",
-"ui/traits/issue-65673.rs",
-"ui/traits/issue-68295.rs",
-"ui/traits/issue-7013.rs",
-"ui/traits/issue-71036.rs",
-"ui/traits/issue-71136.rs",
-"ui/traits/issue-72410.rs",
-"ui/traits/issue-75627.rs",
-"ui/traits/issue-77982.rs",
-"ui/traits/issue-78372.rs",
-"ui/traits/issue-79458.rs",
-"ui/traits/issue-8153.rs",
-"ui/traits/issue-85735.rs",
-"ui/traits/issue-87558.rs",
-"ui/traits/issue-91594.rs",
-"ui/traits/issue-9394-inherited-calls.rs",
-"ui/traits/issue-97576.rs",
-"ui/traits/issue-99875.rs",
-"ui/traits/issue-105231.rs",
-"ui/traits/issue-83538-tainted-cache-after-cycle.rs",
-"ui/traits/issue-23003-overflow.rs",
-"ui/traits/issue-70944.rs",
-"ui/traits/issue-72455.rs",
-"ui/traits/issue-78632.rs",
-"ui/traits/issue-82830.rs",
-"ui/traits/issue-84399-bad-fresh-caching.rs",
-"ui/traits/issue-85360-eval-obligation-ice.rs",
-"ui/traits/issue-89119.rs",
-"ui/traits/issue-90195-2.rs",
-"ui/traits/issue-90195.rs",
-"ui/traits/issue-90662-projection-caching.rs",
-"ui/traits/issue-91949-hangs-on-recursion.rs",
-"ui/traits/issue-92292.rs",
-"ui/traits/issue-95311.rs",
-"ui/traits/issue-95898.rs",
-"ui/traits/issue-96664.rs",
-"ui/traits/issue-96665.rs",
-"ui/traits/issue-97695-double-trivial-bound.rs",
-"ui/transmutability/arrays/issue-103783-array-length.rs",
-"ui/transmutability/issue-101739-1.rs",
-"ui/transmutability/issue-101739-2.rs",
-"ui/transmutability/issue-110467.rs",
-"ui/transmutability/issue-110892.rs",
-"ui/trivial-bounds/issue-73021-impossible-inline.rs",
-"ui/try-block/issue-45124.rs",
-"ui/type-alias-enum-variants/issue-57866.rs",
-"ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs",
-"ui/type-alias-enum-variants/issue-63151-dead-code-lint-fields-in-patterns.rs",
-"ui/type-alias-impl-trait/issue-52843-closure-constrain.rs",
-"ui/type-alias-impl-trait/issue-52843.rs",
-"ui/type-alias-impl-trait/issue-53092-2.rs",
-"ui/type-alias-impl-trait/issue-53092.rs",
-"ui/type-alias-impl-trait/issue-53096.rs",
-"ui/type-alias-impl-trait/issue-53598.rs",
-"ui/type-alias-impl-trait/issue-57700.rs",
-"ui/type-alias-impl-trait/issue-58887.rs",
-"ui/type-alias-impl-trait/issue-60371.rs",
-"ui/type-alias-impl-trait/issue-60407.rs",
-"ui/type-alias-impl-trait/issue-63279.rs",
-"ui/type-alias-impl-trait/issue-65384.rs",
-"ui/type-alias-impl-trait/issue-65918.rs",
-"ui/type-alias-impl-trait/issue-74244.rs",
-"ui/type-alias-impl-trait/issue-74280.rs",
-"ui/type-alias-impl-trait/issue-74761-2.rs",
-"ui/type-alias-impl-trait/issue-74761.rs",
-"ui/type-alias-impl-trait/issue-84660-unsoundness.rs",
-"ui/type-alias-impl-trait/issue-90400-1.rs",
-"ui/type-alias-impl-trait/issue-90400-2.rs",
-"ui/type-alias-impl-trait/issue-94429.rs",
-"ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.rs",
-"ui/type-alias-impl-trait/issue-98608.rs",
-"ui/type-alias-impl-trait/issue-101750.rs",
-"ui/type-alias-impl-trait/issue-104817.rs",
-"ui/type-alias-impl-trait/issue-53398-cyclic-types.rs",
-"ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs",
-"ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs",
-"ui/type-alias-impl-trait/issue-57611-trait-alias.rs",
-"ui/type-alias-impl-trait/issue-57807-associated-type.rs",
-"ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs",
-"ui/type-alias-impl-trait/issue-58662-simplified.rs",
-"ui/type-alias-impl-trait/issue-58951-2.rs",
-"ui/type-alias-impl-trait/issue-58951.rs",
-"ui/type-alias-impl-trait/issue-60564-working.rs",
-"ui/type-alias-impl-trait/issue-60662.rs",
-"ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs",
-"ui/type-alias-impl-trait/issue-63355.rs",
-"ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs",
-"ui/type-alias-impl-trait/issue-66580-closure-coherence.rs",
-"ui/type-alias-impl-trait/issue-67844-nested-opaque.rs",
-"ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs",
-"ui/type-alias-impl-trait/issue-69323.rs",
-"ui/type-alias-impl-trait/issue-72793.rs",
-"ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs",
-"ui/type-alias-impl-trait/issue-78450.rs",
-"ui/type-alias-impl-trait/issue-84660-trait-impl-for-tait.rs",
-"ui/type-alias-impl-trait/issue-87455-static-lifetime-ice.rs",
-"ui/type-alias-impl-trait/issue-89686.rs",
-"ui/type-alias-impl-trait/issue-89952.rs",
-"ui/type-alias-impl-trait/issue-93411.rs",
-"ui/type-alias-impl-trait/issue-96572-unconstrained.rs",
-"ui/type-alias-impl-trait/issue-98604.rs",
-"ui/type-alias-impl-trait/issue-109054.rs",
-"ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs",
-"ui/type-alias-impl-trait/issue-57961.rs",
-"ui/type-alias-impl-trait/issue-60564.rs",
-"ui/type-alias-impl-trait/issue-63263-closure-return.rs",
-"ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs",
-"ui/type-alias-impl-trait/issue-68368-non-defining-use-2.rs",
-"ui/type-alias-impl-trait/issue-68368-non-defining-use.rs",
-"ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs",
-"ui/type-alias-impl-trait/issue-70121.rs",
-"ui/type-alias-impl-trait/issue-77179.rs",
-"ui/type-alias/issue-62263-self-in-atb.rs",
-"ui/type-alias/issue-62305-self-assoc-ty.rs",
-"ui/type-alias/issue-62364-self-ty-arg.rs",
-"ui/type-alias/issue-14933.rs",
-"ui/type-alias/issue-37515.rs",
-"ui/type-inference/issue-30225.rs",
-"ui/type-inference/issue-113283-alllocator-trait-eq.rs",
-"ui/type/ascription/issue-34255-1.rs",
-"ui/type/ascription/issue-47666.rs",
-"ui/type/ascription/issue-54516.rs",
-"ui/type/ascription/issue-60933.rs",
-"ui/type/type-check/issue-22897.rs",
-"ui/type/type-check/issue-40294.rs",
-"ui/type/type-check/issue-41314.rs",
-"ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.rs",
-"ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.rs",
-"ui/type/issue-100584.rs",
-"ui/type/issue-101866.rs",
-"ui/type/issue-102598.rs",
-"ui/type/issue-103271.rs",
-"ui/type/issue-58355.rs",
-"ui/type/issue-67690-type-alias-bound-diagnostic-crash.rs",
-"ui/type/issue-91268.rs",
-"ui/type/issue-94187-verbose-type-name.rs",
-"ui/typeck/auxiliary/issue-36708.rs",
-"ui/typeck/auxiliary/issue-81943-lib.rs",
-"ui/typeck/issue-100246.rs",
-"ui/typeck/issue-100285.rs",
-"ui/typeck/issue-103899.rs",
-"ui/typeck/issue-10401.rs",
-"ui/typeck/issue-104513-ice.rs",
-"ui/typeck/issue-104582.rs",
-"ui/typeck/issue-105946.rs",
-"ui/typeck/issue-107087.rs",
-"ui/typeck/issue-10969.rs",
-"ui/typeck/issue-110052.rs",
-"ui/typeck/issue-13853-2.rs",
-"ui/typeck/issue-13853-5.rs",
-"ui/typeck/issue-13853.rs",
-"ui/typeck/issue-18937-1.rs",
-"ui/typeck/issue-18937.rs",
-"ui/typeck/issue-29124.rs",
-"ui/typeck/issue-31173.rs",
-"ui/typeck/issue-33575.rs",
-"ui/typeck/issue-36708.rs",
-"ui/typeck/issue-43189.rs",
-"ui/typeck/issue-46112.rs",
-"ui/typeck/issue-50687-ice-on-borrow.rs",
-"ui/typeck/issue-52082-type-param-shadows-existing-type.rs",
-"ui/typeck/issue-53712.rs",
-"ui/typeck/issue-57404.rs",
-"ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.rs",
-"ui/typeck/issue-65611.rs",
-"ui/typeck/issue-67971.rs",
-"ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.rs",
-"ui/typeck/issue-74086.rs",
-"ui/typeck/issue-75883.rs",
-"ui/typeck/issue-75889.rs",
-"ui/typeck/issue-7813.rs",
-"ui/typeck/issue-79040.rs",
-"ui/typeck/issue-80779.rs",
-"ui/typeck/issue-81293.rs",
-"ui/typeck/issue-81885.rs",
-"ui/typeck/issue-81943.rs",
-"ui/typeck/issue-83621-placeholder-static-in-extern.rs",
-"ui/typeck/issue-83693.rs",
-"ui/typeck/issue-84160.rs",
-"ui/typeck/issue-84768.rs",
-"ui/typeck/issue-84831.rs",
-"ui/typeck/issue-87771-ice-assign-assign-to-bool.rs",
-"ui/typeck/issue-87872-missing-inaccessible-field-literal.rs",
-"ui/typeck/issue-87872-missing-inaccessible-field-pattern.rs",
-"ui/typeck/issue-88609.rs",
-"ui/typeck/issue-88643.rs",
-"ui/typeck/issue-88844.rs",
-"ui/typeck/issue-89275.rs",
-"ui/typeck/issue-89806.rs",
-"ui/typeck/issue-90101.rs",
-"ui/typeck/issue-90164.rs",
-"ui/typeck/issue-90319.rs",
-"ui/typeck/issue-90804-incorrect-reference-suggestion.rs",
-"ui/typeck/issue-91267.rs",
-"ui/typeck/issue-91450-inner-ty-error.rs",
-"ui/typeck/issue-92481.rs",
-"ui/typeck/issue-93486.rs",
-"ui/typeck/issue-96530.rs",
-"ui/typeck/issue-96738.rs",
-"ui/typeck/issue-98260.rs",
-"ui/typeck/issue-98982.rs",
-"ui/typeck/issue-106929.rs",
-"ui/typeck/issue-112385-while-assign-lhs-place-expr-ice.rs",
-"ui/typeck/issue-1871.rs",
-"ui/typeck/issue-2063.rs",
-"ui/typeck/issue-100164.rs",
-"ui/typeck/issue-104510-ice.rs",
-"ui/typeck/issue-107775.rs",
-"ui/typeck/issue-112252-ptr-arithmetics-help.rs",
-"ui/typeck/issue-2063-resource.rs",
-"ui/typeck/issue-22375.rs",
-"ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs",
-"ui/typeck/issue-61711-once-caused-rustc-inf-loop.rs",
-"ui/typeck/issue-68590-reborrow-through-derefmut.rs",
-"ui/typeck/issue-72225-call-fnmut-through-derefmut.rs",
-"ui/typeck/issue-73592-borrow_mut-through-deref.rs",
-"ui/typeck/issue-74933.rs",
-"ui/typeck/issue-80207-unsized-return.rs",
-"ui/typeck/issue-82772.rs",
-"ui/typeck/issue-88803-call-expr-method.rs",
-"ui/typeck/issue-89044-wrapped-expr-method.rs",
-"ui/typeck/issue-89856.rs",
-"ui/typeck/issue-89935.rs",
-"ui/typeck/issue-90027-async-fn-return-suggestion.rs",
-"ui/typeck/issue-90483-inaccessible-field-adjustment.rs",
-"ui/typeck/issue-91210-ptr-method.rs",
-"ui/typeck/issue-91328.rs",
-"ui/typeck/issue-91334.rs",
-"ui/typeck/issue-91633.rs",
-"ui/typeck/issue-86721-return-expr-ice.rs",
-"ui/typeof/issue-100183.rs",
-"ui/typeof/issue-29184.rs",
-"ui/typeof/issue-42060.rs",
-"ui/unboxed-closures/issue-18652.rs",
-"ui/unboxed-closures/issue-18661.rs",
-"ui/unboxed-closures/issue-30906.rs",
-"ui/unboxed-closures/issue-53448.rs",
-"ui/underscore-imports/issue-110164.rs",
-"ui/uniform-paths/auxiliary/issue-53691.rs",
-"ui/uniform-paths/issue-53691.rs",
-"ui/uninhabited/issue-107505.rs",
-"ui/union/issue-41073.rs",
-"ui/union/issue-81199.rs",
-"ui/union/issue-99375.rs",
-"ui/unsafe/auxiliary/issue-106126.rs",
-"ui/unsafe/issue-106126-good-path-bug.rs",
-"ui/unsafe/issue-3080.rs",
-"ui/unsafe/issue-45087-unreachable-unsafe.rs",
-"ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs",
-"ui/unsafe/issue-47412.rs",
-"ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs",
-"ui/unsafe/issue-87414-query-cycle.rs",
-"ui/unsized-locals/issue-30276-feature-flagged.rs",
-"ui/unsized-locals/issue-30276.rs",
-"ui/unsized-locals/issue-50940-with-feature.rs",
-"ui/unsized-locals/issue-50940.rs",
-"ui/unsized-locals/issue-67981.rs",
-"ui/unsized/issue-30355.rs",
-"ui/unsized/issue-75707.rs",
-"ui/unsized/issue-91801.rs",
-"ui/unsized/issue-91803.rs",
-"ui/unsized/issue-40231-1.rs",
-"ui/unsized/issue-40231-2.rs",
-"ui/unsized/issue-71659.rs",
-"ui/unsized/issue-75899-but-gats.rs",
-"ui/unsized/issue-75899.rs",
-"ui/unsized/issue-97732.rs",
-"ui/use/issue-18986.rs",
-"ui/use/issue-60976-extern-use-primitive-type.rs",
-"ui/wf/issue-103573.rs",
-"ui/wf/issue-110157.rs",
-"ui/wf/issue-87495.rs",
-"ui/wf/issue-95665.rs",
-"ui/wf/issue-96810.rs",
-"ui/wf/issue-48638.rs",
-"ui/where-clauses/issue-50825-1.rs",
-"ui/where-clauses/issue-50825.rs",
-"ui/issues-71798.rs",
-"ui/issue-11881.rs",
-"ui/issue-13560.rs",
-"ui/issue-16822.rs",
-"ui/issue-18502.rs",
-"ui/issue-2804.rs",
-"ui/higher-ranked/trait-bounds/issue-30786.rs",
-"ui/higher-ranked/trait-bounds/issue-36139-normalize-closure-sig.rs",
-"ui/higher-ranked/trait-bounds/issue-39292.rs",
-"ui/higher-ranked/trait-bounds/issue-46989.rs",
-"ui/higher-ranked/trait-bounds/issue-58451.rs",
-"ui/higher-ranked/trait-bounds/issue-59311.rs",
-"ui/higher-ranked/trait-bounds/issue-62203-hrtb-ice.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-71955.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90950.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-44005.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-56556.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-1.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-2.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-4.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-5.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-6.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-70120.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-74261.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-76956.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80706.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-80956.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-81809.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89436.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90612.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90638.rs",
-"ui/higher-ranked/trait-bounds/normalize-under-binder/issue-90875.rs",
-"ui/higher-ranked/trait-bounds/issue-100689.rs",
-"ui/higher-ranked/trait-bounds/issue-102899.rs",
-"ui/higher-ranked/trait-bounds/issue-42114.rs",
-"ui/higher-ranked/trait-bounds/issue-43623.rs",
-"ui/higher-ranked/trait-bounds/issue-57639.rs",
-"ui/higher-ranked/trait-bounds/issue-60283.rs",
-"ui/higher-ranked/trait-bounds/issue-88446.rs",
-"ui/higher-ranked/trait-bounds/issue-88586-hr-self-outlives-in-trait-def.rs",
-"ui/higher-ranked/trait-bounds/issue-90177.rs",
-"ui/higher-ranked/trait-bounds/issue-95034.rs",
-"ui/higher-ranked/trait-bounds/issue-95230.rs",
-"ui/issue-76387-llvm-miscompile.rs",
-"ui/issue-15924.rs",
-"ui/issue-24106.rs",
-"ui-fulldeps/plugin/auxiliary/issue-40001-plugin.rs",
-"ui-fulldeps/plugin/issue-40001.rs",
-"ui-fulldeps/plugin/issue-15778-fail.rs",
-]
\ No newline at end of file
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index d0257d71697..11480e2be60 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -302,10 +302,6 @@ pub fn check(path: &Path, bad: &mut bool) {
                 return;
             }
         }
-        // apfloat shouldn't be changed because of license problems
-        if is_in(file, "compiler", "rustc_apfloat") {
-            return;
-        }
         let mut skip_cr = contains_ignore_directive(can_contain, &contents, "cr");
         let mut skip_undocumented_unsafe =
             contains_ignore_directive(can_contain, &contents, "undocumented-unsafe");
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index f9a90bf3a00..44c7c07d3a0 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -3,9 +3,7 @@
 //! - there are no stray `.stderr` files
 
 use ignore::Walk;
-use lazy_static::lazy_static;
-use regex::Regex;
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
 use std::ffi::OsStr;
 use std::fs;
 use std::path::{Path, PathBuf};
@@ -13,7 +11,7 @@ use std::path::{Path, PathBuf};
 const ENTRY_LIMIT: usize = 900;
 // FIXME: The following limits should be reduced eventually.
 const ISSUES_ENTRY_LIMIT: usize = 1893;
-const ROOT_ENTRY_LIMIT: usize = 870;
+const ROOT_ENTRY_LIMIT: usize = 873;
 
 const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
     "rs",     // test source files
@@ -90,12 +88,6 @@ fn check_entries(tests_path: &Path, bad: &mut bool) {
 
 pub fn check(path: &Path, bad: &mut bool) {
     check_entries(&path, bad);
-
-    // the list of files in ui tests that are allowed to start with `issue-XXXX`
-    let mut allowed_issue_filenames: HashSet<String> = HashSet::from(
-        include!("issues.txt").map(|path| path.replace("/", std::path::MAIN_SEPARATOR_STR)),
-    );
-
     let (ui, ui_fulldeps) = (path.join("ui"), path.join("ui-fulldeps"));
     let paths = [ui.as_path(), ui_fulldeps.as_path()];
     crate::walk::walk_no_read(&paths, |_, _| false, &mut |entry| {
@@ -108,12 +100,7 @@ pub fn check(path: &Path, bad: &mut bool) {
             {
                 tidy_error!(bad, "file {} has unexpected extension {}", file_path.display(), ext);
             }
-
-            // NB: We do not use file_stem() as some file names have multiple `.`s and we
-            // must strip all of them.
-            let testname =
-                file_path.file_name().unwrap().to_str().unwrap().split_once('.').unwrap().0;
-            if ext == "stderr" || ext == "stdout" {
+            if ext == "stderr" || ext == "stdout" || ext == "fixed" {
                 // Test output filenames have one of the formats:
                 // ```
                 // $testname.stderr
@@ -124,7 +111,11 @@ pub fn check(path: &Path, bad: &mut bool) {
                 //
                 // For now, just make sure that there is a corresponding
                 // `$testname.rs` file.
-
+                //
+                // NB: We do not use file_stem() as some file names have multiple `.`s and we
+                // must strip all of them.
+                let testname =
+                    file_path.file_name().unwrap().to_str().unwrap().split_once('.').unwrap().0;
                 if !file_path.with_file_name(testname).with_extension("rs").exists()
                     && !testname.contains("ignore-tidy")
                 {
@@ -137,38 +128,6 @@ pub fn check(path: &Path, bad: &mut bool) {
                     }
                 }
             }
-
-            if ext == "rs" {
-                lazy_static! {
-                    static ref ISSUE_NAME_REGEX: Regex =
-                        Regex::new(r"^issues?[-_]?\d{3,}").unwrap();
-                }
-
-                if ISSUE_NAME_REGEX.is_match(testname) {
-                    // these paths are always relative to the passed `path` and always UTF8
-                    let stripped_path = file_path.strip_prefix(path).unwrap().to_str().unwrap();
-                    if !allowed_issue_filenames.remove(stripped_path) {
-                        tidy_error!(
-                            bad,
-                            "UI test `{}` should use a name that describes the test and link the issue in a comment instead.",
-                            file_path.display(),
-                        );
-                    }
-                }
-            }
         }
     });
-
-    // if an excluded file is renamed, it must be removed from this list
-    if allowed_issue_filenames.len() > 0 {
-        for file_name in allowed_issue_filenames {
-            let mut p = PathBuf::from(path);
-            p.push(file_name);
-            tidy_error!(
-                bad,
-                "file `{}` no longer exists and should be removed from the exclusions in `src/tools/tidy/src/issues.txt`",
-                p.display()
-            );
-        }
-    }
 }
diff --git a/tests/assembly/is_aligned.rs b/tests/assembly/is_aligned.rs
index 148d11ee4d6..d152d200adf 100644
--- a/tests/assembly/is_aligned.rs
+++ b/tests/assembly/is_aligned.rs
@@ -1,5 +1,4 @@
 // assembly-output: emit-asm
-// min-llvm-version: 15.0
 // only-x86_64
 // ignore-sgx
 // revisions: opt-speed opt-size
diff --git a/tests/assembly/slice-is_ascii.rs b/tests/assembly/slice-is_ascii.rs
index b3e1fee15a7..12412116467 100644
--- a/tests/assembly/slice-is_ascii.rs
+++ b/tests/assembly/slice-is_ascii.rs
@@ -3,7 +3,6 @@
 // [LIN] only-linux
 // assembly-output: emit-asm
 // compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
-// min-llvm-version: 14
 // only-x86_64
 // ignore-sgx
 // ignore-debug
diff --git a/tests/assembly/strict_provenance.rs b/tests/assembly/strict_provenance.rs
index 24a7c6b5bf1..ef8566a93e2 100644
--- a/tests/assembly/strict_provenance.rs
+++ b/tests/assembly/strict_provenance.rs
@@ -2,7 +2,6 @@
 // compile-flags: -Copt-level=1
 // only-x86_64
 // ignore-sgx
-// min-llvm-version: 15.0
 #![crate_type = "rlib"]
 
 // CHECK-LABEL: old_style
diff --git a/tests/codegen/abi-main-signature-16bit-c-int.rs b/tests/codegen/abi-main-signature-16bit-c-int.rs
index 353e7489b55..ce4d35dea0c 100644
--- a/tests/codegen/abi-main-signature-16bit-c-int.rs
+++ b/tests/codegen/abi-main-signature-16bit-c-int.rs
@@ -2,22 +2,10 @@
 // entry point. It must match C's `int main(int, char **)`.
 
 // This test is for targets with 16bit c_int only.
-// ignore-aarch64
-// ignore-arm
-// ignore-asmjs
-// ignore-hexagon
-// ignore-mips
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-riscv64
-// ignore-s390x
-// ignore-sparc
-// ignore-sparc64
-// ignore-wasm32
-// ignore-x86
-// ignore-x86_64
-// ignore-loongarch64
+// revisions: avr msp
+//[avr] only-avr
+//[msp] only-msp430
+
 
 fn main() {
 }
diff --git a/tests/codegen/abi-main-signature-32bit-c-int.rs b/tests/codegen/abi-main-signature-32bit-c-int.rs
index 7f22ddcfc12..34571823f13 100644
--- a/tests/codegen/abi-main-signature-32bit-c-int.rs
+++ b/tests/codegen/abi-main-signature-32bit-c-int.rs
@@ -3,8 +3,9 @@
 
 // This test is for targets with 32bit c_int only.
 // ignore-msp430
+// ignore-avr
 
 fn main() {
 }
 
-// CHECK: define{{( hidden)?}} i32 @main(i32{{( %0)?}}, {{i8\*\*|ptr}}{{( %1)?}})
+// CHECK: define{{( hidden)?}} i32 @main(i32{{( %0)?}}, ptr{{( %1)?}})
diff --git a/tests/codegen/addr-of-mutate.rs b/tests/codegen/addr-of-mutate.rs
index 6dfc1825015..97af6181524 100644
--- a/tests/codegen/addr-of-mutate.rs
+++ b/tests/codegen/addr-of-mutate.rs
@@ -1,5 +1,4 @@
 // compile-flags: -C opt-level=3 -C no-prepopulate-passes
-// min-llvm-version: 15.0 (for opaque pointers)
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/adjustments.rs b/tests/codegen/adjustments.rs
index b53a68a5588..0739c79ba8d 100644
--- a/tests/codegen/adjustments.rs
+++ b/tests/codegen/adjustments.rs
@@ -13,9 +13,9 @@ pub fn helper(_: usize) {
 pub fn no_op_slice_adjustment(x: &[u8]) -> &[u8] {
     // We used to generate an extra alloca and memcpy for the block's trailing expression value, so
     // check that we copy directly to the return value slot
-// CHECK: %0 = insertvalue { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } poison, {{\[0 x i8\]\*|ptr}} %x.0, 0
-// CHECK: %1 = insertvalue { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } %0, [[USIZE]] %x.1, 1
-// CHECK: ret { {{\[0 x i8\]\*|ptr}}, [[USIZE]] } %1
+// CHECK: %0 = insertvalue { ptr, [[USIZE]] } poison, ptr %x.0, 0
+// CHECK: %1 = insertvalue { ptr, [[USIZE]] } %0, [[USIZE]] %x.1, 1
+// CHECK: ret { ptr, [[USIZE]] } %1
     { x }
 }
 
diff --git a/tests/codegen/align-enum.rs b/tests/codegen/align-enum.rs
index 70f09ace006..5901f0113c3 100644
--- a/tests/codegen/align-enum.rs
+++ b/tests/codegen/align-enum.rs
@@ -20,7 +20,7 @@ pub struct Nested64 {
 #[no_mangle]
 pub fn align64(a: u32) -> Align64 {
 // CHECK: %a64 = alloca %Align64, align 64
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 64 %{{.*}}, {{i8\*|ptr}} align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 64 %{{.*}}, ptr align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
     let a64 = Align64::A(a);
     a64
 }
diff --git a/tests/codegen/align-offset.rs b/tests/codegen/align-offset.rs
index 7c7660c5a55..d4d8b18d35b 100644
--- a/tests/codegen/align-offset.rs
+++ b/tests/codegen/align-offset.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O
-// min-llvm-version: 15.0 (because we're using opaque pointers)
 // ignore-debug (debug assertions in `slice::from_raw_parts` block optimizations)
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/align-struct.rs b/tests/codegen/align-struct.rs
index a2f47354b2b..40bba6d5254 100644
--- a/tests/codegen/align-struct.rs
+++ b/tests/codegen/align-struct.rs
@@ -32,7 +32,7 @@ pub enum Enum64 {
 #[no_mangle]
 pub fn align64(i : i32) -> Align64 {
 // CHECK: %a64 = alloca %Align64, align 64
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 64 %{{.*}}, {{i8\*|ptr}} align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 64 %{{.*}}, ptr align 64 %{{.*}}, i{{[0-9]+}} 64, i1 false)
     let a64 = Align64(i);
     a64
 }
@@ -42,7 +42,7 @@ pub fn align64(i : i32) -> Align64 {
 // CHECK-LABEL: @align64_load
 #[no_mangle]
 pub fn align64_load(a: Align64) -> i32 {
-// CHECK: {{%.*}} = load i32, {{i32\*|ptr}} {{%.*}}, align 64
+// CHECK: {{%.*}} = load i32, ptr {{%.*}}, align 64
     a.0
 }
 
diff --git a/tests/codegen/array-codegen.rs b/tests/codegen/array-codegen.rs
index 71acd781549..ba0d444f97e 100644
--- a/tests/codegen/array-codegen.rs
+++ b/tests/codegen/array-codegen.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O -C no-prepopulate-passes
-// min-llvm-version: 15.0 (for opaque pointers)
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/array-equality.rs b/tests/codegen/array-equality.rs
index abfe295f8b6..1941452ea61 100644
--- a/tests/codegen/array-equality.rs
+++ b/tests/codegen/array-equality.rs
@@ -16,8 +16,8 @@ pub fn array_eq_value(a: [u16; 3], b: [u16; 3]) -> bool {
 #[no_mangle]
 pub fn array_eq_ref(a: &[u16; 3], b: &[u16; 3]) -> bool {
     // CHECK: start:
-    // CHECK: load i48, {{i48\*|ptr}} %{{.+}}, align 2
-    // CHECK: load i48, {{i48\*|ptr}} %{{.+}}, align 2
+    // CHECK: load i48, ptr %{{.+}}, align 2
+    // CHECK: load i48, ptr %{{.+}}, align 2
     // CHECK: icmp eq i48
     // CHECK-NEXT: ret
     a == b
@@ -27,7 +27,7 @@ pub fn array_eq_ref(a: &[u16; 3], b: &[u16; 3]) -> bool {
 #[no_mangle]
 pub fn array_eq_value_still_passed_by_pointer(a: [u16; 9], b: [u16; 9]) -> bool {
     // CHECK-NEXT: start:
-    // CHECK: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}({{i8\*|ptr}} {{.*}} dereferenceable(18) %{{.+}}, {{i8\*|ptr}} {{.*}} dereferenceable(18) %{{.+}}, i64 18)
+    // CHECK: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(ptr {{.*}} dereferenceable(18) %{{.+}}, ptr {{.*}} dereferenceable(18) %{{.+}}, i64 18)
     // CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
     // CHECK-NEXT: ret i1 %[[EQ]]
     a == b
@@ -37,7 +37,7 @@ pub fn array_eq_value_still_passed_by_pointer(a: [u16; 9], b: [u16; 9]) -> bool
 #[no_mangle]
 pub fn array_eq_long(a: &[u16; 1234], b: &[u16; 1234]) -> bool {
     // CHECK-NEXT: start:
-    // CHECK: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}({{i8\*|ptr}} {{.*}} dereferenceable(2468) %{{.+}}, {{i8\*|ptr}} {{.*}} dereferenceable(2468) %{{.+}}, i64 2468)
+    // CHECK: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(ptr {{.*}} dereferenceable(2468) %{{.+}}, ptr {{.*}} dereferenceable(2468) %{{.+}}, i64 2468)
     // CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
     // CHECK-NEXT: ret i1 %[[EQ]]
     a == b
diff --git a/tests/codegen/atomic-operations.rs b/tests/codegen/atomic-operations.rs
index d2bc618dfc5..20980c48960 100644
--- a/tests/codegen/atomic-operations.rs
+++ b/tests/codegen/atomic-operations.rs
@@ -7,37 +7,37 @@ use std::sync::atomic::{AtomicI32, Ordering::*};
 // CHECK-LABEL: @compare_exchange
 #[no_mangle]
 pub fn compare_exchange(a: &AtomicI32) {
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 10 monotonic monotonic
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 11 monotonic acquire
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 12 monotonic seq_cst
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 10 monotonic monotonic
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 11 monotonic acquire
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 12 monotonic seq_cst
     let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
     let _ = a.compare_exchange(0, 11, Relaxed, Acquire);
     let _ = a.compare_exchange(0, 12, Relaxed, SeqCst);
 
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 20 release monotonic
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 21 release acquire
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 22 release seq_cst
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 20 release monotonic
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 21 release acquire
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 22 release seq_cst
     let _ = a.compare_exchange(0, 20, Release, Relaxed);
     let _ = a.compare_exchange(0, 21, Release, Acquire);
     let _ = a.compare_exchange(0, 22, Release, SeqCst);
 
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 30 acquire monotonic
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 31 acquire acquire
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 32 acquire seq_cst
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 30 acquire monotonic
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 31 acquire acquire
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 32 acquire seq_cst
     let _ = a.compare_exchange(0, 30, Acquire, Relaxed);
     let _ = a.compare_exchange(0, 31, Acquire, Acquire);
     let _ = a.compare_exchange(0, 32, Acquire, SeqCst);
 
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 40 acq_rel monotonic
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 41 acq_rel acquire
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 42 acq_rel seq_cst
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 40 acq_rel monotonic
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 41 acq_rel acquire
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 42 acq_rel seq_cst
     let _ = a.compare_exchange(0, 40, AcqRel, Relaxed);
     let _ = a.compare_exchange(0, 41, AcqRel, Acquire);
     let _ = a.compare_exchange(0, 42, AcqRel, SeqCst);
 
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 50 seq_cst monotonic
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 51 seq_cst acquire
-    // CHECK: cmpxchg {{i32\*|ptr}} %{{.*}}, i32 0, i32 52 seq_cst seq_cst
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 50 seq_cst monotonic
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 51 seq_cst acquire
+    // CHECK: cmpxchg ptr %{{.*}}, i32 0, i32 52 seq_cst seq_cst
     let _ = a.compare_exchange(0, 50, SeqCst, Relaxed);
     let _ = a.compare_exchange(0, 51, SeqCst, Acquire);
     let _ = a.compare_exchange(0, 52, SeqCst, SeqCst);
@@ -46,37 +46,37 @@ pub fn compare_exchange(a: &AtomicI32) {
 // CHECK-LABEL: @compare_exchange_weak
 #[no_mangle]
 pub fn compare_exchange_weak(w: &AtomicI32) {
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 10 monotonic monotonic
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 11 monotonic acquire
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 12 monotonic seq_cst
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 10 monotonic monotonic
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 11 monotonic acquire
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 12 monotonic seq_cst
     let _ = w.compare_exchange_weak(1, 10, Relaxed, Relaxed);
     let _ = w.compare_exchange_weak(1, 11, Relaxed, Acquire);
     let _ = w.compare_exchange_weak(1, 12, Relaxed, SeqCst);
 
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 20 release monotonic
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 21 release acquire
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 22 release seq_cst
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 20 release monotonic
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 21 release acquire
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 22 release seq_cst
     let _ = w.compare_exchange_weak(1, 20, Release, Relaxed);
     let _ = w.compare_exchange_weak(1, 21, Release, Acquire);
     let _ = w.compare_exchange_weak(1, 22, Release, SeqCst);
 
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 30 acquire monotonic
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 31 acquire acquire
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 32 acquire seq_cst
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 30 acquire monotonic
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 31 acquire acquire
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 32 acquire seq_cst
     let _ = w.compare_exchange_weak(1, 30, Acquire, Relaxed);
     let _ = w.compare_exchange_weak(1, 31, Acquire, Acquire);
     let _ = w.compare_exchange_weak(1, 32, Acquire, SeqCst);
 
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 40 acq_rel monotonic
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 41 acq_rel acquire
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 42 acq_rel seq_cst
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 40 acq_rel monotonic
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 41 acq_rel acquire
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 42 acq_rel seq_cst
     let _ = w.compare_exchange_weak(1, 40, AcqRel, Relaxed);
     let _ = w.compare_exchange_weak(1, 41, AcqRel, Acquire);
     let _ = w.compare_exchange_weak(1, 42, AcqRel, SeqCst);
 
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 50 seq_cst monotonic
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 51 seq_cst acquire
-    // CHECK: cmpxchg weak {{i32\*|ptr}} %{{.*}}, i32 1, i32 52 seq_cst seq_cst
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 50 seq_cst monotonic
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 51 seq_cst acquire
+    // CHECK: cmpxchg weak ptr %{{.*}}, i32 1, i32 52 seq_cst seq_cst
     let _ = w.compare_exchange_weak(1, 50, SeqCst, Relaxed);
     let _ = w.compare_exchange_weak(1, 51, SeqCst, Acquire);
     let _ = w.compare_exchange_weak(1, 52, SeqCst, SeqCst);
diff --git a/tests/codegen/avr/avr-func-addrspace.rs b/tests/codegen/avr/avr-func-addrspace.rs
index 83baae9e432..dc36a9fac8c 100644
--- a/tests/codegen/avr/avr-func-addrspace.rs
+++ b/tests/codegen/avr/avr-func-addrspace.rs
@@ -94,7 +94,7 @@ pub extern "C" fn test() {
 
 // Validate that we can codegen transmutes between data ptrs and fn ptrs.
 
-// CHECK: define{{.+}}{{void \(\) addrspace\(1\)\*|ptr addrspace\(1\)}} @transmute_data_ptr_to_fn({{\{\}\*|ptr}}{{.*}} %x)
+// CHECK: define{{.+}}ptr addrspace(1) @transmute_data_ptr_to_fn(ptr{{.*}} %x)
 #[no_mangle]
 pub unsafe fn transmute_data_ptr_to_fn(x: *const ()) -> fn() {
     // It doesn't matter precisely how this is codegenned (through memory or an addrspacecast),
@@ -102,7 +102,7 @@ pub unsafe fn transmute_data_ptr_to_fn(x: *const ()) -> fn() {
     transmute(x)
 }
 
-// CHECK: define{{.+}}{{\{\}\*|ptr}} @transmute_fn_ptr_to_data({{void \(\) addrspace\(1\)\*|ptr addrspace\(1\)}}{{.*}} %x)
+// CHECK: define{{.+}}ptr @transmute_fn_ptr_to_data(ptr addrspace(1){{.*}} %x)
 #[no_mangle]
 pub unsafe fn transmute_fn_ptr_to_data(x: fn()) -> *const () {
     // It doesn't matter precisely how this is codegenned (through memory or an addrspacecast),
@@ -116,7 +116,7 @@ pub enum Either<T, U> { A(T), B(U) }
 // with the `ptr` field representing both `&i32` and `fn()` depending on the variant.
 // This is incorrect, because `fn()` should be `ptr addrspace(1)`, not `ptr`.
 
-// CHECK: define{{.+}}void @should_not_combine_addrspace({{.+\*|ptr}}{{.+}}sret{{.+}}%_0, {{.+\*|ptr}}{{.+}}%x)
+// CHECK: define{{.+}}void @should_not_combine_addrspace(ptr{{.+}}sret{{.+}}%_0, ptr{{.+}}%x)
 #[no_mangle]
 #[inline(never)]
 pub fn should_not_combine_addrspace(x: Either<&i32, fn()>) -> Either<&i32, fn()> {
diff --git a/tests/codegen/box-maybe-uninit.rs b/tests/codegen/box-maybe-uninit.rs
index 5c08b5832ad..282af99b067 100644
--- a/tests/codegen/box-maybe-uninit.rs
+++ b/tests/codegen/box-maybe-uninit.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O
-// min-llvm-version: 15.0
 #![crate_type = "lib"]
 
 use std::mem::MaybeUninit;
diff --git a/tests/codegen/comparison-operators-2-tuple.rs b/tests/codegen/comparison-operators-2-tuple.rs
index a9d25e3b53c..7a2a3fc93f8 100644
--- a/tests/codegen/comparison-operators-2-tuple.rs
+++ b/tests/codegen/comparison-operators-2-tuple.rs
@@ -1,5 +1,4 @@
 // compile-flags: -C opt-level=1 -Z merge-functions=disabled
-// min-llvm-version: 15.0
 // only-x86_64
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/comparison-operators-newtype.rs b/tests/codegen/comparison-operators-newtype.rs
index 683a2bd4fbb..8fd8a81dfeb 100644
--- a/tests/codegen/comparison-operators-newtype.rs
+++ b/tests/codegen/comparison-operators-newtype.rs
@@ -3,7 +3,6 @@
 // in the operators for such a type all optimize away.
 
 // compile-flags: -C opt-level=1
-// min-llvm-version: 15.0
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/consts.rs b/tests/codegen/consts.rs
index 810da581ce9..3797e1a99da 100644
--- a/tests/codegen/consts.rs
+++ b/tests/codegen/consts.rs
@@ -1,5 +1,4 @@
 // compile-flags: -C no-prepopulate-passes
-// min-llvm-version: 15.0 (for opaque pointers)
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/drop-in-place-noalias.rs b/tests/codegen/drop-in-place-noalias.rs
index 725e6fc048d..ece1e426c08 100644
--- a/tests/codegen/drop-in-place-noalias.rs
+++ b/tests/codegen/drop-in-place-noalias.rs
@@ -7,9 +7,9 @@
 
 use std::marker::PhantomPinned;
 
-// CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructUnpin{{.*}}({{.*\*|ptr}} noalias noundef align 4 dereferenceable(12) %{{.+}})
+// CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructUnpin{{.*}}(ptr noalias noundef align 4 dereferenceable(12) %{{.+}})
 
-// CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructNotUnpin{{.*}}({{.*\*|ptr}} noundef nonnull align 4 %{{.+}})
+// CHECK: define internal void @{{.*}}core{{.*}}ptr{{.*}}drop_in_place{{.*}}StructNotUnpin{{.*}}(ptr noundef nonnull align 4 %{{.+}})
 
 pub struct StructUnpin {
     a: i32,
diff --git a/tests/codegen/fastcall-inreg.rs b/tests/codegen/fastcall-inreg.rs
index 02f5d545910..ab19efa45bf 100644
--- a/tests/codegen/fastcall-inreg.rs
+++ b/tests/codegen/fastcall-inreg.rs
@@ -19,7 +19,7 @@ pub mod tests {
     #[no_mangle]
     pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}
 
-    // CHECK: @f2({{i32\*|ptr}} inreg noundef %_1, {{i32\*|ptr}} inreg noundef %_2, {{i32\*|ptr}} noundef %_3)
+    // CHECK: @f2(ptr inreg noundef %_1, ptr inreg noundef %_2, ptr noundef %_3)
     #[no_mangle]
     pub extern "fastcall" fn f2(_: *const i32, _: *const i32, _: *const i32) {}
 
diff --git a/tests/codegen/function-arguments-noopt.rs b/tests/codegen/function-arguments-noopt.rs
index f99cc8fb415..8fe6c790dda 100644
--- a/tests/codegen/function-arguments-noopt.rs
+++ b/tests/codegen/function-arguments-noopt.rs
@@ -23,13 +23,13 @@ pub fn boolean_call(x: bool, f: fn(bool) -> bool) -> bool {
   f(x)
 }
 
-// CHECK: align 4 {{i32\*|ptr}} @borrow({{i32\*|ptr}} align 4 %x)
+// CHECK: align 4 ptr @borrow(ptr align 4 %x)
 #[no_mangle]
 pub fn borrow(x: &i32) -> &i32 {
   x
 }
 
-// CHECK: align 4 {{i32\*|ptr}} @borrow_mut({{i32\*|ptr}} align 4 %x)
+// CHECK: align 4 ptr @borrow_mut(ptr align 4 %x)
 #[no_mangle]
 pub fn borrow_mut(x: &mut i32) -> &mut i32 {
   x
@@ -38,11 +38,11 @@ pub fn borrow_mut(x: &mut i32) -> &mut i32 {
 // CHECK-LABEL: @borrow_call
 #[no_mangle]
 pub fn borrow_call(x: &i32, f: fn(&i32) -> &i32) -> &i32 {
-  // CHECK: call align 4 {{i32\*|ptr}} %f({{i32\*|ptr}} align 4 %x)
+  // CHECK: call align 4 ptr %f(ptr align 4 %x)
   f(x)
 }
 
-// CHECK: void @struct_({{%S\*|ptr}} sret(%S) align 4{{( %_0)?}}, {{%S\*|ptr}} align 4 %x)
+// CHECK: void @struct_(ptr sret(%S) align 4{{( %_0)?}}, ptr align 4 %x)
 #[no_mangle]
 pub fn struct_(x: S) -> S {
   x
@@ -51,7 +51,7 @@ pub fn struct_(x: S) -> S {
 // CHECK-LABEL: @struct_call
 #[no_mangle]
 pub fn struct_call(x: S, f: fn(S) -> S) -> S {
-  // CHECK: call void %f({{%S\*|ptr}} sret(%S) align 4{{( %_0)?}}, {{%S\*|ptr}} align 4 %{{.+}})
+  // CHECK: call void %f(ptr sret(%S) align 4{{( %_0)?}}, ptr align 4 %{{.+}})
   f(x)
 }
 
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs
index 2f047f10311..a218596da1d 100644
--- a/tests/codegen/function-arguments.rs
+++ b/tests/codegen/function-arguments.rs
@@ -80,95 +80,95 @@ pub fn option_nonzero_int(x: Option<NonZeroU64>) -> Option<NonZeroU64> {
   x
 }
 
-// CHECK: @readonly_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable(4) %_1)
+// CHECK: @readonly_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn readonly_borrow(_: &i32) {
 }
 
-// CHECK: noundef align 4 dereferenceable(4) {{i32\*|ptr}} @readonly_borrow_ret()
+// CHECK: noundef align 4 dereferenceable(4) ptr @readonly_borrow_ret()
 #[no_mangle]
 pub fn readonly_borrow_ret() -> &'static i32 {
   loop {}
 }
 
-// CHECK: @static_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable(4) %_1)
+// CHECK: @static_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
 // static borrow may be captured
 #[no_mangle]
 pub fn static_borrow(_: &'static i32) {
 }
 
-// CHECK: @named_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable(4) %_1)
+// CHECK: @named_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
 // borrow with named lifetime may be captured
 #[no_mangle]
 pub fn named_borrow<'r>(_: &'r i32) {
 }
 
-// CHECK: @unsafe_borrow({{i16\*|ptr}} noundef nonnull align 2 %_1)
+// CHECK: @unsafe_borrow(ptr noundef nonnull align 2 %_1)
 // unsafe interior means this isn't actually readonly and there may be aliases ...
 #[no_mangle]
 pub fn unsafe_borrow(_: &UnsafeInner) {
 }
 
-// CHECK: @mutable_unsafe_borrow({{i16\*|ptr}} noalias noundef align 2 dereferenceable(2) %_1)
+// CHECK: @mutable_unsafe_borrow(ptr noalias noundef align 2 dereferenceable(2) %_1)
 // ... unless this is a mutable borrow, those never alias
 #[no_mangle]
 pub fn mutable_unsafe_borrow(_: &mut UnsafeInner) {
 }
 
-// CHECK: @mutable_borrow({{i32\*|ptr}} noalias noundef align 4 dereferenceable(4) %_1)
+// CHECK: @mutable_borrow(ptr noalias noundef align 4 dereferenceable(4) %_1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_borrow(_: &mut i32) {
 }
 
-// CHECK: noundef align 4 dereferenceable(4) {{i32\*|ptr}} @mutable_borrow_ret()
+// CHECK: noundef align 4 dereferenceable(4) ptr @mutable_borrow_ret()
 #[no_mangle]
 pub fn mutable_borrow_ret() -> &'static mut i32 {
   loop {}
 }
 
 #[no_mangle]
-// CHECK: @mutable_notunpin_borrow({{i32\*|ptr}} noundef nonnull align 4 %_1)
+// CHECK: @mutable_notunpin_borrow(ptr noundef nonnull align 4 %_1)
 // This one is *not* `noalias` because it might be self-referential.
 // It is also not `dereferenceable` due to
 // <https://github.com/rust-lang/unsafe-code-guidelines/issues/381>.
 pub fn mutable_notunpin_borrow(_: &mut NotUnpin) {
 }
 
-// CHECK: @notunpin_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable(4) %_1)
+// CHECK: @notunpin_borrow(ptr noalias noundef readonly align 4 dereferenceable(4) %_1)
 // But `&NotUnpin` behaves perfectly normal.
 #[no_mangle]
 pub fn notunpin_borrow(_: &NotUnpin) {
 }
 
-// CHECK: @indirect_struct({{%S\*|ptr}} noalias nocapture noundef readonly align 4 dereferenceable(32) %_1)
+// CHECK: @indirect_struct(ptr noalias nocapture noundef readonly align 4 dereferenceable(32) %_1)
 #[no_mangle]
 pub fn indirect_struct(_: S) {
 }
 
-// CHECK: @borrowed_struct({{%S\*|ptr}} noalias noundef readonly align 4 dereferenceable(32) %_1)
+// CHECK: @borrowed_struct(ptr noalias noundef readonly align 4 dereferenceable(32) %_1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn borrowed_struct(_: &S) {
 }
 
-// CHECK: @option_borrow({{i32\*|ptr}} noalias noundef readonly align 4 dereferenceable_or_null(4) %x)
+// CHECK: @option_borrow(ptr noalias noundef readonly align 4 dereferenceable_or_null(4) %x)
 #[no_mangle]
 pub fn option_borrow(x: Option<&i32>) {
 }
 
-// CHECK: @option_borrow_mut({{i32\*|ptr}} noalias noundef align 4 dereferenceable_or_null(4) %x)
+// CHECK: @option_borrow_mut(ptr noalias noundef align 4 dereferenceable_or_null(4) %x)
 #[no_mangle]
 pub fn option_borrow_mut(x: Option<&mut i32>) {
 }
 
-// CHECK: @raw_struct({{%S\*|ptr}} noundef %_1)
+// CHECK: @raw_struct(ptr noundef %_1)
 #[no_mangle]
 pub fn raw_struct(_: *const S) {
 }
 
-// CHECK: @raw_option_nonnull_struct({{i32\*|ptr}} noundef %_1)
+// CHECK: @raw_option_nonnull_struct(ptr noundef %_1)
 #[no_mangle]
 pub fn raw_option_nonnull_struct(_: Option<NonNull<S>>) {
 }
@@ -176,19 +176,19 @@ pub fn raw_option_nonnull_struct(_: Option<NonNull<S>>) {
 
 // `Box` can get deallocated during execution of the function, so it should
 // not get `dereferenceable`.
-// CHECK: noundef nonnull align 4 {{i32\*|ptr}} @_box({{i32\*|ptr}} noalias noundef nonnull align 4 %x)
+// CHECK: noundef nonnull align 4 ptr @_box(ptr noalias noundef nonnull align 4 %x)
 #[no_mangle]
 pub fn _box(x: Box<i32>) -> Box<i32> {
   x
 }
 
-// CHECK: noundef nonnull align 4 {{i32\*|ptr}} @notunpin_box({{i32\*|ptr}} noundef nonnull align 4 %x)
+// CHECK: noundef nonnull align 4 ptr @notunpin_box(ptr noundef nonnull align 4 %x)
 #[no_mangle]
 pub fn notunpin_box(x: Box<NotUnpin>) -> Box<NotUnpin> {
   x
 }
 
-// CHECK: @struct_return({{%S\*|ptr}} noalias nocapture noundef sret(%S) align 4 dereferenceable(32){{( %_0)?}})
+// CHECK: @struct_return(ptr noalias nocapture noundef sret(%S) align 4 dereferenceable(32){{( %_0)?}})
 #[no_mangle]
 pub fn struct_return() -> S {
   S {
@@ -202,68 +202,68 @@ pub fn struct_return() -> S {
 pub fn helper(_: usize) {
 }
 
-// CHECK: @slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @slice(ptr noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn slice(_: &[u8]) {
 }
 
-// CHECK: @mutable_slice({{\[0 x i8\]\*|ptr}} noalias noundef nonnull align 1 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @mutable_slice(ptr noalias noundef nonnull align 1 %_1.0, [[USIZE]] noundef %_1.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_slice(_: &mut [u8]) {
 }
 
-// CHECK: @unsafe_slice({{\[0 x i16\]\*|ptr}} noundef nonnull align 2 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @unsafe_slice(ptr noundef nonnull align 2 %_1.0, [[USIZE]] noundef %_1.1)
 // unsafe interior means this isn't actually readonly and there may be aliases ...
 #[no_mangle]
 pub fn unsafe_slice(_: &[UnsafeInner]) {
 }
 
-// CHECK: @raw_slice({{\[0 x i8\]\*|ptr}} noundef %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @raw_slice(ptr noundef %_1.0, [[USIZE]] noundef %_1.1)
 #[no_mangle]
 pub fn raw_slice(_: *const [u8]) {
 }
 
-// CHECK: @str({{\[0 x i8\]\*|ptr}} noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
+// CHECK: @str(ptr noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] noundef %_1.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn str(_: &[u8]) {
 }
 
-// CHECK: @trait_borrow({{\{\}\*|ptr}} noundef nonnull align 1 %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
+// CHECK: @trait_borrow(ptr noundef nonnull align 1 %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn trait_borrow(_: &dyn Drop) {
 }
 
-// CHECK: @option_trait_borrow({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
+// CHECK: @option_trait_borrow(ptr noundef align 1 %x.0, ptr %x.1)
 #[no_mangle]
 pub fn option_trait_borrow(x: Option<&dyn Drop>) {
 }
 
-// CHECK: @option_trait_borrow_mut({{i8\*|ptr}} noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
+// CHECK: @option_trait_borrow_mut(ptr noundef align 1 %x.0, ptr %x.1)
 #[no_mangle]
 pub fn option_trait_borrow_mut(x: Option<&mut dyn Drop>) {
 }
 
-// CHECK: @trait_raw({{\{\}\*|ptr}} noundef %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
+// CHECK: @trait_raw(ptr noundef %_1.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
 #[no_mangle]
 pub fn trait_raw(_: *const dyn Drop) {
 }
 
-// CHECK: @trait_box({{\{\}\*|ptr}} noalias noundef nonnull align 1{{( %0)?}}, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}})
+// CHECK: @trait_box(ptr noalias noundef nonnull align 1{{( %0)?}}, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}})
 #[no_mangle]
 pub fn trait_box(_: Box<dyn Drop + Unpin>) {
 }
 
-// CHECK: { {{i8\*|ptr}}, {{i8\*|ptr}} } @trait_option({{i8\*|ptr}} noalias noundef align 1 %x.0, {{i8\*|ptr}} %x.1)
+// CHECK: { ptr, ptr } @trait_option(ptr noalias noundef align 1 %x.0, ptr %x.1)
 #[no_mangle]
 pub fn trait_option(x: Option<Box<dyn Drop + Unpin>>) -> Option<Box<dyn Drop + Unpin>> {
   x
 }
 
-// CHECK: { {{\[0 x i16\]\*|ptr}}, [[USIZE]] } @return_slice({{\[0 x i16\]\*|ptr}} noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] noundef %x.1)
+// CHECK: { ptr, [[USIZE]] } @return_slice(ptr noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] noundef %x.1)
 #[no_mangle]
 pub fn return_slice(x: &[u16]) -> &[u16] {
   x
@@ -281,7 +281,7 @@ pub fn enum_id_2(x: Option<u8>) -> Option<u8> {
   x
 }
 
-// CHECK: { {{\{\}\*|ptr}}, {{.+}} } @dyn_star({{\{\}\*|ptr}} noundef %x.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %x.1)
+// CHECK: { ptr, {{.+}} } @dyn_star(ptr noundef %x.0, {{.+}} noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %x.1)
 // Expect an ABI something like `{ {}*, [3 x i64]* }`, but that's hard to match on generically,
 // so do like the `trait_box` test and just match on `{{.+}}` for the vtable.
 #[no_mangle]
diff --git a/tests/codegen/global_asm.rs b/tests/codegen/global_asm.rs
index 41a99530ad2..4c2ccf4e0e9 100644
--- a/tests/codegen/global_asm.rs
+++ b/tests/codegen/global_asm.rs
@@ -1,24 +1,6 @@
-// ignore-aarch64
-// ignore-arm
-// ignore-avr
-// ignore-bpf
-// ignore-bpf
-// ignore-hexagon
-// ignore-mips
-// ignore-mips64
-// ignore-msp430
-// ignore-powerpc64
-// ignore-powerpc
-// ignore-sparc
-// ignore-sparc64
-// ignore-s390x
-// ignore-thumb
-// ignore-nvptx64
-// ignore-spirv
-// ignore-wasm32
-// ignore-wasm64
-// ignore-emscripten
-// ignore-loongarch64
+// revisions: x32 x64
+//[x32] only-x86
+//[x64] only-x86_64
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/global_asm_include.rs b/tests/codegen/global_asm_include.rs
index e25c164f407..0fede8c71e4 100644
--- a/tests/codegen/global_asm_include.rs
+++ b/tests/codegen/global_asm_include.rs
@@ -1,24 +1,6 @@
-// ignore-aarch64
-// ignore-arm
-// ignore-avr
-// ignore-bpf
-// ignore-bpf
-// ignore-hexagon
-// ignore-mips
-// ignore-mips64
-// ignore-msp430
-// ignore-powerpc64
-// ignore-powerpc
-// ignore-sparc
-// ignore-sparc64
-// ignore-s390x
-// ignore-thumb
-// ignore-nvptx64
-// ignore-spirv
-// ignore-wasm32
-// ignore-wasm64
-// ignore-emscripten
-// ignore-loongarch64
+// revisions: x32 x64
+//[x32] only-x86
+//[x64] only-x86_64
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/global_asm_x2.rs b/tests/codegen/global_asm_x2.rs
index 71ecef124f1..1fc2825b2bd 100644
--- a/tests/codegen/global_asm_x2.rs
+++ b/tests/codegen/global_asm_x2.rs
@@ -1,24 +1,6 @@
-// ignore-aarch64
-// ignore-arm
-// ignore-avr
-// ignore-bpf
-// ignore-bpf
-// ignore-hexagon
-// ignore-mips
-// ignore-mips64
-// ignore-msp430
-// ignore-powerpc64
-// ignore-powerpc
-// ignore-sparc
-// ignore-sparc64
-// ignore-s390x
-// ignore-thumb
-// ignore-nvptx64
-// ignore-spirv
-// ignore-wasm32
-// ignore-wasm64
-// ignore-emscripten
-// ignore-loongarch64
+// revisions: x32 x64
+//[x32] only-x86
+//[x64] only-x86_64
 // compile-flags: -C no-prepopulate-passes
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/intrinsics/mask.rs b/tests/codegen/intrinsics/mask.rs
index 8f93da2e5da..82131c55847 100644
--- a/tests/codegen/intrinsics/mask.rs
+++ b/tests/codegen/intrinsics/mask.rs
@@ -7,6 +7,6 @@
 #[no_mangle]
 pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
     // CHECK: call
-    // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%1}}, [[WORD]] %mask)
+    // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]](ptr {{%ptr|%1}}, [[WORD]] %mask)
     core::intrinsics::ptr_mask(ptr, mask)
 }
diff --git a/tests/codegen/intrinsics/nontemporal.rs b/tests/codegen/intrinsics/nontemporal.rs
index d8ee2945266..dc020c12119 100644
--- a/tests/codegen/intrinsics/nontemporal.rs
+++ b/tests/codegen/intrinsics/nontemporal.rs
@@ -6,7 +6,7 @@
 #[no_mangle]
 pub fn a(a: &mut u32, b: u32) {
     // CHECK-LABEL: define{{.*}}void @a
-    // CHECK: store i32 %b, {{i32\*|ptr}} %a, align 4, !nontemporal
+    // CHECK: store i32 %b, ptr %a, align 4, !nontemporal
     unsafe {
         std::intrinsics::nontemporal_store(a, b);
     }
diff --git a/tests/codegen/intrinsics/offset.rs b/tests/codegen/intrinsics/offset.rs
index 7fc4f4498d6..542bacf99a8 100644
--- a/tests/codegen/intrinsics/offset.rs
+++ b/tests/codegen/intrinsics/offset.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O -C no-prepopulate-passes
-// min-llvm-version: 15.0 (because we're using opaque pointers)
 
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
diff --git a/tests/codegen/intrinsics/transmute-niched.rs b/tests/codegen/intrinsics/transmute-niched.rs
index fffc24a1181..e9c8d803cb9 100644
--- a/tests/codegen/intrinsics/transmute-niched.rs
+++ b/tests/codegen/intrinsics/transmute-niched.rs
@@ -2,7 +2,6 @@
 // [OPT] compile-flags: -C opt-level=3 -C no-prepopulate-passes
 // [DBG] compile-flags: -C opt-level=0 -C no-prepopulate-passes
 // only-64bit (so I don't need to worry about usize)
-// min-llvm-version: 15.0 # this test assumes `ptr`s
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/intrinsics/transmute-x64.rs b/tests/codegen/intrinsics/transmute-x64.rs
index 168838ef497..19020f6280a 100644
--- a/tests/codegen/intrinsics/transmute-x64.rs
+++ b/tests/codegen/intrinsics/transmute-x64.rs
@@ -1,6 +1,5 @@
 // compile-flags: -O -C no-prepopulate-passes
 // only-x86_64 (it's using arch-specific types)
-// min-llvm-version: 15.0 # this test assumes `ptr`s
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen/intrinsics/transmute.rs
index f8c20960660..e64af33ab6c 100644
--- a/tests/codegen/intrinsics/transmute.rs
+++ b/tests/codegen/intrinsics/transmute.rs
@@ -1,6 +1,5 @@
 // compile-flags: -O -C no-prepopulate-passes
 // only-64bit (so I don't need to worry about usize)
-// min-llvm-version: 15.0 # this test assumes `ptr`s
 
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
diff --git a/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
index 6e0eacfe400..f345c96e6f7 100644
--- a/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
+++ b/tests/codegen/issues/issue-105386-ub-in-debuginfo.rs
@@ -1,6 +1,5 @@
 // compile-flags: --crate-type=lib -O -Cdebuginfo=2 -Cno-prepopulate-passes -Zmir-enable-passes=-ScalarReplacementOfAggregates
 // MIR SROA will decompose the closure
-// min-llvm-version: 15.0 # this test uses opaque pointer notation
 #![feature(stmt_expr_attributes)]
 
 pub struct S([usize; 8]);
@@ -16,8 +15,8 @@ pub fn outer_function(x: S, y: S) -> usize {
 // Check that we do not attempt to load from the spilled arg before it is assigned to
 // when generating debuginfo.
 // CHECK-LABEL: @outer_function
-// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:10:23: 10:25]"
-// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:10:23: 10:25]", ptr [[spill]]
+// CHECK: [[spill:%.*]] = alloca %"[closure@{{.*.rs}}:9:23: 9:25]"
+// CHECK-NOT: [[ptr_tmp:%.*]] = getelementptr inbounds %"[closure@{{.*.rs}}:9:23: 9:25]", ptr [[spill]]
 // CHECK-NOT: [[load:%.*]] = load ptr, ptr
 // CHECK: call void @llvm.lifetime.start{{.*}}({{.*}}, ptr [[spill]])
 // CHECK: [[inner:%.*]] = getelementptr inbounds %"{{.*}}", ptr [[spill]]
diff --git a/tests/codegen/issues/issue-37945.rs b/tests/codegen/issues/issue-37945.rs
index 4f386d335c7..329769940f9 100644
--- a/tests/codegen/issues/issue-37945.rs
+++ b/tests/codegen/issues/issue-37945.rs
@@ -12,11 +12,11 @@ use std::slice::Iter;
 pub fn is_empty_1(xs: Iter<f32>) -> bool {
 // CHECK-LABEL: @is_empty_1(
 // CHECK-NEXT:  start:
-// CHECK-NEXT:    [[A:%.*]] = icmp ne {{i32\*|ptr}} {{%xs.0|%xs.1}}, null
+// CHECK-NEXT:    [[A:%.*]] = icmp ne ptr {{%xs.0|%xs.1}}, null
 // CHECK-NEXT:    tail call void @llvm.assume(i1 [[A]])
 // The order between %xs.0 and %xs.1 on the next line doesn't matter
 // and different LLVM versions produce different order.
-// CHECK-NEXT:    [[B:%.*]] = icmp eq {{i32\*|ptr}} {{%xs.0, %xs.1|%xs.1, %xs.0}}
+// CHECK-NEXT:    [[B:%.*]] = icmp eq ptr {{%xs.0, %xs.1|%xs.1, %xs.0}}
 // CHECK-NEXT:    ret i1 [[B:%.*]]
     {xs}.next().is_none()
 }
@@ -25,11 +25,11 @@ pub fn is_empty_1(xs: Iter<f32>) -> bool {
 pub fn is_empty_2(xs: Iter<f32>) -> bool {
 // CHECK-LABEL: @is_empty_2
 // CHECK-NEXT:  start:
-// CHECK-NEXT:    [[C:%.*]] = icmp ne {{i32\*|ptr}} {{%xs.0|%xs.1}}, null
+// CHECK-NEXT:    [[C:%.*]] = icmp ne ptr {{%xs.0|%xs.1}}, null
 // CHECK-NEXT:    tail call void @llvm.assume(i1 [[C]])
 // The order between %xs.0 and %xs.1 on the next line doesn't matter
 // and different LLVM versions produce different order.
-// CHECK-NEXT:    [[D:%.*]] = icmp eq {{i32\*|ptr}} {{%xs.0, %xs.1|%xs.1, %xs.0}}
+// CHECK-NEXT:    [[D:%.*]] = icmp eq ptr {{%xs.0, %xs.1|%xs.1, %xs.0}}
 // CHECK-NEXT:    ret i1 [[D:%.*]]
     xs.map(|&x| x).next().is_none()
 }
diff --git a/tests/codegen/issues/issue-56267-2.rs b/tests/codegen/issues/issue-56267-2.rs
index 4dc9ebfebbc..1715e9f05ab 100644
--- a/tests/codegen/issues/issue-56267-2.rs
+++ b/tests/codegen/issues/issue-56267-2.rs
@@ -11,7 +11,7 @@ pub struct Foo<T> {
 // The load from bar.1 should have alignment 4. Not checking
 // other loads here, as the alignment will be platform-dependent.
 
-// CHECK: %{{.+}} = load i32, {{i32\*|ptr}} %{{.+}}, align 4
+// CHECK: %{{.+}} = load i32, ptr %{{.+}}, align 4
 #[no_mangle]
 pub fn test(x: Foo<(i32, i32)>) -> (i32, i32) {
     x.bar
diff --git a/tests/codegen/issues/issue-56267.rs b/tests/codegen/issues/issue-56267.rs
index 7bdd2577998..90aa9f7ae89 100644
--- a/tests/codegen/issues/issue-56267.rs
+++ b/tests/codegen/issues/issue-56267.rs
@@ -11,7 +11,7 @@ pub struct Foo<T> {
 // The store writing to bar.1 should have alignment 4. Not checking
 // other stores here, as the alignment will be platform-dependent.
 
-// CHECK: store i32 [[TMP1:%.+]], {{i32\*|ptr}} [[TMP2:%.+]], align 4
+// CHECK: store i32 [[TMP1:%.+]], ptr [[TMP2:%.+]], align 4
 #[no_mangle]
 pub fn test(x: (i32, i32)) -> Foo<(i32, i32)> {
     Foo { foo: 0, bar: x }
diff --git a/tests/codegen/issues/issue-56927.rs b/tests/codegen/issues/issue-56927.rs
index 044d721814b..1b09ce565b3 100644
--- a/tests/codegen/issues/issue-56927.rs
+++ b/tests/codegen/issues/issue-56927.rs
@@ -8,10 +8,10 @@ pub struct S {
 }
 
 // CHECK-LABEL: @test1
-// CHECK: store i32 0, {{i32\*|ptr}} %{{.+}}, align 16
-// CHECK: store i32 1, {{i32\*|ptr}} %{{.+}}, align 4
-// CHECK: store i32 2, {{i32\*|ptr}} %{{.+}}, align 8
-// CHECK: store i32 3, {{i32\*|ptr}} %{{.+}}, align 4
+// CHECK: store i32 0, ptr %{{.+}}, align 16
+// CHECK: store i32 1, ptr %{{.+}}, align 4
+// CHECK: store i32 2, ptr %{{.+}}, align 8
+// CHECK: store i32 3, ptr %{{.+}}, align 4
 #[no_mangle]
 pub fn test1(s: &mut S) {
     s.arr[0] = 0;
@@ -21,7 +21,7 @@ pub fn test1(s: &mut S) {
 }
 
 // CHECK-LABEL: @test2
-// CHECK: store i32 4, {{i32\*|ptr}} %{{.+}}, align 4
+// CHECK: store i32 4, ptr %{{.+}}, align 4
 #[allow(unconditional_panic)]
 #[no_mangle]
 pub fn test2(s: &mut S) {
@@ -29,14 +29,14 @@ pub fn test2(s: &mut S) {
 }
 
 // CHECK-LABEL: @test3
-// CHECK: store i32 5, {{i32\*|ptr}} %{{.+}}, align 4
+// CHECK: store i32 5, ptr %{{.+}}, align 4
 #[no_mangle]
 pub fn test3(s: &mut S, i: usize) {
     s.arr[i] = 5;
 }
 
 // CHECK-LABEL: @test4
-// CHECK: store i32 6, {{i32\*|ptr}} %{{.+}}, align 4
+// CHECK: store i32 6, ptr %{{.+}}, align 4
 #[no_mangle]
 pub fn test4(s: &mut S) {
     s.arr = [6; 4];
diff --git a/tests/codegen/issues/issue-58881.rs b/tests/codegen/issues/issue-58881.rs
index 00f8953d949..a1d0e8eb7e0 100644
--- a/tests/codegen/issues/issue-58881.rs
+++ b/tests/codegen/issues/issue-58881.rs
@@ -16,6 +16,6 @@ struct Bar(u64, u64, u64);
 
 // Ensure that emit arguments of the correct type.
 pub unsafe fn test_call_variadic() {
-    // CHECK: call void (i32, ...) @variadic_fn(i32 0, i8 {{.*}}, {{%Bar\*|ptr}} {{.*}})
+    // CHECK: call void (i32, ...) @variadic_fn(i32 0, i8 {{.*}}, ptr {{.*}})
     variadic_fn(0, Foo(0), Bar(0, 0, 0))
 }
diff --git a/tests/codegen/issues/issue-85872-multiple-reverse.rs b/tests/codegen/issues/issue-85872-multiple-reverse.rs
index 591a1aca747..a4723a0e946 100644
--- a/tests/codegen/issues/issue-85872-multiple-reverse.rs
+++ b/tests/codegen/issues/issue-85872-multiple-reverse.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 15.0.0
 // compile-flags: -O
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-86106.rs b/tests/codegen/issues/issue-86106.rs
index be5034dcfbd..15aef344ac0 100644
--- a/tests/codegen/issues/issue-86106.rs
+++ b/tests/codegen/issues/issue-86106.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 15.0
 // only-64bit llvm appears to use stores instead of memset on 32bit
 // compile-flags: -C opt-level=3 -Z merge-functions=disabled
 
diff --git a/tests/codegen/issues/issue-96274.rs b/tests/codegen/issues/issue-96274.rs
index 28bfcce0d7b..a44789ce350 100644
--- a/tests/codegen/issues/issue-96274.rs
+++ b/tests/codegen/issues/issue-96274.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 15.0
 // compile-flags: -O
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/issues/issue-96497-slice-size-nowrap.rs b/tests/codegen/issues/issue-96497-slice-size-nowrap.rs
index 0413ed6b26f..3ea6a5405e5 100644
--- a/tests/codegen/issues/issue-96497-slice-size-nowrap.rs
+++ b/tests/codegen/issues/issue-96497-slice-size-nowrap.rs
@@ -3,7 +3,6 @@
 // in some situations, see https://github.com/rust-lang/rust/issues/96497#issuecomment-1112865218
 
 // compile-flags: -O
-// min-llvm-version: 15.0
 
 #![crate_type="lib"]
 
diff --git a/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs b/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs
index 7da29cd7952..b87e43c13b6 100644
--- a/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs
+++ b/tests/codegen/issues/issue-98294-get-mut-copy-from-slice-opt.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 15.0.0
 // ignore-debug: The debug assertions get in the way
 // compile-flags: -O
 
diff --git a/tests/codegen/lifetime_start_end.rs b/tests/codegen/lifetime_start_end.rs
index 471a0b8cedd..16175dc18c2 100644
--- a/tests/codegen/lifetime_start_end.rs
+++ b/tests/codegen/lifetime_start_end.rs
@@ -8,7 +8,7 @@ pub fn test() {
     let a = 0u8;
     &a; // keep variable in an alloca
 
-// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, {{i8\*|ptr}} %a)
+// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, ptr %a)
 
     {
         let b = &Some(a);
@@ -26,9 +26,9 @@ pub fn test() {
     let c = 1u8;
     &c; // keep variable in an alloca
 
-// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, {{i8\*|ptr}} %c)
+// CHECK: call void @llvm.lifetime.start{{.*}}(i{{[0-9 ]+}}, ptr %c)
 
-// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, {{i8\*|ptr}} %c)
+// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, ptr %c)
 
-// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, {{i8\*|ptr}} %a)
+// CHECK: call void @llvm.lifetime.end{{.*}}(i{{[0-9 ]+}}, ptr %a)
 }
diff --git a/tests/codegen/loads.rs b/tests/codegen/loads.rs
index f29a26596bf..4a09a1dc033 100644
--- a/tests/codegen/loads.rs
+++ b/tests/codegen/loads.rs
@@ -28,22 +28,22 @@ pub fn ptr_alignment_helper(x: &&()) {}
 // CHECK-LABEL: @load_ref
 #[no_mangle]
 pub fn load_ref<'a>(x: &&'a i32) -> &'a i32 {
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META:[0-9]+]], !noundef !{{[0-9]+}}
+    // CHECK: load ptr, ptr %x, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META:[0-9]+]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_ref_higher_alignment
 #[no_mangle]
 pub fn load_ref_higher_alignment<'a>(x: &&'a Align16) -> &'a Align16 {
-    // CHECK: load {{%Align16\*|i128\*|ptr}}, {{%Align16\*\*|i128\*\*|ptr}} %x, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_16_META:[0-9]+]], !noundef !{{[0-9]+}}
+    // CHECK: load ptr, ptr %x, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_16_META:[0-9]+]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_scalar_pair
 #[no_mangle]
 pub fn load_scalar_pair<'a>(x: &(&'a i32, &'a Align16)) -> (&'a i32, &'a Align16) {
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %{{.+}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META]], !noundef !{{[0-9]+}}
-    // CHECK: load {{i64\*|ptr}}, {{i64\*\*|ptr}} %{{.+}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_16_META]], !noundef !{{[0-9]+}}
+    // CHECK: load ptr, ptr %{{.+}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META]], !noundef !{{[0-9]+}}
+    // CHECK: load ptr, ptr %{{.+}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_16_META]], !noundef !{{[0-9]+}}
     *x
 }
 
@@ -51,70 +51,70 @@ pub fn load_scalar_pair<'a>(x: &(&'a i32, &'a Align16)) -> (&'a i32, &'a Align16
 #[no_mangle]
 pub fn load_raw_pointer<'a>(x: &*const i32) -> *const i32 {
     // loaded raw pointer should not have !nonnull or !align metadata
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x, align [[PTR_ALIGNMENT]], !noundef ![[NOUNDEF:[0-9]+]]{{$}}
+    // CHECK: load ptr, ptr %x, align [[PTR_ALIGNMENT]], !noundef ![[NOUNDEF:[0-9]+]]{{$}}
     *x
 }
 
 // CHECK-LABEL: @load_box
 #[no_mangle]
 pub fn load_box<'a>(x: Box<Box<i32>>) -> Box<i32> {
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %{{.*}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META]], !noundef !{{[0-9]+}}
+    // CHECK: load ptr, ptr %{{.*}}, align [[PTR_ALIGNMENT]], !nonnull !{{[0-9]+}}, !align ![[ALIGN_4_META]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_bool
 #[no_mangle]
 pub fn load_bool(x: &bool) -> bool {
-    // CHECK: load i8, {{i8\*|ptr}} %x, align 1, !range ![[BOOL_RANGE:[0-9]+]], !noundef !{{[0-9]+}}
+    // CHECK: load i8, ptr %x, align 1, !range ![[BOOL_RANGE:[0-9]+]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_maybeuninit_bool
 #[no_mangle]
 pub fn load_maybeuninit_bool(x: &MaybeUninit<bool>) -> MaybeUninit<bool> {
-    // CHECK: load i8, {{i8\*|ptr}} %x, align 1{{$}}
+    // CHECK: load i8, ptr %x, align 1{{$}}
     *x
 }
 
 // CHECK-LABEL: @load_enum_bool
 #[no_mangle]
 pub fn load_enum_bool(x: &MyBool) -> MyBool {
-    // CHECK: load i8, {{i8\*|ptr}} %x, align 1, !range ![[BOOL_RANGE]], !noundef !{{[0-9]+}}
+    // CHECK: load i8, ptr %x, align 1, !range ![[BOOL_RANGE]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_maybeuninit_enum_bool
 #[no_mangle]
 pub fn load_maybeuninit_enum_bool(x: &MaybeUninit<MyBool>) -> MaybeUninit<MyBool> {
-    // CHECK: load i8, {{i8\*|ptr}} %x, align 1{{$}}
+    // CHECK: load i8, ptr %x, align 1{{$}}
     *x
 }
 
 // CHECK-LABEL: @load_int
 #[no_mangle]
 pub fn load_int(x: &u16) -> u16 {
-    // CHECK: load i16, {{i16\*|ptr}} %x, align 2, !noundef ![[NOUNDEF]]{{$}}
+    // CHECK: load i16, ptr %x, align 2, !noundef ![[NOUNDEF]]{{$}}
     *x
 }
 
 // CHECK-LABEL: @load_nonzero_int
 #[no_mangle]
 pub fn load_nonzero_int(x: &NonZeroU16) -> NonZeroU16 {
-    // CHECK: load i16, {{i16\*|ptr}} %x, align 2, !range ![[NONZEROU16_RANGE:[0-9]+]], !noundef !{{[0-9]+}}
+    // CHECK: load i16, ptr %x, align 2, !range ![[NONZEROU16_RANGE:[0-9]+]], !noundef !{{[0-9]+}}
     *x
 }
 
 // CHECK-LABEL: @load_option_nonzero_int
 #[no_mangle]
 pub fn load_option_nonzero_int(x: &Option<NonZeroU16>) -> Option<NonZeroU16> {
-    // CHECK: load i16, {{i16\*|ptr}} %x, align 2, !noundef ![[NOUNDEF]]{{$}}
+    // CHECK: load i16, ptr %x, align 2, !noundef ![[NOUNDEF]]{{$}}
     *x
 }
 
 // CHECK-LABEL: @borrow
 #[no_mangle]
 pub fn borrow(x: &i32) -> &i32 {
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x{{.*}}, !nonnull
+    // CHECK: load ptr, ptr %x{{.*}}, !nonnull
     &x; // keep variable in an alloca
     x
 }
@@ -122,7 +122,7 @@ pub fn borrow(x: &i32) -> &i32 {
 // CHECK-LABEL: @_box
 #[no_mangle]
 pub fn _box(x: Box<i32>) -> i32 {
-    // CHECK: load {{i32\*|ptr}}, {{i32\*\*|ptr}} %x{{.*}}, align [[PTR_ALIGNMENT]]
+    // CHECK: load ptr, ptr %x{{.*}}, align [[PTR_ALIGNMENT]]
     *x
 }
 
@@ -131,7 +131,7 @@ pub fn _box(x: Box<i32>) -> i32 {
 // dependent alignment
 #[no_mangle]
 pub fn small_array_alignment(x: [i8; 4]) -> [i8; 4] {
-    // CHECK: [[VAR:%[0-9]+]] = load i32, {{i32\*|ptr}} %{{.*}}, align 1
+    // CHECK: [[VAR:%[0-9]+]] = load i32, ptr %{{.*}}, align 1
     // CHECK: ret i32 [[VAR]]
     x
 }
@@ -141,7 +141,7 @@ pub fn small_array_alignment(x: [i8; 4]) -> [i8; 4] {
 // dependent alignment
 #[no_mangle]
 pub fn small_struct_alignment(x: Bytes) -> Bytes {
-    // CHECK: [[VAR:%[0-9]+]] = load i32, {{i32\*|ptr}} %{{.*}}, align 1
+    // CHECK: [[VAR:%[0-9]+]] = load i32, ptr %{{.*}}, align 1
     // CHECK: ret i32 [[VAR]]
     x
 }
diff --git a/tests/codegen/match-optimized.rs b/tests/codegen/match-optimized.rs
index 59e6eeb7c5d..e32a5e54504 100644
--- a/tests/codegen/match-optimized.rs
+++ b/tests/codegen/match-optimized.rs
@@ -20,13 +20,13 @@ pub fn exhaustive_match(e: E) -> u8 {
 // CHECK-NEXT: unreachable
 //
 // CHECK: [[A]]:
-// CHECK-NEXT: store i8 0, {{i8\*|ptr}} %_0, align 1
+// CHECK-NEXT: store i8 0, ptr %_0, align 1
 // CHECK-NEXT: br label %[[EXIT:[a-zA-Z0-9_]+]]
 // CHECK: [[B]]:
-// CHECK-NEXT: store i8 1, {{i8\*|ptr}} %_0, align 1
+// CHECK-NEXT: store i8 1, ptr %_0, align 1
 // CHECK-NEXT: br label %[[EXIT]]
 // CHECK: [[C]]:
-// CHECK-NEXT: store i8 2, {{i8\*|ptr}} %_0, align 1
+// CHECK-NEXT: store i8 2, ptr %_0, align 1
 // CHECK-NEXT: br label %[[EXIT]]
     match e {
         E::A => 0,
diff --git a/tests/codegen/mem-replace-big-type.rs b/tests/codegen/mem-replace-big-type.rs
index 55c2741faaf..fc3e9d22bdf 100644
--- a/tests/codegen/mem-replace-big-type.rs
+++ b/tests/codegen/mem-replace-big-type.rs
@@ -25,9 +25,9 @@ pub fn replace_big(dst: &mut Big, src: Big) -> Big {
 // For a large type, we expect exactly three `memcpy`s
 // CHECK-LABEL: define internal void @{{.+}}mem{{.+}}replace{{.+}}sret(%Big)
 // CHECK-NOT: call void @llvm.memcpy
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %result, {{i8\*|ptr}} align 8 %dest, i{{.*}} 56, i1 false)
+// CHECK: call void @llvm.memcpy.{{.+}}(ptr align 8 %result, ptr align 8 %dest, i{{.*}} 56, i1 false)
 // CHECK-NOT: call void @llvm.memcpy
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 8 %dest, {{i8\*|ptr}} align 8 %src, i{{.*}} 56, i1 false)
+// CHECK: call void @llvm.memcpy.{{.+}}(ptr align 8 %dest, ptr align 8 %src, i{{.*}} 56, i1 false)
 // CHECK-NOT: call void @llvm.memcpy
 
 // CHECK-NOT: call void @llvm.memcpy
diff --git a/tests/codegen/mem-replace-simple-type.rs b/tests/codegen/mem-replace-simple-type.rs
index 5c4acf813ea..174ac608e01 100644
--- a/tests/codegen/mem-replace-simple-type.rs
+++ b/tests/codegen/mem-replace-simple-type.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O -C no-prepopulate-passes
-// min-llvm-version: 15.0 (for opaque pointers)
 // only-x86_64 (to not worry about usize differing)
 // ignore-debug (the debug assertions get in the way)
 
diff --git a/tests/codegen/move-operands.rs b/tests/codegen/move-operands.rs
index df4fbe29ffd..cd87e6d813c 100644
--- a/tests/codegen/move-operands.rs
+++ b/tests/codegen/move-operands.rs
@@ -7,7 +7,7 @@ type T = [u8; 256];
 
 #[no_mangle]
 pub fn f(a: T, b: fn(_: T, _: T)) {
-    // CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
-    // CHECK-NOT: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
+    // CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, {{.*}} 256, i1 false)
+    // CHECK-NOT: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, {{.*}} 256, i1 false)
     b(a, a)
 }
diff --git a/tests/codegen/option-nonzero-eq.rs b/tests/codegen/option-nonzero-eq.rs
index a394695f3bd..ce5b6328af6 100644
--- a/tests/codegen/option-nonzero-eq.rs
+++ b/tests/codegen/option-nonzero-eq.rs
@@ -32,7 +32,7 @@ pub fn non_zero_signed_eq(l: Option<NonZeroI64>, r: Option<NonZeroI64>) -> bool
 #[no_mangle]
 pub fn non_null_eq(l: Option<NonNull<u8>>, r: Option<NonNull<u8>>) -> bool {
     // CHECK: start:
-    // CHECK-NEXT: icmp eq {{(i8\*|ptr)}}
+    // CHECK-NEXT: icmp eq ptr
     // CHECK-NEXT: ret i1
     l == r
 }
diff --git a/tests/codegen/packed.rs b/tests/codegen/packed.rs
index fd63b4f0acd..96cd9a42e7d 100644
--- a/tests/codegen/packed.rs
+++ b/tests/codegen/packed.rs
@@ -18,8 +18,8 @@ pub struct Packed2 {
 // CHECK-LABEL: @write_pkd1
 #[no_mangle]
 pub fn write_pkd1(pkd: &mut Packed1) -> u32 {
-// CHECK: %{{.*}} = load i32, {{i32\*|ptr}} %{{.*}}, align 1
-// CHECK: store i32 42, {{i32\*|ptr}} %{{.*}}, align 1
+// CHECK: %{{.*}} = load i32, ptr %{{.*}}, align 1
+// CHECK: store i32 42, ptr %{{.*}}, align 1
     let result = pkd.data;
     pkd.data = 42;
     result
@@ -28,8 +28,8 @@ pub fn write_pkd1(pkd: &mut Packed1) -> u32 {
 // CHECK-LABEL: @write_pkd2
 #[no_mangle]
 pub fn write_pkd2(pkd: &mut Packed2) -> u32 {
-// CHECK: %{{.*}} = load i32, {{i32\*|ptr}} %{{.*}}, align 2
-// CHECK: store i32 42, {{i32\*|ptr}} %{{.*}}, align 2
+// CHECK: %{{.*}} = load i32, ptr %{{.*}}, align 2
+// CHECK: store i32 42, ptr %{{.*}}, align 2
     let result = pkd.data;
     pkd.data = 42;
     result
@@ -52,8 +52,8 @@ pub struct BigPacked2 {
 #[no_mangle]
 pub fn call_pkd1(f: fn() -> Array) -> BigPacked1 {
 // CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
-// CHECK: call void %{{.*}}({{%Array\*|ptr}} noalias nocapture noundef sret{{.*}} dereferenceable(32) [[ALLOCA]])
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
+// CHECK: call void %{{.*}}(ptr noalias nocapture noundef sret{{.*}} dereferenceable(32) [[ALLOCA]])
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
     // check that calls whose destination is a field of a packed struct
     // go through an alloca rather than calling the function with an
     // unaligned destination.
@@ -64,8 +64,8 @@ pub fn call_pkd1(f: fn() -> Array) -> BigPacked1 {
 #[no_mangle]
 pub fn call_pkd2(f: fn() -> Array) -> BigPacked2 {
 // CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
-// CHECK: call void %{{.*}}({{%Array\*|ptr}} noalias nocapture noundef sret{{.*}} dereferenceable(32) [[ALLOCA]])
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 2 %{{.*}}, {{i8\*|ptr}} align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
+// CHECK: call void %{{.*}}(ptr noalias nocapture noundef sret{{.*}} dereferenceable(32) [[ALLOCA]])
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 2 %{{.*}}, ptr align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
     // check that calls whose destination is a field of a packed struct
     // go through an alloca rather than calling the function with an
     // unaligned destination.
@@ -73,9 +73,9 @@ pub fn call_pkd2(f: fn() -> Array) -> BigPacked2 {
 }
 
 // CHECK-LABEL: @write_packed_array1
-// CHECK: store i32 0, {{i32\*|ptr}} %{{.+}}, align 1
-// CHECK: store i32 1, {{i32\*|ptr}} %{{.+}}, align 1
-// CHECK: store i32 2, {{i32\*|ptr}} %{{.+}}, align 1
+// CHECK: store i32 0, ptr %{{.+}}, align 1
+// CHECK: store i32 1, ptr %{{.+}}, align 1
+// CHECK: store i32 2, ptr %{{.+}}, align 1
 #[no_mangle]
 pub fn write_packed_array1(p: &mut BigPacked1) {
     p.data.0[0] = 0;
@@ -84,9 +84,9 @@ pub fn write_packed_array1(p: &mut BigPacked1) {
 }
 
 // CHECK-LABEL: @write_packed_array2
-// CHECK: store i32 0, {{i32\*|ptr}} %{{.+}}, align 2
-// CHECK: store i32 1, {{i32\*|ptr}} %{{.+}}, align 2
-// CHECK: store i32 2, {{i32\*|ptr}} %{{.+}}, align 2
+// CHECK: store i32 0, ptr %{{.+}}, align 2
+// CHECK: store i32 1, ptr %{{.+}}, align 2
+// CHECK: store i32 2, ptr %{{.+}}, align 2
 #[no_mangle]
 pub fn write_packed_array2(p: &mut BigPacked2) {
     p.data.0[0] = 0;
@@ -95,14 +95,14 @@ pub fn write_packed_array2(p: &mut BigPacked2) {
 }
 
 // CHECK-LABEL: @repeat_packed_array1
-// CHECK: store i32 42, {{i32\*|ptr}} %{{.+}}, align 1
+// CHECK: store i32 42, ptr %{{.+}}, align 1
 #[no_mangle]
 pub fn repeat_packed_array1(p: &mut BigPacked1) {
     p.data.0 = [42; 8];
 }
 
 // CHECK-LABEL: @repeat_packed_array2
-// CHECK: store i32 42, {{i32\*|ptr}} %{{.+}}, align 2
+// CHECK: store i32 42, ptr %{{.+}}, align 2
 #[no_mangle]
 pub fn repeat_packed_array2(p: &mut BigPacked2) {
     p.data.0 = [42; 8];
@@ -119,14 +119,14 @@ pub struct Packed2Pair(u8, u32);
 // CHECK-LABEL: @pkd1_pair
 #[no_mangle]
 pub fn pkd1_pair(pair1: &mut Packed1Pair, pair2: &mut Packed1Pair) {
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, i{{[0-9]+}} 5, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, i{{[0-9]+}} 5, i1 false)
     *pair2 = *pair1;
 }
 
 // CHECK-LABEL: @pkd2_pair
 #[no_mangle]
 pub fn pkd2_pair(pair1: &mut Packed2Pair, pair2: &mut Packed2Pair) {
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 2 %{{.*}}, {{i8\*|ptr}} align 2 %{{.*}}, i{{[0-9]+}} 6, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 2 %{{.*}}, ptr align 2 %{{.*}}, i{{[0-9]+}} 6, i1 false)
     *pair2 = *pair1;
 }
 
@@ -141,13 +141,13 @@ pub struct Packed2NestedPair((u32, u32));
 // CHECK-LABEL: @pkd1_nested_pair
 #[no_mangle]
 pub fn pkd1_nested_pair(pair1: &mut Packed1NestedPair, pair2: &mut Packed1NestedPair) {
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, i{{[0-9]+}} 8, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, i{{[0-9]+}} 8, i1 false)
     *pair2 = *pair1;
 }
 
 // CHECK-LABEL: @pkd2_nested_pair
 #[no_mangle]
 pub fn pkd2_nested_pair(pair1: &mut Packed2NestedPair, pair2: &mut Packed2NestedPair) {
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 2 %{{.*}}, {{i8\*|ptr}} align 2 %{{.*}}, i{{[0-9]+}} 8, i1 false)
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 2 %{{.*}}, ptr align 2 %{{.*}}, i{{[0-9]+}} 8, i1 false)
     *pair2 = *pair1;
 }
diff --git a/tests/codegen/personality_lifetimes.rs b/tests/codegen/personality_lifetimes.rs
index 9ff7a9b3e88..47243bece98 100644
--- a/tests/codegen/personality_lifetimes.rs
+++ b/tests/codegen/personality_lifetimes.rs
@@ -22,7 +22,7 @@ pub fn test() {
     let _s = S;
     // Check that the personality slot alloca gets a lifetime start in each cleanup block, not just
     // in the first one.
-    // CHECK: [[SLOT:%[0-9]+]] = alloca { {{i8\*|ptr}}, i32 }
+    // CHECK: [[SLOT:%[0-9]+]] = alloca { ptr, i32 }
     // CHECK-LABEL: cleanup:
     // CHECK: call void @llvm.lifetime.start.{{.*}}({{.*}})
     // CHECK-LABEL: cleanup1:
diff --git a/tests/codegen/refs.rs b/tests/codegen/refs.rs
index a5289766711..1c7746a3079 100644
--- a/tests/codegen/refs.rs
+++ b/tests/codegen/refs.rs
@@ -13,9 +13,9 @@ pub fn helper(_: usize) {
 pub fn ref_dst(s: &[u8]) {
     // We used to generate an extra alloca and memcpy to ref the dst, so check that we copy
     // directly to the alloca for "x"
-// CHECK: [[X0:%[0-9]+]] = getelementptr inbounds { {{\[0 x i8\]\*|ptr}}, [[USIZE]] }, {{.*}}  %x, i32 0, i32 0
-// CHECK: store {{\[0 x i8\]\*|ptr}} %s.0, {{.*}} [[X0]]
-// CHECK: [[X1:%[0-9]+]] = getelementptr inbounds { {{\[0 x i8\]\*|ptr}}, [[USIZE]] }, {{.*}} %x, i32 0, i32 1
+// CHECK: [[X0:%[0-9]+]] = getelementptr inbounds { ptr, [[USIZE]] }, {{.*}}  %x, i32 0, i32 0
+// CHECK: store ptr %s.0, {{.*}} [[X0]]
+// CHECK: [[X1:%[0-9]+]] = getelementptr inbounds { ptr, [[USIZE]] }, {{.*}} %x, i32 0, i32 1
 // CHECK: store [[USIZE]] %s.1, {{.*}} [[X1]]
 
     let x = &*s;
diff --git a/tests/codegen/repeat-trusted-len.rs b/tests/codegen/repeat-trusted-len.rs
index d06978f2435..bd6ff977e1f 100644
--- a/tests/codegen/repeat-trusted-len.rs
+++ b/tests/codegen/repeat-trusted-len.rs
@@ -8,13 +8,13 @@ use std::iter;
 // CHECK-LABEL: @repeat_take_collect
 #[no_mangle]
 pub fn repeat_take_collect() -> Vec<u8> {
-    // CHECK: call void @llvm.memset.{{.+}}({{i8\*|ptr}} {{.*}}align 1{{.*}} %{{.*}}, i8 42, i{{[0-9]+}} 100000, i1 false)
+    // CHECK: call void @llvm.memset.{{.+}}(ptr {{.*}}align 1{{.*}} %{{.*}}, i8 42, i{{[0-9]+}} 100000, i1 false)
     iter::repeat(42).take(100000).collect()
 }
 
 // CHECK-LABEL: @repeat_with_take_collect
 #[no_mangle]
 pub fn repeat_with_take_collect() -> Vec<u8> {
-    // CHECK: call void @llvm.memset.{{.+}}({{i8\*|ptr}} {{.*}}align 1{{.*}} %{{.*}}, i8 13, i{{[0-9]+}} 12345, i1 false)
+    // CHECK: call void @llvm.memset.{{.+}}(ptr {{.*}}align 1{{.*}} %{{.*}}, i8 13, i{{[0-9]+}} 12345, i1 false)
     iter::repeat_with(|| 13).take(12345).collect()
 }
diff --git a/tests/codegen/repr-transparent-aggregates-1.rs b/tests/codegen/repr-transparent-aggregates-1.rs
deleted file mode 100644
index ba3ba272efb..00000000000
--- a/tests/codegen/repr-transparent-aggregates-1.rs
+++ /dev/null
@@ -1,89 +0,0 @@
-// compile-flags: -O -C no-prepopulate-passes
-//
-
-// ignore-arm
-// ignore-aarch64
-// ignore-mips
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-riscv64 see codegen/riscv-abi
-// ignore-s390x
-// ignore-windows
-// ignore-loongarch64
-// ignore-wasm32-bare
-// See repr-transparent.rs
-
-#![feature(transparent_unions)]
-
-#![crate_type="lib"]
-
-
-#[derive(Clone, Copy)]
-#[repr(C)]
-pub struct BigS([u32; 16]);
-
-#[repr(transparent)]
-pub struct TsBigS(BigS);
-
-#[repr(transparent)]
-pub union TuBigS {
-    field: BigS,
-}
-
-#[repr(transparent)]
-pub enum TeBigS {
-    Variant(BigS),
-}
-
-// CHECK: define{{.*}}void @test_BigS({{%BigS\*|ptr}} [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], {{%BigS\*|ptr}} [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
-#[no_mangle]
-pub extern "C" fn test_BigS(_: BigS) -> BigS { loop {} }
-
-// CHECK: define{{.*}}void @test_TsBigS({{%TsBigS\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], {{%TsBigS\*|ptr}} [[BIGS_ARG_ATTRS1]] byval(%TsBigS) [[BIGS_ARG_ATTRS2:.*]])
-#[no_mangle]
-pub extern "C" fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
-
-// CHECK: define{{.*}}void @test_TuBigS({{%TuBigS\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], {{%TuBigS\*|ptr}} [[BIGS_ARG_ATTRS1]] byval(%TuBigS) [[BIGS_ARG_ATTRS2:.*]])
-#[no_mangle]
-pub extern "C" fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
-
-// CHECK: define{{.*}}void @test_TeBigS({{%"TeBigS::Variant"\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], {{%"TeBigS::Variant"\*|ptr}} [[BIGS_ARG_ATTRS1]] byval(%"TeBigS::Variant") [[BIGS_ARG_ATTRS2]])
-#[no_mangle]
-pub extern "C" fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
-
-
-#[derive(Clone, Copy)]
-#[repr(C)]
-pub union BigU {
-    foo: [u32; 16],
-}
-
-#[repr(transparent)]
-pub struct TsBigU(BigU);
-
-#[repr(transparent)]
-pub union TuBigU {
-    field: BigU,
-}
-
-#[repr(transparent)]
-pub enum TeBigU {
-    Variant(BigU),
-}
-
-// CHECK: define{{.*}}void @test_BigU({{%BigU\*|ptr}} [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], {{%BigU\*|ptr}} [[BIGU_ARG_ATTRS1:.*]] byval(%BigU) [[BIGU_ARG_ATTRS2:.*]])
-#[no_mangle]
-pub extern "C" fn test_BigU(_: BigU) -> BigU { loop {} }
-
-// CHECK: define{{.*}}void @test_TsBigU({{%TsBigU\*|ptr}} [[BIGU_RET_ATTRS1:.*]] sret(%TsBigU) [[BIGU_RET_ATTRS2:.*]], {{%TsBigU\*|ptr}} [[BIGU_ARG_ATTRS1]] byval(%TsBigU) [[BIGU_ARG_ATTRS2]])
-#[no_mangle]
-pub extern "C" fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
-
-// CHECK: define{{.*}}void @test_TuBigU({{%TuBigU\*|ptr}} [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2:.*]], {{%TuBigU\*|ptr}} [[BIGU_ARG_ATTRS1]] byval(%TuBigU) [[BIGU_ARG_ATTRS2]])
-#[no_mangle]
-pub extern "C" fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
-
-// CHECK: define{{.*}}void @test_TeBigU({{%"TeBigU::Variant"\*|ptr}} [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2:.*]], {{%"TeBigU::Variant"\*|ptr}} [[BIGU_ARG_ATTRS1]] byval(%"TeBigU::Variant") [[BIGU_ARG_ATTRS2]])
-#[no_mangle]
-pub extern "C" fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
diff --git a/tests/codegen/repr-transparent-aggregates-2.rs b/tests/codegen/repr-transparent-aggregates-2.rs
deleted file mode 100644
index a7bde2d05c3..00000000000
--- a/tests/codegen/repr-transparent-aggregates-2.rs
+++ /dev/null
@@ -1,90 +0,0 @@
-// compile-flags: -C no-prepopulate-passes
-//
-
-// ignore-aarch64
-// ignore-emscripten
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-riscv64 see codegen/riscv-abi
-// ignore-s390x
-// ignore-sparc
-// ignore-sparc64
-// ignore-x86
-// ignore-x86_64
-// ignore-loongarch64
-// See repr-transparent.rs
-
-#![feature(transparent_unions)]
-
-#![crate_type="lib"]
-
-
-#[derive(Clone, Copy)]
-#[repr(C)]
-pub struct BigS([u32; 16]);
-
-#[repr(transparent)]
-pub struct TsBigS(BigS);
-
-#[repr(transparent)]
-pub union TuBigS {
-    field: BigS,
-}
-
-#[repr(transparent)]
-pub enum TeBigS {
-    Variant(BigS),
-}
-
-// CHECK: define void @test_BigS({{%BigS\*|ptr}} [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [16 x i32]
-#[no_mangle]
-pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
-
-// CHECK: define void @test_TsBigS({{%TsBigS\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
-
-// CHECK: define void @test_TuBigS({{%TuBigS\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
-
-// CHECK: define void @test_TeBigS({{%"TeBigS::Variant"\*|ptr}} [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
-
-
-#[derive(Clone, Copy)]
-#[repr(C)]
-pub union BigU {
-    foo: [u32; 16],
-}
-
-#[repr(transparent)]
-pub struct TsBigU(BigU);
-
-#[repr(transparent)]
-pub union TuBigU {
-    field: BigU,
-}
-
-#[repr(transparent)]
-pub enum TeBigU {
-    Variant(BigU),
-}
-
-// CHECK: define void @test_BigU({{%BigU\*|ptr}} [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [16 x i32]
-#[no_mangle]
-pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
-
-// CHECK: define void @test_TsBigU({{%TsBigU\*|ptr}} [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
-
-// CHECK: define void @test_TuBigU({{%TuBigU\*|ptr}} [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
-
-// CHECK: define void @test_TeBigU({{%"TeBigU::Variant"\*|ptr}} [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [16 x i32]
-#[no_mangle]
-pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
diff --git a/tests/codegen/repr/transparent-imm-array.rs b/tests/codegen/repr/transparent-imm-array.rs
new file mode 100644
index 00000000000..6d712778509
--- /dev/null
+++ b/tests/codegen/repr/transparent-imm-array.rs
@@ -0,0 +1,86 @@
+// revisions: arm mips thumb wasm32
+// compile-flags: -C no-prepopulate-passes
+//
+//[arm] only-arm
+//[mips] only-mips
+//[thumb] only-thumb
+//[wasm32] only-wasm32
+// ignore-emscripten
+// See ./transparent.rs
+// Some platforms pass large aggregates using immediate arrays in LLVMIR
+// Other platforms pass large aggregates using struct pointer in LLVMIR
+// This covers the "immediate array" case.
+
+#![feature(transparent_unions)]
+
+#![crate_type="lib"]
+
+
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub struct BigS([u32; 16]);
+
+#[repr(transparent)]
+pub struct TsBigS(BigS);
+
+#[repr(transparent)]
+pub union TuBigS {
+    field: BigS,
+}
+
+#[repr(transparent)]
+pub enum TeBigS {
+    Variant(BigS),
+}
+
+// CHECK: define void @test_BigS(ptr [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [16 x i32]
+#[no_mangle]
+pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
+
+// CHECK: define void @test_TsBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
+
+// CHECK: define void @test_TuBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
+
+// CHECK: define void @test_TeBigS(ptr [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
+
+
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub union BigU {
+    foo: [u32; 16],
+}
+
+#[repr(transparent)]
+pub struct TsBigU(BigU);
+
+#[repr(transparent)]
+pub union TuBigU {
+    field: BigU,
+}
+
+#[repr(transparent)]
+pub enum TeBigU {
+    Variant(BigU),
+}
+
+// CHECK: define void @test_BigU(ptr [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [16 x i32]
+#[no_mangle]
+pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
+
+// CHECK: define void @test_TsBigU(ptr [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
+
+// CHECK: define void @test_TuBigU(ptr [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
+
+// CHECK: define void @test_TeBigU(ptr [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [16 x i32]
+#[no_mangle]
+pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
diff --git a/tests/codegen/repr-transparent-aggregates-3.rs b/tests/codegen/repr/transparent-mips64.rs
index 0db17e6b13a..245daf13e28 100644
--- a/tests/codegen/repr-transparent-aggregates-3.rs
+++ b/tests/codegen/repr/transparent-mips64.rs
@@ -2,7 +2,7 @@
 //
 
 // only-mips64
-// See repr-transparent.rs
+// See ./transparent.rs
 
 #![feature(transparent_unions)]
 
diff --git a/tests/codegen/repr/transparent-struct-ptr.rs b/tests/codegen/repr/transparent-struct-ptr.rs
new file mode 100644
index 00000000000..d2120f7ec14
--- /dev/null
+++ b/tests/codegen/repr/transparent-struct-ptr.rs
@@ -0,0 +1,87 @@
+// revisions: x32 x64 sparc sparc64
+// compile-flags: -O -C no-prepopulate-passes
+//
+//[x32] only-x86
+//[x64] only-x86_64
+//[sparc] only-sparc
+//[sparc64] only-sparc64
+// ignore-windows
+// See ./transparent.rs
+// Some platforms pass large aggregates using immediate arrays in LLVMIR
+// Other platforms pass large aggregates using struct pointer in LLVMIR
+// This covers the "struct pointer" case.
+
+
+#![feature(transparent_unions)]
+
+#![crate_type="lib"]
+
+
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub struct BigS([u32; 16]);
+
+#[repr(transparent)]
+pub struct TsBigS(BigS);
+
+#[repr(transparent)]
+pub union TuBigS {
+    field: BigS,
+}
+
+#[repr(transparent)]
+pub enum TeBigS {
+    Variant(BigS),
+}
+
+// CHECK: define{{.*}}void @test_BigS(ptr [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], ptr [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
+#[no_mangle]
+pub extern "C" fn test_BigS(_: BigS) -> BigS { loop {} }
+
+// CHECK: define{{.*}}void @test_TsBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], ptr [[BIGS_ARG_ATTRS1]] byval(%TsBigS) [[BIGS_ARG_ATTRS2:.*]])
+#[no_mangle]
+pub extern "C" fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
+
+// CHECK: define{{.*}}void @test_TuBigS(ptr [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], ptr [[BIGS_ARG_ATTRS1]] byval(%TuBigS) [[BIGS_ARG_ATTRS2:.*]])
+#[no_mangle]
+pub extern "C" fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
+
+// CHECK: define{{.*}}void @test_TeBigS(ptr [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], ptr [[BIGS_ARG_ATTRS1]] byval(%"TeBigS::Variant") [[BIGS_ARG_ATTRS2]])
+#[no_mangle]
+pub extern "C" fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
+
+
+#[derive(Clone, Copy)]
+#[repr(C)]
+pub union BigU {
+    foo: [u32; 16],
+}
+
+#[repr(transparent)]
+pub struct TsBigU(BigU);
+
+#[repr(transparent)]
+pub union TuBigU {
+    field: BigU,
+}
+
+#[repr(transparent)]
+pub enum TeBigU {
+    Variant(BigU),
+}
+
+// CHECK: define{{.*}}void @test_BigU(ptr [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], ptr [[BIGU_ARG_ATTRS1:.*]] byval(%BigU) [[BIGU_ARG_ATTRS2:.*]])
+#[no_mangle]
+pub extern "C" fn test_BigU(_: BigU) -> BigU { loop {} }
+
+// CHECK: define{{.*}}void @test_TsBigU(ptr [[BIGU_RET_ATTRS1:.*]] sret(%TsBigU) [[BIGU_RET_ATTRS2:.*]], ptr [[BIGU_ARG_ATTRS1]] byval(%TsBigU) [[BIGU_ARG_ATTRS2]])
+#[no_mangle]
+pub extern "C" fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
+
+// CHECK: define{{.*}}void @test_TuBigU(ptr [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2:.*]], ptr [[BIGU_ARG_ATTRS1]] byval(%TuBigU) [[BIGU_ARG_ATTRS2]])
+#[no_mangle]
+pub extern "C" fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
+
+// CHECK: define{{.*}}void @test_TeBigU(ptr [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2:.*]], ptr [[BIGU_ARG_ATTRS1]] byval(%"TeBigU::Variant") [[BIGU_ARG_ATTRS2]])
+#[no_mangle]
+pub extern "C" fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }
diff --git a/tests/codegen/repr-transparent-sysv64.rs b/tests/codegen/repr/transparent-sysv64.rs
index 886b0dd9e7b..886b0dd9e7b 100644
--- a/tests/codegen/repr-transparent-sysv64.rs
+++ b/tests/codegen/repr/transparent-sysv64.rs
diff --git a/tests/codegen/repr-transparent.rs b/tests/codegen/repr/transparent.rs
index 759ddea67a5..b140fc719da 100644
--- a/tests/codegen/repr-transparent.rs
+++ b/tests/codegen/repr/transparent.rs
@@ -1,10 +1,13 @@
 // compile-flags: -O -C no-prepopulate-passes
-
 // ignore-riscv64 riscv64 has an i128 type used with test_Vector
-// see codegen/riscv-abi for riscv functiona call tests
 // ignore-s390x s390x with default march passes vector types per reference
 // ignore-loongarch64 see codegen/loongarch-abi for loongarch function call tests
 
+// This codegen test embeds assumptions about how certain "C" psABIs are handled
+// so it doesn't apply to all architectures or even all OS
+// For RISCV: see codegen/riscv-abi
+// For LoongArch: see codegen/loongarch-abi
+
 #![crate_type="lib"]
 #![feature(repr_simd, transparent_unions)]
 
@@ -26,7 +29,7 @@ pub extern "C" fn test_F32(_: F32) -> F32 { loop {} }
 #[repr(transparent)]
 pub struct Ptr(*mut u8);
 
-// CHECK: define{{.*}}{{i8\*|ptr}} @test_Ptr({{i8\*|ptr}} noundef %_1)
+// CHECK: define{{.*}}ptr @test_Ptr(ptr noundef %_1)
 #[no_mangle]
 pub extern "C" fn test_Ptr(_: Ptr) -> Ptr { loop {} }
 
@@ -41,7 +44,7 @@ pub extern "C" fn test_WithZst(_: WithZst) -> WithZst { loop {} }
 pub struct WithZeroSizedArray(*const f32, [i8; 0]);
 
 // Apparently we use i32* when newtype-unwrapping f32 pointers. Whatever.
-// CHECK: define{{.*}}{{i32\*|ptr}} @test_WithZeroSizedArray({{i32\*|ptr}} noundef %_1)
+// CHECK: define{{.*}}ptr @test_WithZeroSizedArray(ptr noundef %_1)
 #[no_mangle]
 pub extern "C" fn test_WithZeroSizedArray(_: WithZeroSizedArray) -> WithZeroSizedArray { loop {} }
 
@@ -65,7 +68,7 @@ pub extern "C" fn test_Gpz(_: GenericPlusZst<Bool>) -> GenericPlusZst<Bool> { lo
 #[repr(transparent)]
 pub struct LifetimePhantom<'a, T: 'a>(*const T, PhantomData<&'a T>);
 
-// CHECK: define{{.*}}{{i16\*|ptr}} @test_LifetimePhantom({{i16\*|ptr}} noundef %_1)
+// CHECK: define{{.*}}ptr @test_LifetimePhantom(ptr noundef %_1)
 #[no_mangle]
 pub extern "C" fn test_LifetimePhantom(_: LifetimePhantom<i16>) -> LifetimePhantom<i16> { loop {} }
 
@@ -159,7 +162,7 @@ pub union UnionF32WithZsts {
 pub extern "C" fn test_UnionF32WithZsts(_: UnionF32WithZsts) -> UnionF32WithZsts { loop {} }
 
 
-// All that remains to be tested are aggregates. They are tested in separate files called repr-
+// All that remains to be tested are aggregates. They are tested in separate files called
 // transparent-*.rs  with `only-*` or `ignore-*` directives, because the expected LLVM IR
 // function signatures vary so much that it's not reasonably possible to cover all of them with a
 // single CHECK line.
diff --git a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
index ec18fa9a328..fdb9c6217de 100644
--- a/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
+++ b/tests/codegen/riscv-abi/riscv64-lp64-lp64f-lp64d-abi.rs
@@ -127,18 +127,18 @@ pub struct Large {
     d: i64,
 }
 
-// CHECK: define void @f_agg_large({{%Large\*|ptr}} {{.*}}%x)
+// CHECK: define void @f_agg_large(ptr {{.*}}%x)
 #[no_mangle]
 pub extern "C" fn f_agg_large(mut x: Large) {
 }
 
-// CHECK: define void @f_agg_large_ret({{%Large\*|ptr}} {{.*}}sret{{.*}}, i32 noundef signext %i, i8 noundef signext %j)
+// CHECK: define void @f_agg_large_ret(ptr {{.*}}sret{{.*}}, i32 noundef signext %i, i8 noundef signext %j)
 #[no_mangle]
 pub extern "C" fn f_agg_large_ret(i: i32, j: i8) -> Large {
     Large { a: 1, b: 2, c: 3, d: 4 }
 }
 
-// CHECK: define void @f_scalar_stack_1(i64 %0, [2 x i64] %1, i128 %2, {{%Large\*|ptr}} {{.*}}%d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef %g, i8 noundef %h)
+// CHECK: define void @f_scalar_stack_1(i64 %0, [2 x i64] %1, i128 %2, ptr {{.*}}%d, i8 noundef zeroext %e, i8 noundef signext %f, i8 noundef %g, i8 noundef %h)
 #[no_mangle]
 pub extern "C" fn f_scalar_stack_1(
     a: Tiny,
@@ -152,7 +152,7 @@ pub extern "C" fn f_scalar_stack_1(
 ) {
 }
 
-// CHECK: define void @f_scalar_stack_2({{%Large\*|ptr}} {{.*}}sret{{.*}} %_0, i64 noundef %a, i128 %0, i128 %1, i64 noundef %d, i8 noundef zeroext %e, i8 noundef %f, i8 noundef %g)
+// CHECK: define void @f_scalar_stack_2(ptr {{.*}}sret{{.*}} %_0, i64 noundef %a, i128 %0, i128 %1, i64 noundef %d, i8 noundef zeroext %e, i8 noundef %f, i8 noundef %g)
 #[no_mangle]
 pub extern "C" fn f_scalar_stack_2(
     a: u64,
@@ -172,7 +172,7 @@ extern "C" {
 
 #[no_mangle]
 pub unsafe extern "C" fn f_va_caller() {
-    // CHECK: call noundef signext i32 (i32, ...) @f_va_callee(i32 noundef signext 1, i32 noundef signext 2, i64 noundef 3, double {{.*}}, double {{.*}}, i64 {{.*}}, [2 x i64] {{.*}}, i128 {{.*}}, {{%Large\*|ptr}} {{.*}})
+    // CHECK: call noundef signext i32 (i32, ...) @f_va_callee(i32 noundef signext 1, i32 noundef signext 2, i64 noundef 3, double {{.*}}, double {{.*}}, i64 {{.*}}, [2 x i64] {{.*}}, i128 {{.*}}, ptr {{.*}})
     f_va_callee(
         1,
         2i32,
diff --git a/tests/codegen/sanitizer-cfi-emit-type-checks.rs b/tests/codegen/sanitizer-cfi-emit-type-checks.rs
index cea6aac8b8b..f0fe5de9f66 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-checks.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-checks.rs
@@ -8,7 +8,7 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo{{.*}}!type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
     // CHECK:       start:
-    // CHECK:       [[TT:%.+]] = call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"{{[[:print:]]+}}")
+    // CHECK:       [[TT:%.+]] = call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"{{[[:print:]]+}}")
     // CHECK-NEXT:  br i1 [[TT]], label %type_test.pass, label %type_test.fail
     // CHECK:       type_test.pass:
     // CHECK-NEXT:  {{%.+}} = call i32 %f(i32 %arg)
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs
index 78ef0c2c7d6..d200ed9798a 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs
@@ -8,21 +8,21 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
     // CHECK-SAME:  {{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_E.generalized")
     f(arg)
 }
 
 pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}bar
     // CHECK-SAME:  {{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.generalized")
     f(arg1, arg2)
 }
 
 pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}baz
     // CHECK-SAME:  {{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.generalized")
     f(arg1, arg2, arg3)
 }
 
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs
index 3b72459c4b0..cdefec17a1c 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs
@@ -8,21 +8,21 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
     // CHECK-SAME:  {{.*}}![[TYPE1:[0-9]+]]
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E.normalized.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_E.normalized.generalized")
     f(arg)
 }
 
 pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}bar
     // CHECK-SAME:  {{.*}}![[TYPE2:[0-9]+]]
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.normalized.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.normalized.generalized")
     f(arg1, arg2)
 }
 
 pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}baz
     // CHECK-SAME:  {{.*}}![[TYPE3:[0-9]+]]
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.normalized.generalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.normalized.generalized")
     f(arg1, arg2, arg3)
 }
 
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs
index 9218e9947bf..f360b33ddcf 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs
@@ -8,21 +8,21 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
     // CHECK-SAME:  {{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E.normalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_E.normalized")
     f(arg)
 }
 
 pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}bar
     // CHECK-SAME:  {{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.normalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E.normalized")
     f(arg1, arg2)
 }
 
 pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}baz
     // CHECK-SAME:  {{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.normalized")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E.normalized")
     f(arg1, arg2, arg3)
 }
 
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
index f9fd816dedb..3cb817b212d 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-itanium-cxx-abi.rs
@@ -8,21 +8,21 @@
 pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}foo
     // CHECK-SAME:  {{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_E")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_E")
     f(arg)
 }
 
 pub fn bar(f: fn(i32, i32) -> i32, arg1: i32, arg2: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}bar
     // CHECK-SAME:  {{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_E")
     f(arg1, arg2)
 }
 
 pub fn baz(f: fn(i32, i32, i32) -> i32, arg1: i32, arg2: i32, arg3: i32) -> i32 {
     // CHECK-LABEL: define{{.*}}baz
     // CHECK-SAME:  {{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"_ZTSFu3i32S_S_S_E")
     f(arg1, arg2, arg3)
 }
 
diff --git a/tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs
index 0f79adab7bd..b69e57261a8 100644
--- a/tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs
+++ b/tests/codegen/sanitizer-cfi-emit-type-metadata-trait-objects.rs
@@ -53,10 +53,22 @@ impl<'a, T, U> Trait4<'a, U> for T {
     }
 }
 
+pub trait Trait5<T, const N: usize> {
+    fn quux(&self, _: &[T; N]);
+}
+
+#[derive(Copy, Clone)]
+pub struct Type5;
+
+impl<T, U, const N: usize> Trait5<U, N> for T {
+    fn quux(&self, _: &[U; N]) {
+    }
+}
+
 pub fn foo1(a: &dyn Trait1) {
     a.foo();
     // CHECK-LABEL: define{{.*}}4foo1{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE1:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE1:[[:print:]]+]]")
 }
 
 pub fn bar1() {
@@ -64,13 +76,13 @@ pub fn bar1() {
     let b = &a as &dyn Trait1;
     b.foo();
     // CHECK-LABEL: define{{.*}}4bar1{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
 }
 
 pub fn foo2<T>(a: &dyn Trait2<T>) {
     a.bar();
     // CHECK-LABEL: define{{.*}}4foo2{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
 }
 
 pub fn bar2() {
@@ -79,14 +91,14 @@ pub fn bar2() {
     let b = &a as &dyn Trait2<i32>;
     b.bar();
     // CHECK-LABEL: define{{.*}}4bar2{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE2:[[:print:]]+]]")
 }
 
 pub fn foo3(a: &dyn Trait3<Type3>) {
     let b = Type3;
     a.baz(&b);
     // CHECK-LABEL: define{{.*}}4foo3{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE3:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE3:[[:print:]]+]]")
 }
 
 pub fn bar3() {
@@ -95,14 +107,14 @@ pub fn bar3() {
     let b = &a as &dyn Trait3<Type3>;
     b.baz(&a);
     // CHECK-LABEL: define{{.*}}4bar3{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE3:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE3:[[:print:]]+]]")
 }
 
 pub fn foo4<'a>(a: &dyn Trait4<'a, Type4, Output = &'a i32>) {
     let b = Type4;
     a.qux(&b);
     // CHECK-LABEL: define{{.*}}4foo4{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
 }
 
 pub fn bar4<'a>() {
@@ -111,10 +123,27 @@ pub fn bar4<'a>() {
     let b = &a as &dyn Trait4<'a, Type4, Output = &'a i32>;
     b.qux(&a);
     // CHECK-LABEL: define{{.*}}4bar4{{.*}}!type !{{[0-9]+}}
-    // CHECK:       call i1 @llvm.type.test({{i8\*|ptr}} {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE4:[[:print:]]+]]")
+}
+
+pub fn foo5(a: &dyn Trait5<Type5, 32>) {
+    let b = &[Type5; 32];
+    a.quux(&b);
+    // CHECK-LABEL: define{{.*}}4foo5{{.*}}!type !{{[0-9]+}}
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE5:[[:print:]]+]]")
+}
+
+pub fn bar5() {
+    let a = &[Type5; 32];
+    foo5(&a);
+    let b = &a as &dyn Trait5<Type5, 32>;
+    b.quux(&a);
+    // CHECK-LABEL: define{{.*}}4bar5{{.*}}!type !{{[0-9]+}}
+    // CHECK:       call i1 @llvm.type.test(ptr {{%f|%[0-9]}}, metadata !"[[TYPE5:[[:print:]]+]]")
 }
 
 // CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE1]]"}
 // CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE2]]"}
 // CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE3]]"}
 // CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE4]]"}
+// CHECK: !{{[0-9]+}} = !{i64 0, !"[[TYPE5]]"}
diff --git a/tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs
index 004a67e7df2..7aed137f215 100644
--- a/tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs
+++ b/tests/codegen/sanitizer-kcfi-emit-type-metadata-trait-objects.rs
@@ -77,10 +77,23 @@ impl<'a, T, U> Trait4<'a, U> for T {
     }
 }
 
+pub trait Trait5<T, const N: usize> {
+    fn quux(&self, _: &[T; N]);
+}
+
+pub struct Type5;
+
+impl Copy for Type5 {}
+
+impl<T, U, const N: usize> Trait5<U, N> for T {
+    fn quux(&self, _: &[U; N]) {
+    }
+}
+
 pub fn foo1(a: &dyn Trait1) {
     a.foo();
     // CHECK-LABEL: define{{.*}}4foo1{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE1:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE1:[[:print:]]+]]) ]
 }
 
 pub fn bar1() {
@@ -88,13 +101,13 @@ pub fn bar1() {
     let b = &a as &dyn Trait1;
     b.foo();
     // CHECK-LABEL: define{{.*}}4bar1{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE1:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE1:[[:print:]]+]]) ]
 }
 
 pub fn foo2<T>(a: &dyn Trait2<T>) {
     a.bar();
     // CHECK-LABEL: define{{.*}}4foo2{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE2:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE2:[[:print:]]+]]) ]
 }
 
 pub fn bar2() {
@@ -103,14 +116,14 @@ pub fn bar2() {
     let b = &a as &dyn Trait2<i32>;
     b.bar();
     // CHECK-LABEL: define{{.*}}4bar2{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE2:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE2:[[:print:]]+]]) ]
 }
 
 pub fn foo3(a: &dyn Trait3<Type3>) {
     let b = Type3;
     a.baz(&b);
     // CHECK-LABEL: define{{.*}}4foo3{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}, {{\{\}\*|ptr|%Type3\*}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE3:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}, ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE3:[[:print:]]+]]) ]
 }
 
 pub fn bar3() {
@@ -119,14 +132,14 @@ pub fn bar3() {
     let b = &a as &dyn Trait3<Type3>;
     b.baz(&a);
     // CHECK-LABEL: define{{.*}}4bar3{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call void %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}, {{\{\}\*|ptr|%Type3\*}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE3:[[:print:]]+]]) ]
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}, ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE3:[[:print:]]+]]) ]
 }
 
 pub fn foo4<'a>(a: &dyn Trait4<'a, Type4, Output = &'a i32>) {
     let b = Type4;
     a.qux(&b);
     // CHECK-LABEL: define{{.*}}4foo4{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call align 4 {{ptr|i32\*}} %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}, {{\{\}\*|ptr|%Type4\*}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE4:[[:print:]]+]]) ]
+    // CHECK:       call align 4 ptr %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}, ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE4:[[:print:]]+]]) ]
 }
 
 pub fn bar4<'a>() {
@@ -135,10 +148,27 @@ pub fn bar4<'a>() {
     let b = &a as &dyn Trait4<'a, Type4, Output = &'a i32>;
     b.qux(&a);
     // CHECK-LABEL: define{{.*}}4bar4{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
-    // CHECK:       call align 4 {{ptr|i32\*}} %{{[0-9]}}({{\{\}\*|ptr}} align 1 {{%[a-z]\.0|%_[0-9]}}, {{\{\}\*|ptr|%Type4\*}} align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE4:[[:print:]]+]]) ]
+    // CHECK:       call align 4 ptr %{{[0-9]}}(ptr align 1 {{%[a-z]\.0|%_[0-9]}}, ptr align 1 {{%[a-z]\.0|%_[0-9]}}){{.*}}[ "kcfi"(i32 [[TYPE4:[[:print:]]+]]) ]
+}
+
+pub fn foo5(a: &dyn Trait5<Type5, 32>) {
+    let b = &[Type5; 32];
+    a.quux(&b);
+    // CHECK-LABEL: define{{.*}}4foo5{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z](\.0)*|%_[0-9]+]}}, ptr align 1 {{%[a-z](\.0)*|%_[0-9]+}}){{.*}}[ "kcfi"(i32 [[TYPE5:[[:print:]]+]]) ]
+}
+
+pub fn bar5() {
+    let a = &[Type5; 32];
+    foo5(&a);
+    let b = &a as &dyn Trait5<Type5, 32>;
+    b.quux(&a);
+    // CHECK-LABEL: define{{.*}}4bar5{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}}
+    // CHECK:       call void %{{[0-9]}}(ptr align 1 {{%[a-z](\.0)*|%_[0-9]+]}}, ptr align 1 {{%[a-z](\.0)*|%_[0-9]+}}){{.*}}[ "kcfi"(i32 [[TYPE5:[[:print:]]+]]) ]
 }
 
 // CHECK: !{{[0-9]+}} = !{i32 [[TYPE1]]}
 // CHECK: !{{[0-9]+}} = !{i32 [[TYPE2]]}
 // CHECK: !{{[0-9]+}} = !{i32 [[TYPE3]]}
 // CHECK: !{{[0-9]+}} = !{i32 [[TYPE4]]}
+// CHECK: !{{[0-9]+}} = !{i32 [[TYPE5]]}
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
index cacc32f2f1b..7fe3ffd2086 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-gather.rs
@@ -23,7 +23,7 @@ extern "platform-intrinsic" {
 #[no_mangle]
 pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
                            values: Vec2<f32>) -> Vec2<f32> {
-    // CHECK: call <2 x float> @llvm.masked.gather.v2f32.{{.+}}(<2 x {{float\*|ptr}}> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}}, <2 x float> {{.*}})
+    // CHECK: call <2 x float> @llvm.masked.gather.v2f32.{{.+}}(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}}, <2 x float> {{.*}})
     simd_gather(values, pointers, mask)
 }
 
@@ -31,6 +31,6 @@ pub unsafe fn gather_f32x2(pointers: Vec2<*const f32>, mask: Vec2<i32>,
 #[no_mangle]
 pub unsafe fn gather_pf32x2(pointers: Vec2<*const *const f32>, mask: Vec2<i32>,
                            values: Vec2<*const f32>) -> Vec2<*const f32> {
-    // CHECK: call <2 x {{float\*|ptr}}> @llvm.masked.gather.{{.+}}(<2 x {{float\*\*|ptr}}> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}}, <2 x {{float\*|ptr}}> {{.*}})
+    // CHECK: call <2 x ptr> @llvm.masked.gather.{{.+}}(<2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}}, <2 x ptr> {{.*}})
     simd_gather(values, pointers, mask)
 }
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
index 94ecaf6096d..5c917474e45 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-generic-scatter.rs
@@ -23,7 +23,7 @@ extern "platform-intrinsic" {
 #[no_mangle]
 pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>,
                             values: Vec2<f32>) {
-    // CHECK: call void @llvm.masked.scatter.v2f32.v2p0{{.*}}(<2 x float> {{.*}}, <2 x {{float\*|ptr}}> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}})
+    // CHECK: call void @llvm.masked.scatter.v2f32.v2p0{{.*}}(<2 x float> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}})
     simd_scatter(values, pointers, mask)
 }
 
@@ -32,6 +32,6 @@ pub unsafe fn scatter_f32x2(pointers: Vec2<*mut f32>, mask: Vec2<i32>,
 #[no_mangle]
 pub unsafe fn scatter_pf32x2(pointers: Vec2<*mut *const f32>, mask: Vec2<i32>,
                              values: Vec2<*const f32>) {
-    // CHECK: call void @llvm.masked.scatter.v2p0{{.*}}.v2p0{{.*}}(<2 x {{float\*|ptr}}> {{.*}}, <2 x {{float\*\*|ptr}}> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}})
+    // CHECK: call void @llvm.masked.scatter.v2p0{{.*}}.v2p0{{.*}}(<2 x ptr> {{.*}}, <2 x ptr> {{.*}}, i32 {{.*}}, <2 x i1> {{.*}})
     simd_scatter(values, pointers, mask)
 }
diff --git a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
index 3a0e37de2f3..eb4ce307e70 100644
--- a/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
+++ b/tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs
@@ -42,8 +42,8 @@ pub fn build_array_s(x: [f32; 4]) -> S<4> {
 // CHECK-LABEL: @build_array_transmute_s
 #[no_mangle]
 pub fn build_array_transmute_s(x: [f32; 4]) -> S<4> {
-    // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
-    // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %_0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
+    // CHECK: %[[VAL:.+]] = load <4 x float>, ptr %x, align [[ARRAY_ALIGN]]
+    // CHECK: store <4 x float> %[[VAL:.+]], ptr %_0, align [[VECTOR_ALIGN]]
     unsafe { std::mem::transmute(x) }
 }
 
@@ -57,8 +57,8 @@ pub fn build_array_t(x: [f32; 4]) -> T {
 // CHECK-LABEL: @build_array_transmute_t
 #[no_mangle]
 pub fn build_array_transmute_t(x: [f32; 4]) -> T {
-    // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
-    // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %_0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
+    // CHECK: %[[VAL:.+]] = load <4 x float>, ptr %x, align [[ARRAY_ALIGN]]
+    // CHECK: store <4 x float> %[[VAL:.+]], ptr %_0, align [[VECTOR_ALIGN]]
     unsafe { std::mem::transmute(x) }
 }
 
@@ -76,7 +76,7 @@ pub fn build_array_u(x: [f32; 4]) -> U {
 // CHECK-LABEL: @build_array_transmute_u
 #[no_mangle]
 pub fn build_array_transmute_u(x: [f32; 4]) -> U {
-    // CHECK: %[[VAL:.+]] = load <4 x float>, {{ptr %x|.+>\* %.+}}, align [[ARRAY_ALIGN]]
-    // CHECK: store <4 x float> %[[VAL:.+]], {{ptr %_0|.+>\* %.+}}, align [[VECTOR_ALIGN]]
+    // CHECK: %[[VAL:.+]] = load <4 x float>, ptr %x, align [[ARRAY_ALIGN]]
+    // CHECK: store <4 x float> %[[VAL:.+]], ptr %_0, align [[VECTOR_ALIGN]]
     unsafe { std::mem::transmute(x) }
 }
diff --git a/tests/codegen/simd_arith_offset.rs b/tests/codegen/simd_arith_offset.rs
index 74d7edc70d7..1ee73de1186 100644
--- a/tests/codegen/simd_arith_offset.rs
+++ b/tests/codegen/simd_arith_offset.rs
@@ -21,6 +21,6 @@ pub struct Simd<T, const LANES: usize>([T; LANES]);
 // CHECK-LABEL: smoke
 #[no_mangle]
 pub fn smoke(ptrs: SimdConstPtr<u8, 8>, offsets: Simd<usize, 8>) -> SimdConstPtr<u8, 8> {
-    // CHECK: getelementptr i8, <8 x {{i8\*|ptr}}> %0, <8 x i64> %1
+    // CHECK: getelementptr i8, <8 x ptr> %0, <8 x i64> %1
     unsafe { simd_arith_offset(ptrs, offsets) }
 }
diff --git a/tests/codegen/slice-init.rs b/tests/codegen/slice-init.rs
index d80628cb1d4..c0bf1a04119 100644
--- a/tests/codegen/slice-init.rs
+++ b/tests/codegen/slice-init.rs
@@ -23,7 +23,7 @@ pub fn zero_len_array() {
 // CHECK-LABEL: @byte_array
 #[no_mangle]
 pub fn byte_array() {
-    // CHECK: call void @llvm.memset.{{.+}}({{i8\*|ptr}} {{.*}}, i8 7, i{{[0-9]+}} 4
+    // CHECK: call void @llvm.memset.{{.+}}(ptr {{.*}}, i8 7, i{{[0-9]+}} 4
     // CHECK-NOT: br label %repeat_loop_header{{.*}}
     let x = [7u8; 4];
     opaque(&x);
@@ -39,7 +39,7 @@ enum Init {
 // CHECK-LABEL: @byte_enum_array
 #[no_mangle]
 pub fn byte_enum_array() {
-    // CHECK: call void @llvm.memset.{{.+}}({{i8\*|ptr}} {{.*}}, i8 {{.*}}, i{{[0-9]+}} 4
+    // CHECK: call void @llvm.memset.{{.+}}(ptr {{.*}}, i8 {{.*}}, i{{[0-9]+}} 4
     // CHECK-NOT: br label %repeat_loop_header{{.*}}
     let x = [Init::Memset; 4];
     opaque(&x);
@@ -48,7 +48,7 @@ pub fn byte_enum_array() {
 // CHECK-LABEL: @zeroed_integer_array
 #[no_mangle]
 pub fn zeroed_integer_array() {
-    // CHECK: call void @llvm.memset.{{.+}}({{i8\*|ptr}} {{.*}}, i8 0, i{{[0-9]+}} 16
+    // CHECK: call void @llvm.memset.{{.+}}(ptr {{.*}}, i8 0, i{{[0-9]+}} 16
     // CHECK-NOT: br label %repeat_loop_header{{.*}}
     let x = [0u32; 4];
     opaque(&x);
diff --git a/tests/codegen/slice-iter-len-eq-zero.rs b/tests/codegen/slice-iter-len-eq-zero.rs
index efa7b6a9680..c7515ce35a3 100644
--- a/tests/codegen/slice-iter-len-eq-zero.rs
+++ b/tests/codegen/slice-iter-len-eq-zero.rs
@@ -9,7 +9,7 @@ type Demo = [u8; 3];
 #[no_mangle]
 pub fn slice_iter_len_eq_zero(y: std::slice::Iter<'_, Demo>) -> bool {
     // CHECK-NOT: sub
-    // CHECK: %[[RET:.+]] = icmp eq {{i8\*|ptr}} {{%1|%0}}, {{%1|%0}}
+    // CHECK: %[[RET:.+]] = icmp eq ptr {{%1|%0}}, {{%1|%0}}
     // CHECK: ret i1 %[[RET]]
     y.len() == 0
 }
diff --git a/tests/codegen/slice-ref-equality.rs b/tests/codegen/slice-ref-equality.rs
index c91e5bc3cd0..4d0dce7b074 100644
--- a/tests/codegen/slice-ref-equality.rs
+++ b/tests/codegen/slice-ref-equality.rs
@@ -25,7 +25,7 @@ pub fn is_zero_slice_long(data: &[u8; 456]) -> bool {
 // CHECK-LABEL: @is_zero_slice_short
 #[no_mangle]
 pub fn is_zero_slice_short(data: &[u8; 4]) -> bool {
-    // CHECK: %[[LOAD:.+]] = load i32, {{i32\*|ptr}} %{{.+}}, align 1
+    // CHECK: %[[LOAD:.+]] = load i32, ptr %{{.+}}, align 1
     // CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[LOAD]], 0
     // CHECK-NEXT: ret i1 %[[EQ]]
     &data[..] == [0; 4]
@@ -34,7 +34,7 @@ pub fn is_zero_slice_short(data: &[u8; 4]) -> bool {
 // CHECK-LABEL: @is_zero_array
 #[no_mangle]
 pub fn is_zero_array(data: &[u8; 4]) -> bool {
-    // CHECK: %[[LOAD:.+]] = load i32, {{i32\*|ptr}} %{{.+}}, align 1
+    // CHECK: %[[LOAD:.+]] = load i32, ptr %{{.+}}, align 1
     // CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[LOAD]], 0
     // CHECK-NEXT: ret i1 %[[EQ]]
     *data == [0; 4]
@@ -50,7 +50,7 @@ pub fn is_zero_array(data: &[u8; 4]) -> bool {
 fn eq_slice_of_nested_u8(x: &[[u8; 3]], y: &[[u8; 3]]) -> bool {
     // CHECK: icmp eq [[USIZE]] %x.1, %y.1
     // CHECK: %[[BYTES:.+]] = mul nsw [[USIZE]] %x.1, 3
-    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}({{i8\*|ptr}}
+    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr
     // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]])
     x == y
 }
@@ -62,7 +62,7 @@ fn eq_slice_of_nested_u8(x: &[[u8; 3]], y: &[[u8; 3]]) -> bool {
 fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool {
     // CHECK: icmp eq [[USIZE]] %x.1, %y.1
     // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %x.1, 2
-    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}({{i32\*|ptr}}
+    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr
     // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]])
     x == y
 }
@@ -74,7 +74,7 @@ fn eq_slice_of_i32(x: &[i32], y: &[i32]) -> bool {
 fn eq_slice_of_nonzero(x: &[NonZeroU32], y: &[NonZeroU32]) -> bool {
     // CHECK: icmp eq [[USIZE]] %x.1, %y.1
     // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %x.1, 2
-    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}({{i32\*|ptr}}
+    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr
     // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]])
     x == y
 }
@@ -86,7 +86,7 @@ fn eq_slice_of_nonzero(x: &[NonZeroU32], y: &[NonZeroU32]) -> bool {
 fn eq_slice_of_option_of_nonzero(x: &[Option<NonZeroI16>], y: &[Option<NonZeroI16>]) -> bool {
     // CHECK: icmp eq [[USIZE]] %x.1, %y.1
     // CHECK: %[[BYTES:.+]] = shl nsw [[USIZE]] %x.1, 1
-    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}({{i16\*|ptr}}
+    // CHECK: tail call{{( noundef)?}} i32 @{{bcmp|memcmp}}(ptr
     // CHECK-SAME: , [[USIZE]]{{( noundef)?}} %[[BYTES]])
     x == y
 }
diff --git a/tests/codegen/slice_as_from_ptr_range.rs b/tests/codegen/slice_as_from_ptr_range.rs
index 0e3fefd9728..3d8ab0a4b5f 100644
--- a/tests/codegen/slice_as_from_ptr_range.rs
+++ b/tests/codegen/slice_as_from_ptr_range.rs
@@ -1,7 +1,6 @@
 // compile-flags: -O
 // only-64bit (because we're using [ui]size)
 // ignore-debug (because the assertions get in the way)
-// min-llvm-version: 15.0 (because this is a relatively new instcombine)
 
 #![crate_type = "lib"]
 #![feature(slice_from_ptr_range)]
diff --git a/tests/codegen/stores.rs b/tests/codegen/stores.rs
index 837256e5369..a8e155c4c8a 100644
--- a/tests/codegen/stores.rs
+++ b/tests/codegen/stores.rs
@@ -17,8 +17,8 @@ pub struct Bytes {
 pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
 // CHECK: [[TMP:%.+]] = alloca i32
 // CHECK: %y = alloca [4 x i8]
-// CHECK: store i32 %0, {{i32\*|ptr}} [[TMP]]
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 {{.+}}, {{i8\*|ptr}} align 4 {{.+}}, i{{[0-9]+}} 4, i1 false)
+// CHECK: store i32 %0, ptr [[TMP]]
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 {{.+}}, ptr align 4 {{.+}}, i{{[0-9]+}} 4, i1 false)
     *x = y;
 }
 
@@ -29,7 +29,7 @@ pub fn small_array_alignment(x: &mut [i8; 4], y: [i8; 4]) {
 pub fn small_struct_alignment(x: &mut Bytes, y: Bytes) {
 // CHECK: [[TMP:%.+]] = alloca i32
 // CHECK: %y = alloca %Bytes
-// CHECK: store i32 %0, {{i32\*|ptr}} [[TMP]]
-// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 {{.+}}, {{i8\*|ptr}} align 4 {{.+}}, i{{[0-9]+}} 4, i1 false)
+// CHECK: store i32 %0, ptr [[TMP]]
+// CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 {{.+}}, ptr align 4 {{.+}}, i{{[0-9]+}} 4, i1 false)
     *x = y;
 }
diff --git a/tests/codegen/swap-large-types.rs b/tests/codegen/swap-large-types.rs
index 4a68403578d..7b6611f3da4 100644
--- a/tests/codegen/swap-large-types.rs
+++ b/tests/codegen/swap-large-types.rs
@@ -83,9 +83,9 @@ pub struct BigButHighlyAligned([u8; 64 * 3]);
 #[no_mangle]
 pub fn swap_big_aligned(x: &mut BigButHighlyAligned, y: &mut BigButHighlyAligned) {
 // CHECK-NOT: call void @llvm.memcpy
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} noundef nonnull align 64 dereferenceable(192)
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} noundef nonnull align 64 dereferenceable(192)
-// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} noundef nonnull align 64 dereferenceable(192)
+// CHECK: call void @llvm.memcpy.{{.+}}(ptr noundef nonnull align 64 dereferenceable(192)
+// CHECK: call void @llvm.memcpy.{{.+}}(ptr noundef nonnull align 64 dereferenceable(192)
+// CHECK: call void @llvm.memcpy.{{.+}}(ptr noundef nonnull align 64 dereferenceable(192)
 // CHECK-NOT: call void @llvm.memcpy
     swap(x, y)
 }
diff --git a/tests/codegen/transmute-optimized.rs b/tests/codegen/transmute-optimized.rs
index 461dd550cd7..b8c51b08499 100644
--- a/tests/codegen/transmute-optimized.rs
+++ b/tests/codegen/transmute-optimized.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O -Z merge-functions=disabled
-// min-llvm-version: 15.0 # this test uses `ptr`s
 // ignore-debug
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/transmute-scalar.rs b/tests/codegen/transmute-scalar.rs
index 293b0d664f6..39126b024a6 100644
--- a/tests/codegen/transmute-scalar.rs
+++ b/tests/codegen/transmute-scalar.rs
@@ -1,5 +1,4 @@
 // compile-flags: -C opt-level=0 -C no-prepopulate-passes
-// min-llvm-version: 15.0 # this test assumes `ptr`s and thus no `pointercast`s
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/try_question_mark_nop.rs b/tests/codegen/try_question_mark_nop.rs
index d239387768e..9d34155bdd7 100644
--- a/tests/codegen/try_question_mark_nop.rs
+++ b/tests/codegen/try_question_mark_nop.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 15.0
 // compile-flags: -O -Z merge-functions=disabled --edition=2021
 // only-x86_64
 
diff --git a/tests/codegen/unchecked_shifts.rs b/tests/codegen/unchecked_shifts.rs
index 0924dda08ee..d5f53bedd54 100644
--- a/tests/codegen/unchecked_shifts.rs
+++ b/tests/codegen/unchecked_shifts.rs
@@ -1,5 +1,4 @@
 // compile-flags: -O
-// min-llvm-version: 15.0 (LLVM 13 in CI does this differently from submodule LLVM)
 // ignore-debug (because unchecked is checked in debug)
 
 #![crate_type = "lib"]
diff --git a/tests/codegen/uninit-consts.rs b/tests/codegen/uninit-consts.rs
index f169988e1f5..1313e67634a 100644
--- a/tests/codegen/uninit-consts.rs
+++ b/tests/codegen/uninit-consts.rs
@@ -1,5 +1,4 @@
 // compile-flags: -C no-prepopulate-passes
-// min-llvm-version: 15.0 (for opaque pointers)
 
 // Check that we use undef (and not zero) for uninitialized bytes in constants.
 
diff --git a/tests/codegen/union-abi.rs b/tests/codegen/union-abi.rs
index 653c5837daf..4878ae5c3b6 100644
--- a/tests/codegen/union-abi.rs
+++ b/tests/codegen/union-abi.rs
@@ -17,25 +17,25 @@ pub struct i64x4(i64, i64, i64, i64);
 #[derive(Copy, Clone)]
 pub union UnionI64x4{ a:(), b: i64x4 }
 
-// CHECK: define {{(dso_local )?}}void @test_UnionI64x4({{<4 x i64>\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4(ptr {{.*}} %_1)
 #[no_mangle]
 pub fn test_UnionI64x4(_: UnionI64x4) { loop {} }
 
 pub union UnionI64x4_{ a: i64x4, b: (), c:i64x4, d: Unhab, e: ((),()), f: UnionI64x4 }
 
-// CHECK: define {{(dso_local )?}}void @test_UnionI64x4_({{<4 x i64>\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4_(ptr {{.*}} %_1)
 #[no_mangle]
 pub fn test_UnionI64x4_(_: UnionI64x4_) { loop {} }
 
 pub union UnionI64x4I64{ a: i64x4, b: i64 }
 
-// CHECK: define {{(dso_local )?}}void @test_UnionI64x4I64({{%UnionI64x4I64\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4I64(ptr {{.*}} %_1)
 #[no_mangle]
 pub fn test_UnionI64x4I64(_: UnionI64x4I64) { loop {} }
 
 pub union UnionI64x4Tuple{ a: i64x4, b: (i64, i64, i64, i64) }
 
-// CHECK: define {{(dso_local )?}}void @test_UnionI64x4Tuple({{%UnionI64x4Tuple\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_UnionI64x4Tuple(ptr {{.*}} %_1)
 #[no_mangle]
 pub fn test_UnionI64x4Tuple(_: UnionI64x4Tuple) { loop {} }
 
@@ -65,7 +65,7 @@ pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} }
 
 #[repr(C)]
 pub union CUnionU128{a:u128}
-// CHECK: define {{(dso_local )?}}void @test_CUnionU128({{%CUnionU128\*|ptr}} {{.*}} %_1)
+// CHECK: define {{(dso_local )?}}void @test_CUnionU128(ptr {{.*}} %_1)
 #[no_mangle]
 pub fn test_CUnionU128(_: CUnionU128) { loop {} }
 
diff --git a/tests/codegen/vec-as-ptr.rs b/tests/codegen/vec-as-ptr.rs
index 8ff7ba9cb64..76098bc08a3 100644
--- a/tests/codegen/vec-as-ptr.rs
+++ b/tests/codegen/vec-as-ptr.rs
@@ -4,7 +4,7 @@
 
 // Test that even though we return a *const u8 not a &[u8] or a NonNull<u8>, LLVM knows that this
 // pointer is nonnull.
-// CHECK: nonnull {{i8\*|ptr}} @vec_as_ptr
+// CHECK: nonnull ptr @vec_as_ptr
 #[no_mangle]
 pub fn vec_as_ptr(v: &Vec<u8>) -> *const u8 {
     v.as_ptr()
@@ -12,7 +12,7 @@ pub fn vec_as_ptr(v: &Vec<u8>) -> *const u8 {
 
 // Test that even though we return a *const u8 not a &[u8] or a NonNull<u8>, LLVM knows that this
 // pointer is nonnull.
-// CHECK: nonnull {{i8\*|ptr}} @vec_as_mut_ptr
+// CHECK: nonnull ptr @vec_as_mut_ptr
 #[no_mangle]
 pub fn vec_as_mut_ptr(v: &mut Vec<u8>) -> *mut u8 {
     v.as_mut_ptr()
diff --git a/tests/codegen/vec-calloc.rs b/tests/codegen/vec-calloc.rs
index 4481a9d1e99..a5fda7b2449 100644
--- a/tests/codegen/vec-calloc.rs
+++ b/tests/codegen/vec-calloc.rs
@@ -1,7 +1,6 @@
 // compile-flags: -O -Z merge-functions=disabled
 // only-x86_64
 // ignore-debug
-// min-llvm-version: 15.0
 
 #![crate_type = "lib"]
 
diff --git a/tests/debuginfo/thread-names.rs b/tests/debuginfo/thread-names.rs
index 7a35a518946..2c5b3f272e0 100644
--- a/tests/debuginfo/thread-names.rs
+++ b/tests/debuginfo/thread-names.rs
@@ -1,15 +1,8 @@
 // compile-flags:-g
+// revisions: macos windows
 // We can't set the main thread name on Linux because it renames the process (#97191)
-// ignore-linux
-// ignore-android
-// ignore-dragonfly
-// ignore-emscripten
-// ignore-freebsd
-// ignore-haiku
-// ignore-ios
-// ignore-netbsd
-// ignore-openbsd
-// ignore-solaris
+//[macos] only-macos
+//[windows] only-windows
 // ignore-sgx
 // ignore-windows-gnu
 
diff --git a/tests/run-make/coverage-llvmir/filecheck.testprog.txt b/tests/run-make/coverage-llvmir/filecheck.testprog.txt
index b3a8808df05..9d63fabd788 100644
--- a/tests/run-make/coverage-llvmir/filecheck.testprog.txt
+++ b/tests/run-make/coverage-llvmir/filecheck.testprog.txt
@@ -39,10 +39,10 @@ CHECK-NOT:    [[DEFINE_INTERNAL]]
 CHECK:        atomicrmw add ptr
 CHECK-SAME:   @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called,
 
-CHECK:        declare void @llvm.instrprof.increment({{i8\*|ptr}}, i64, i32, i32) #[[LLVM_INSTRPROF_INCREMENT_ATTR:[0-9]+]]
+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, {{i32\*|ptr}} @__llvm_profile_runtime
+WINDOWS-NEXT: %1 = load i32, ptr @__llvm_profile_runtime
 WINDOWS-NEXT: ret i32 %1
 WINDOWS-NEXT: }
 
diff --git a/tests/run-make/dump-ice-to-disk/Makefile b/tests/run-make/dump-ice-to-disk/Makefile
index 4f33d590237..23006fc09e2 100644
--- a/tests/run-make/dump-ice-to-disk/Makefile
+++ b/tests/run-make/dump-ice-to-disk/Makefile
@@ -3,6 +3,7 @@ include ../tools.mk
 # ignore-windows
 
 export RUSTC := $(RUSTC_ORIGINAL)
+export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
 export TMPDIR := $(TMPDIR)
 
 all:
diff --git a/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt b/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt
index e19c78350e9..2b058faafcb 100644
--- a/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt
+++ b/tests/run-make/pgo-indirect-call-promotion/filecheck-patterns.txt
@@ -2,7 +2,7 @@ CHECK: define void @call_a_bunch_of_functions({{.*}} {
 
 # Make sure that indirect call promotion inserted a check against the most
 # frequently called function.
-CHECK: %{{.*}} = icmp eq {{void \(\)\*|ptr}} %{{.*}}, @function_called_always
+CHECK: %{{.*}} = icmp eq ptr %{{.*}}, @function_called_always
 
 # Check that the call to `function_called_always` was inlined, so that we
 # directly call `opaque_f1` from the upstream crate.
@@ -12,5 +12,5 @@ CHECK: call void @opaque_f1()
 # Same checks as above, repeated for the trait object case
 
 CHECK: define void @call_a_bunch_of_trait_methods({{.*}}
-CHECK: %{{.*}} = icmp eq {{void \(\{\}\*\)\*|ptr}} %{{.*}}, {{.*}}@foo
+CHECK: %{{.*}} = icmp eq ptr %{{.*}}, {{.*}}@foo
 CHECK: tail call void @opaque_f2()
diff --git a/tests/run-make/print-cfg/Makefile b/tests/run-make/print-cfg/Makefile
index 6b153e5b54e..654c303b3e2 100644
--- a/tests/run-make/print-cfg/Makefile
+++ b/tests/run-make/print-cfg/Makefile
@@ -13,19 +13,19 @@ all: default output_to_file
 
 output_to_file:
 	# Backend-independent, printed by rustc_driver_impl/src/lib.rs
-	$(RUSTC) --target x86_64-pc-windows-gnu --print cfg=$(TMPDIR)/cfg.txt
+	$(RUSTC) --target x86_64-pc-windows-gnu --print cfg=$(TMPDIR)/cfg.txt -Z unstable-options
 	$(CGREP) windows < $(TMPDIR)/cfg.txt
 
 	# Printed from CodegenBackend trait impl in rustc_codegen_llvm/src/lib.rs
-	$(RUSTC) --print relocation-models=$(TMPDIR)/relocation-models.txt
+	$(RUSTC) --print relocation-models=$(TMPDIR)/relocation-models.txt -Z unstable-options
 	$(CGREP) dynamic-no-pic < $(TMPDIR)/relocation-models.txt
 
 	# Printed by compiler/rustc_codegen_llvm/src/llvm_util.rs
-	$(RUSTC) --target wasm32-unknown-unknown --print target-features=$(TMPDIR)/target-features.txt
+	$(RUSTC) --target wasm32-unknown-unknown --print target-features=$(TMPDIR)/target-features.txt -Z unstable-options
 	$(CGREP) reference-types < $(TMPDIR)/target-features.txt
 
 	# Printed by C++ code in rustc_llvm/llvm-wrapper/PassWrapper.cpp
-	$(RUSTC) --target wasm32-unknown-unknown --print target-cpus=$(TMPDIR)/target-cpus.txt
+	$(RUSTC) --target wasm32-unknown-unknown --print target-cpus=$(TMPDIR)/target-cpus.txt -Z unstable-options
 	$(CGREP) generic < $(TMPDIR)/target-cpus.txt
 
 ifdef IS_WINDOWS
diff --git a/tests/run-make/short-ice/Makefile b/tests/run-make/short-ice/Makefile
index 4f33d590237..23006fc09e2 100644
--- a/tests/run-make/short-ice/Makefile
+++ b/tests/run-make/short-ice/Makefile
@@ -3,6 +3,7 @@ include ../tools.mk
 # ignore-windows
 
 export RUSTC := $(RUSTC_ORIGINAL)
+export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
 export TMPDIR := $(TMPDIR)
 
 all:
diff --git a/tests/rustdoc-gui/rust-logo.goml b/tests/rustdoc-gui/rust-logo.goml
index 640ed152b0d..cd453aea276 100644
--- a/tests/rustdoc-gui/rust-logo.goml
+++ b/tests/rustdoc-gui/rust-logo.goml
@@ -33,20 +33,20 @@ call-function: (
     "check-logo",
     {
         "theme": "ayu",
-        "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
+        "filter": "drop-shadow(#fff 1px 0px 0px) " +
+            "drop-shadow(#fff 0px 1px 0px) " +
+            "drop-shadow(#fff -1px 0px 0px) " +
+            "drop-shadow(#fff 0px -1px 0px)",
     },
 )
 call-function: (
     "check-logo",
     {
         "theme": "dark",
-        "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
-            "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
+        "filter": "drop-shadow(#fff 1px 0px 0px) " +
+            "drop-shadow(#fff 0px 1px 0px) " +
+            "drop-shadow(#fff -1px 0px 0px) " +
+            "drop-shadow(#fff 0px -1px 0px)",
     },
 )
 call-function: (
diff --git a/tests/rustdoc/alias-reexport.rs b/tests/rustdoc/alias-reexport.rs
index a2a8e651caf..4003ecec21c 100644
--- a/tests/rustdoc/alias-reexport.rs
+++ b/tests/rustdoc/alias-reexport.rs
@@ -3,6 +3,7 @@
 
 #![crate_name = "foo"]
 #![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
 
 extern crate alias_reexport2;
 
diff --git a/tests/rustdoc/alias-reexport2.rs b/tests/rustdoc/alias-reexport2.rs
index 85d3cdad962..5f6357ad128 100644
--- a/tests/rustdoc/alias-reexport2.rs
+++ b/tests/rustdoc/alias-reexport2.rs
@@ -3,6 +3,7 @@
 
 #![crate_name = "foo"]
 #![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
 
 extern crate alias_reexport;
 
diff --git a/tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs b/tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs
new file mode 100644
index 00000000000..eacec957a2a
--- /dev/null
+++ b/tests/rustdoc/auxiliary/jump-to-def-res-err-handling-aux.rs
@@ -0,0 +1 @@
+pub struct Ident;
diff --git a/tests/rustdoc/extern-impl-trait.rs b/tests/rustdoc/extern-impl-trait.rs
index 8ab026afd1b..4d8672305a7 100644
--- a/tests/rustdoc/extern-impl-trait.rs
+++ b/tests/rustdoc/extern-impl-trait.rs
@@ -7,5 +7,5 @@ extern crate extern_impl_trait;
 // @has 'foo/struct.X.html' '//h4[@class="code-header"]' "impl Foo<Associated = ()> + 'a"
 pub use extern_impl_trait::X;
 
-// @has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl ?Sized + Foo<Associated = ()> + 'a"
+// @has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl Foo<Associated = ()> + ?Sized + 'a"
 pub use extern_impl_trait::Y;
diff --git a/tests/rustdoc/generic-const-items.rs b/tests/rustdoc/generic-const-items.rs
new file mode 100644
index 00000000000..e2c6a027afa
--- /dev/null
+++ b/tests/rustdoc/generic-const-items.rs
@@ -0,0 +1,38 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// @has 'generic_const_items/constant.K.html'
+// @has - '//*[@class="rust item-decl"]//code' \
+// "pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> \
+// where \
+//     String: From<T>;"
+pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> = None
+where
+    String: From<T>;
+
+// @has generic_const_items/trait.Trait.html
+pub trait Trait<T: ?Sized> {
+    // @has - '//*[@id="associatedconstant.C"]' \
+    // "const C<'a>: &'a T \
+    // where \
+    //     T: 'a + Eq"
+    const C<'a>: &'a T
+    where
+        T: 'a + Eq;
+}
+
+pub struct Implementor;
+
+// @has generic_const_items/struct.Implementor.html
+// @has - '//h3[@class="code-header"]' 'impl Trait<str> for Implementor'
+impl Trait<str> for Implementor {
+    // @has - '//*[@id="associatedconstant.C"]' \
+    // "const C<'a>: &'a str = \"C\" \
+    // where \
+    //     str: 'a"
+    const C<'a>: &'a str = "C"
+    // In real code we could've left off this bound but adding it explicitly allows us to test if
+    // we render where-clauses on associated consts inside impl blocks correctly.
+    where
+        str: 'a;
+}
diff --git a/tests/rustdoc/impl-everywhere.rs b/tests/rustdoc/impl-everywhere.rs
index 44885d4301f..2311c806c18 100644
--- a/tests/rustdoc/impl-everywhere.rs
+++ b/tests/rustdoc/impl-everywhere.rs
@@ -25,6 +25,6 @@ pub fn foo_foo() -> impl Foo + Foo2 {
     Bar
 }
 
-// @has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x impl Foo + Foo2"
+// @has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x (impl Foo + Foo2)"
 pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) {
 }
diff --git a/tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs b/tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs
new file mode 100644
index 00000000000..0fc7a7aaea2
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/generic-const-items.rs
@@ -0,0 +1,22 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> = None
+where
+    String: From<T>;
+
+pub trait Trait<T: ?Sized> {
+    const C<'a>: &'a T
+    where
+        T: 'a + Eq;
+}
+
+pub struct Implementor;
+
+impl Trait<str> for Implementor {
+    const C<'a>: &'a str = "C"
+    // In real code we could've left off this bound but adding it explicitly allows us to test if
+    // we render where-clauses on associated consts inside impl blocks correctly.
+    where
+        str: 'a;
+}
diff --git a/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs b/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs
new file mode 100644
index 00000000000..65f72a3b9ac
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs
@@ -0,0 +1,21 @@
+use std::fmt::Debug;
+
+pub fn sized(x: impl Sized) -> impl Sized {
+    x
+}
+
+pub fn sized_outlives<'a>(x: impl Sized + 'a) -> impl Sized + 'a {
+    x
+}
+
+pub fn maybe_sized(x: &impl ?Sized) -> &impl ?Sized {
+    x
+}
+
+pub fn debug_maybe_sized(x: &(impl Debug + ?Sized)) -> &(impl Debug + ?Sized) {
+    x
+}
+
+pub fn maybe_sized_outlives<'t>(x: &(impl ?Sized + 't)) -> &(impl ?Sized + 't) {
+    x
+}
diff --git a/tests/rustdoc/inline_cross/generic-const-items.rs b/tests/rustdoc/inline_cross/generic-const-items.rs
new file mode 100644
index 00000000000..70cf7af888e
--- /dev/null
+++ b/tests/rustdoc/inline_cross/generic-const-items.rs
@@ -0,0 +1,26 @@
+#![crate_name = "user"]
+
+// aux-crate:generic_const_items=generic-const-items.rs
+// edition:2021
+
+// @has 'user/constant.K.html'
+// @has - '//*[@class="rust item-decl"]//code' \
+// "pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> \
+// where \
+//     String: From<T>;"
+pub use generic_const_items::K;
+
+// @has user/trait.Trait.html
+// @has - '//*[@id="associatedconstant.C"]' \
+// "const C<'a>: &'a T \
+// where \
+//     T: 'a + Eq"
+pub use generic_const_items::Trait;
+
+// @has user/struct.Implementor.html
+// @has - '//h3[@class="code-header"]' 'impl Trait<str> for Implementor'
+// @has - '//*[@id="associatedconstant.C"]' \
+// "const C<'a>: &'a str = \"C\" \
+// where \
+//     str: 'a"
+pub use generic_const_items::Implementor;
diff --git a/tests/rustdoc/inline_cross/impl-sized.rs b/tests/rustdoc/inline_cross/impl-sized.rs
new file mode 100644
index 00000000000..82bdce47478
--- /dev/null
+++ b/tests/rustdoc/inline_cross/impl-sized.rs
@@ -0,0 +1,27 @@
+#![crate_name = "user"]
+
+// aux-crate:impl_sized=impl-sized.rs
+// edition:2021
+
+// @has user/fn.sized.html
+// @has - '//pre[@class="rust item-decl"]' "sized(x: impl Sized) -> impl Sized"
+pub use impl_sized::sized;
+
+// @has user/fn.sized_outlives.html
+// @has - '//pre[@class="rust item-decl"]' \
+//     "sized_outlives<'a>(x: impl Sized + 'a) -> impl Sized + 'a"
+pub use impl_sized::sized_outlives;
+
+// @has user/fn.maybe_sized.html
+// @has - '//pre[@class="rust item-decl"]' "maybe_sized(x: &impl ?Sized) -> &impl ?Sized"
+pub use impl_sized::maybe_sized;
+
+// @has user/fn.debug_maybe_sized.html
+// @has - '//pre[@class="rust item-decl"]' \
+//     "debug_maybe_sized(x: &(impl Debug + ?Sized)) -> &(impl Debug + ?Sized)"
+pub use impl_sized::debug_maybe_sized;
+
+// @has user/fn.maybe_sized_outlives.html
+// @has - '//pre[@class="rust item-decl"]' \
+//     "maybe_sized_outlives<'t>(x: &(impl ?Sized + 't)) -> &(impl ?Sized + 't)"
+pub use impl_sized::maybe_sized_outlives;
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs
new file mode 100644
index 00000000000..4e9d188bbf8
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api-2.rs
@@ -0,0 +1,13 @@
+// edition:2015
+
+#![crate_name = "foo"]
+
+use external::Public as Private;
+
+pub mod external {
+    pub struct Public;
+
+    // @has 'foo/external/fn.make.html'
+    // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public'
+    pub fn make() -> ::Private { super::Private }
+}
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api-generics.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api-generics.rs
new file mode 100644
index 00000000000..7e289508628
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api-generics.rs
@@ -0,0 +1,13 @@
+#![crate_name = "foo"]
+
+use crate::bar::Foo as Alias;
+
+pub mod bar {
+    pub struct Foo<'a, T>(&'a T);
+}
+
+// @has "foo/fn.foo.html"
+// @has - '//*[@class="rust item-decl"]/code' "pub fn foo<'a, T>(f: Foo<'a, T>) -> Foo<'a, usize>"
+pub fn foo<'a, T>(f: Alias<'a, T>) -> Alias<'a, usize> {
+    Alias(&0)
+}
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api-hidden.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api-hidden.rs
new file mode 100644
index 00000000000..5053a328bad
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api-hidden.rs
@@ -0,0 +1,16 @@
+// compile-flags: -Z unstable-options --document-hidden-items
+
+#![crate_name = "foo"]
+
+#[doc(hidden)]
+pub use crate::bar::Bar as Alias;
+
+mod bar {
+    pub struct Bar;
+}
+
+// @has 'foo/fn.bar.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Alias'
+pub fn bar() -> Alias {
+    Alias
+}
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api-private.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api-private.rs
new file mode 100644
index 00000000000..15749674a3d
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api-private.rs
@@ -0,0 +1,32 @@
+// compile-flags: --document-private-items
+
+#![crate_name = "foo"]
+
+use crate::bar::Bar as Alias;
+pub(crate) use crate::bar::Bar as CrateAlias;
+
+mod bar {
+    pub struct Bar;
+    pub use self::Bar as Inner;
+}
+
+// It's a fully private re-export so it should not be displayed.
+// @has 'foo/fn.bar.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar'
+pub fn bar() -> Alias {
+    Alias
+}
+
+// It's public re-export inside a private module so it should be visible.
+// @has 'foo/fn.bar2.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Inner'
+pub fn bar2() -> crate::bar::Inner {
+    Alias
+}
+
+// It's a non-public, so it doesn't appear in documentation so it should not be visible.
+// @has 'foo/fn.bar3.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Bar'
+pub fn bar3() -> CrateAlias {
+    Alias
+}
diff --git a/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs b/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs
new file mode 100644
index 00000000000..bd54d02c6ec
--- /dev/null
+++ b/tests/rustdoc/issue-81141-private-reexport-in-public-api.rs
@@ -0,0 +1,124 @@
+// This test ensures that if a private re-export is present in a public API, it'll be
+// replaced by the first public item in the re-export chain or by the private item.
+
+#![crate_name = "foo"]
+
+use crate::bar::Bar as Alias;
+
+pub use crate::bar::Bar as Whatever;
+use crate::Whatever as Whatever2;
+use crate::Whatever2 as Whatever3;
+pub use crate::bar::Inner as Whatever4;
+
+mod bar {
+    pub struct Bar;
+    pub use self::Bar as Inner;
+}
+
+// @has 'foo/fn.bar.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar'
+pub fn bar() -> Alias {
+    Alias
+}
+
+// @has 'foo/fn.bar2.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Whatever'
+pub fn bar2() -> Whatever3 {
+    Whatever
+}
+
+// @has 'foo/fn.bar3.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Whatever4'
+pub fn bar3() -> Whatever4 {
+    Whatever
+}
+
+// @has 'foo/fn.bar4.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar4() -> Bar'
+pub fn bar4() -> crate::Alias {
+    Alias
+}
+
+// @has 'foo/fn.bar5.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar5() -> Whatever'
+pub fn bar5() -> crate::Whatever3 {
+    Whatever
+}
+
+// @has 'foo/fn.bar6.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar6() -> Whatever4'
+pub fn bar6() -> crate::Whatever4 {
+    Whatever
+}
+
+
+// @has 'foo/fn.bar7.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar7() -> Bar'
+pub fn bar7() -> self::Alias {
+    Alias
+}
+
+// @has 'foo/fn.bar8.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar8() -> Whatever'
+pub fn bar8() -> self::Whatever3 {
+    Whatever
+}
+
+// @has 'foo/fn.bar9.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar9() -> Whatever4'
+pub fn bar9() -> self::Whatever4 {
+    Whatever
+}
+
+mod nested {
+    pub(crate) use crate::Alias;
+    pub(crate) use crate::Whatever3;
+    pub(crate) use crate::Whatever4;
+    pub(crate) use crate::nested as nested2;
+}
+
+// @has 'foo/fn.bar10.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar10() -> Bar'
+pub fn bar10() -> nested::Alias {
+    Alias
+}
+
+// @has 'foo/fn.bar11.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar11() -> Whatever'
+pub fn bar11() -> nested::Whatever3 {
+    Whatever
+}
+
+// @has 'foo/fn.bar12.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar12() -> Whatever4'
+pub fn bar12() -> nested::Whatever4 {
+    Whatever
+}
+
+// @has 'foo/fn.bar13.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar13() -> Bar'
+pub fn bar13() -> nested::nested2::Alias {
+    Alias
+}
+
+// @has 'foo/fn.bar14.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar14() -> Whatever'
+pub fn bar14() -> nested::nested2::Whatever3 {
+    Whatever
+}
+
+// @has 'foo/fn.bar15.html'
+// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar15() -> Whatever4'
+pub fn bar15() -> nested::nested2::Whatever4 {
+    Whatever
+}
+
+use external::Public as Private;
+
+pub mod external {
+    pub struct Public;
+
+    // @has 'foo/external/fn.make.html'
+    // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public'
+    pub fn make() -> super::Private { super::Private }
+}
diff --git a/tests/rustdoc/private-use.rs b/tests/rustdoc/private-use.rs
new file mode 100644
index 00000000000..689ed73140d
--- /dev/null
+++ b/tests/rustdoc/private-use.rs
@@ -0,0 +1,13 @@
+// Regression test for <https://github.com/rust-lang/rust/pull/113374> to
+// ensure it doesn't panic.
+
+mod generics {
+    pub enum WherePredicate {
+        EqPredicate,
+    }
+}
+pub mod visit {
+    use *;
+    pub fn visit_where_predicate<V>(_visitor: &mut V, _i: &WherePredicate) {}
+}
+pub use generics::*;
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index ffbefce48d3..c30120e5cf3 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -53,7 +53,7 @@ enum DiagnosticOnEnum {
 #[derive(Diagnostic)]
 #[diag(no_crate_example, code = "E0123")]
 #[diag = "E0123"]
-//~^ ERROR expected parentheses: #[diag(...)]
+//~^ ERROR failed to resolve: maybe a missing crate `core`
 struct WrongStructAttrStyle {}
 
 #[derive(Diagnostic)]
@@ -644,7 +644,7 @@ struct MissingCodeInSuggestion {
 //~| ERROR cannot find attribute `multipart_suggestion` in this scope
 #[multipart_suggestion()]
 //~^ ERROR cannot find attribute `multipart_suggestion` in this scope
-//~| ERROR unexpected end of input, unexpected token in nested attribute, expected ident
+//~| ERROR `#[multipart_suggestion(...)]` is not a valid attribute
 struct MultipartSuggestion {
     #[multipart_suggestion(no_crate_suggestion)]
     //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
@@ -797,7 +797,7 @@ struct SuggestionsNoItem {
 struct SuggestionsInvalidItem {
     #[suggestion(code(foo))]
     //~^ ERROR `code(...)` must contain only string literals
-    //~| ERROR unexpected token
+    //~| ERROR failed to resolve: maybe a missing crate `core`
     sub: Span,
 }
 
@@ -805,7 +805,7 @@ struct SuggestionsInvalidItem {
 #[diag(no_crate_example)]
 struct SuggestionsInvalidLiteral {
     #[suggestion(code = 3)]
-    //~^ ERROR expected string literal
+    //~^ ERROR failed to resolve: maybe a missing crate `core`
     sub: Span,
 }
 
diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index 1398f9c96bf..ca09f1f0153 100644
--- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -20,12 +20,6 @@ LL |     Bar,
    |
    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
 
-error: expected parentheses: #[diag(...)]
-  --> $DIR/diagnostic-derive.rs:55:8
-   |
-LL | #[diag = "E0123"]
-   |        ^
-
 error: `#[nonsense(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:60:1
    |
@@ -477,6 +471,14 @@ LL | #[multipart_suggestion(no_crate_suggestion)]
    = help: consider creating a `Subdiagnostic` instead
 
 error: `#[multipart_suggestion(...)]` is not a valid attribute
+  --> $DIR/diagnostic-derive.rs:645:1
+   |
+LL | #[multipart_suggestion()]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: consider creating a `Subdiagnostic` instead
+
+error: `#[multipart_suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:649:5
    |
 LL |     #[multipart_suggestion(no_crate_suggestion)]
@@ -484,12 +486,6 @@ LL |     #[multipart_suggestion(no_crate_suggestion)]
    |
    = help: consider creating a `Subdiagnostic` instead
 
-error: unexpected end of input, unexpected token in nested attribute, expected ident
-  --> $DIR/diagnostic-derive.rs:645:24
-   |
-LL | #[multipart_suggestion()]
-   |                        ^
-
 error: `#[suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:657:1
    |
@@ -550,18 +546,6 @@ error: `code(...)` must contain only string literals
 LL |     #[suggestion(code(foo))]
    |                       ^^^
 
-error: unexpected token
-  --> $DIR/diagnostic-derive.rs:798:23
-   |
-LL |     #[suggestion(code(foo))]
-   |                       ^^^
-
-error: expected string literal
-  --> $DIR/diagnostic-derive.rs:807:25
-   |
-LL |     #[suggestion(code = 3)]
-   |                         ^
-
 error: `#[suggestion(...)]` is not a valid attribute
   --> $DIR/diagnostic-derive.rs:822:5
    |
@@ -572,6 +556,24 @@ LL |     #[suggestion(no_crate_suggestion, code = "")]
    = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
    = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
 
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/diagnostic-derive.rs:55:8
+   |
+LL | #[diag = "E0123"]
+   |        ^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/diagnostic-derive.rs:798:23
+   |
+LL |     #[suggestion(code(foo))]
+   |                       ^^^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/diagnostic-derive.rs:807:25
+   |
+LL |     #[suggestion(code = 3)]
+   |                         ^ maybe a missing crate `core`?
+
 error: cannot find attribute `nonsense` in this scope
   --> $DIR/diagnostic-derive.rs:60:3
    |
@@ -656,5 +658,5 @@ note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
 
 error: aborting due to 84 previous errors
 
-Some errors have detailed explanations: E0277, E0425.
+Some errors have detailed explanations: E0277, E0425, E0433.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index 38af5b0f9fb..dd0f7a7efb7 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -95,7 +95,8 @@ struct G {
 
 #[derive(Subdiagnostic)]
 #[label("...")]
-//~^ ERROR unexpected literal in nested attribute, expected ident
+//~^ ERROR failed to resolve: maybe a missing crate `core`?
+//~| NOTE maybe a missing crate `core`?
 struct H {
     #[primary_span]
     span: Span,
@@ -134,7 +135,7 @@ struct L {
 
 #[derive(Subdiagnostic)]
 #[label()]
-//~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
+//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
 struct M {
     #[primary_span]
     span: Span,
@@ -310,7 +311,8 @@ struct AB {
 
 #[derive(Subdiagnostic)]
 union AC {
-    //~^ ERROR unexpected unsupported untagged union
+    //~^ ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span: u32,
     b: u64,
 }
@@ -556,7 +558,7 @@ struct BBb {
 #[multipart_suggestion(no_crate_example, applicability = "machine-applicable")]
 struct BBc {
     #[suggestion_part()]
-    //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
+    //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
     span1: Span,
 }
 
@@ -576,11 +578,12 @@ struct BD {
     //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
     span1: Span,
     #[suggestion_part()]
-    //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
+    //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
     span2: Span,
     #[suggestion_part(foo = "bar")]
     //~^ ERROR `code` is the only valid nested attribute
-    //~| ERROR expected `,`
+    //~| ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span4: Span,
     #[suggestion_part(code = "...")]
     //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -672,7 +675,8 @@ enum BL {
 struct BM {
     #[suggestion_part(code("foo"))]
     //~^ ERROR expected exactly one string literal for `code = ...`
-    //~| ERROR unexpected token
+    //~| ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span: Span,
     r#type: String,
 }
@@ -682,7 +686,8 @@ struct BM {
 struct BN {
     #[suggestion_part(code("foo", "bar"))]
     //~^ ERROR expected exactly one string literal for `code = ...`
-    //~| ERROR unexpected token
+    //~| ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span: Span,
     r#type: String,
 }
@@ -692,7 +697,8 @@ struct BN {
 struct BO {
     #[suggestion_part(code(3))]
     //~^ ERROR expected exactly one string literal for `code = ...`
-    //~| ERROR unexpected token
+    //~| ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span: Span,
     r#type: String,
 }
@@ -713,7 +719,8 @@ struct BP {
 #[multipart_suggestion(no_crate_example)]
 struct BQ {
     #[suggestion_part(code = 3)]
-    //~^ ERROR expected string literal
+    //~^ ERROR failed to resolve: maybe a missing crate `core`?
+    //~| NOTE maybe a missing crate `core`?
     span: Span,
     r#type: String,
 }
@@ -805,7 +812,8 @@ struct SuggestionStyleInvalid3 {
 #[derive(Subdiagnostic)]
 #[suggestion(no_crate_example, code = "", style("foo"))]
 //~^ ERROR expected `= "xxx"`
-//~| ERROr expected `,`
+//~| ERROR failed to resolve: maybe a missing crate `core`?
+//~| NOTE maybe a missing crate `core`?
 struct SuggestionStyleInvalid4 {
     #[primary_span]
     sub: Span,
diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index 5ddc8edd745..1f267aceb9e 100644
--- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -38,104 +38,98 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
 LL | #[label(bug = "...")]
    | ^^^^^^^^^^^^^^^^^^^^^
 
-error: unexpected literal in nested attribute, expected ident
-  --> $DIR/subdiagnostic-derive.rs:97:9
-   |
-LL | #[label("...")]
-   |         ^^^^^
-
 error: only `no_span` is a valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:106:9
+  --> $DIR/subdiagnostic-derive.rs:107:9
    |
 LL | #[label(slug = 4)]
    |         ^^^^
 
 error: diagnostic slug must be first argument of a `#[label(...)]` attribute
-  --> $DIR/subdiagnostic-derive.rs:106:1
+  --> $DIR/subdiagnostic-derive.rs:107:1
    |
 LL | #[label(slug = 4)]
    | ^^^^^^^^^^^^^^^^^^
 
 error: only `no_span` is a valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:116:9
+  --> $DIR/subdiagnostic-derive.rs:117:9
    |
 LL | #[label(slug("..."))]
    |         ^^^^
 
 error: diagnostic slug must be first argument of a `#[label(...)]` attribute
-  --> $DIR/subdiagnostic-derive.rs:116:1
+  --> $DIR/subdiagnostic-derive.rs:117:1
    |
 LL | #[label(slug("..."))]
    | ^^^^^^^^^^^^^^^^^^^^^
 
-error: unexpected end of input, unexpected token in nested attribute, expected ident
-  --> $DIR/subdiagnostic-derive.rs:136:9
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
+  --> $DIR/subdiagnostic-derive.rs:137:1
    |
 LL | #[label()]
-   |         ^
+   | ^^^^^^^^^^
 
 error: only `no_span` is a valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:145:27
+  --> $DIR/subdiagnostic-derive.rs:146:27
    |
 LL | #[label(no_crate_example, code = "...")]
    |                           ^^^^
 
 error: only `no_span` is a valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:154:27
+  --> $DIR/subdiagnostic-derive.rs:155:27
    |
 LL | #[label(no_crate_example, applicability = "machine-applicable")]
    |                           ^^^^^^^^^^^^^
 
 error: unsupported type attribute for subdiagnostic enum
-  --> $DIR/subdiagnostic-derive.rs:163:1
+  --> $DIR/subdiagnostic-derive.rs:164:1
    |
 LL | #[foo]
    | ^^^^^^
 
 error: `#[bar]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:177:5
+  --> $DIR/subdiagnostic-derive.rs:178:5
    |
 LL |     #[bar]
    |     ^^^^^^
 
 error: `#[bar = ...]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:189:5
+  --> $DIR/subdiagnostic-derive.rs:190:5
    |
 LL |     #[bar = "..."]
    |     ^^^^^^^^^^^^^^
 
 error: `#[bar = ...]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:201:5
+  --> $DIR/subdiagnostic-derive.rs:202:5
    |
 LL |     #[bar = 4]
    |     ^^^^^^^^^^
 
 error: `#[bar(...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:213:5
+  --> $DIR/subdiagnostic-derive.rs:214:5
    |
 LL |     #[bar("...")]
    |     ^^^^^^^^^^^^^
 
 error: only `no_span` is a valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:225:13
+  --> $DIR/subdiagnostic-derive.rs:226:13
    |
 LL |     #[label(code = "...")]
    |             ^^^^
 
 error: diagnostic slug must be first argument of a `#[label(...)]` attribute
-  --> $DIR/subdiagnostic-derive.rs:225:5
+  --> $DIR/subdiagnostic-derive.rs:226:5
    |
 LL |     #[label(code = "...")]
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
-  --> $DIR/subdiagnostic-derive.rs:254:5
+  --> $DIR/subdiagnostic-derive.rs:255:5
    |
 LL |     #[primary_span]
    |     ^^^^^^^^^^^^^^^
 
 error: label without `#[primary_span]` field
-  --> $DIR/subdiagnostic-derive.rs:251:1
+  --> $DIR/subdiagnostic-derive.rs:252:1
    |
 LL | / #[label(no_crate_example)]
 LL | |
@@ -147,13 +141,13 @@ LL | | }
    | |_^
 
 error: `#[applicability]` is only valid on suggestions
-  --> $DIR/subdiagnostic-derive.rs:264:5
+  --> $DIR/subdiagnostic-derive.rs:265:5
    |
 LL |     #[applicability]
    |     ^^^^^^^^^^^^^^^^
 
 error: `#[bar]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:274:5
+  --> $DIR/subdiagnostic-derive.rs:275:5
    |
 LL |     #[bar]
    |     ^^^^^^
@@ -161,97 +155,87 @@ LL |     #[bar]
    = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
 
 error: `#[bar = ...]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:285:5
+  --> $DIR/subdiagnostic-derive.rs:286:5
    |
 LL |     #[bar = "..."]
    |     ^^^^^^^^^^^^^^
 
 error: `#[bar(...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:296:5
+  --> $DIR/subdiagnostic-derive.rs:297:5
    |
 LL |     #[bar("...")]
    |     ^^^^^^^^^^^^^
    |
    = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
 
-error: unexpected unsupported untagged union
-  --> $DIR/subdiagnostic-derive.rs:312:1
-   |
-LL | / union AC {
-LL | |
-LL | |     span: u32,
-LL | |     b: u64,
-LL | | }
-   | |_^
-
 error: a diagnostic slug must be the first argument to the attribute
-  --> $DIR/subdiagnostic-derive.rs:327:44
+  --> $DIR/subdiagnostic-derive.rs:329:44
    |
 LL | #[label(no_crate_example, no_crate::example)]
    |                                            ^
 
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:340:5
+  --> $DIR/subdiagnostic-derive.rs:342:5
    |
 LL |     #[primary_span]
    |     ^^^^^^^^^^^^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:337:5
+  --> $DIR/subdiagnostic-derive.rs:339:5
    |
 LL |     #[primary_span]
    |     ^^^^^^^^^^^^^^^
 
 error: subdiagnostic kind not specified
-  --> $DIR/subdiagnostic-derive.rs:346:8
+  --> $DIR/subdiagnostic-derive.rs:348:8
    |
 LL | struct AG {
    |        ^^
 
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:383:46
+  --> $DIR/subdiagnostic-derive.rs:385:46
    |
 LL | #[suggestion(no_crate_example, code = "...", code = "...")]
    |                                              ^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:383:32
+  --> $DIR/subdiagnostic-derive.rs:385:32
    |
 LL | #[suggestion(no_crate_example, code = "...", code = "...")]
    |                                ^^^^
 
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:401:5
+  --> $DIR/subdiagnostic-derive.rs:403:5
    |
 LL |     #[applicability]
    |     ^^^^^^^^^^^^^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:398:5
+  --> $DIR/subdiagnostic-derive.rs:400:5
    |
 LL |     #[applicability]
    |     ^^^^^^^^^^^^^^^^
 
 error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
-  --> $DIR/subdiagnostic-derive.rs:411:5
+  --> $DIR/subdiagnostic-derive.rs:413:5
    |
 LL |     #[applicability]
    |     ^^^^^^^^^^^^^^^^
 
 error: suggestion without `code = "..."`
-  --> $DIR/subdiagnostic-derive.rs:424:1
+  --> $DIR/subdiagnostic-derive.rs:426:1
    |
 LL | #[suggestion(no_crate_example)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: invalid applicability
-  --> $DIR/subdiagnostic-derive.rs:434:62
+  --> $DIR/subdiagnostic-derive.rs:436:62
    |
 LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
    |                                                              ^^^^^
 
 error: suggestion without `#[primary_span]` field
-  --> $DIR/subdiagnostic-derive.rs:452:1
+  --> $DIR/subdiagnostic-derive.rs:454:1
    |
 LL | / #[suggestion(no_crate_example, code = "...")]
 LL | |
@@ -261,25 +245,25 @@ LL | | }
    | |_^
 
 error: unsupported type attribute for subdiagnostic enum
-  --> $DIR/subdiagnostic-derive.rs:466:1
+  --> $DIR/subdiagnostic-derive.rs:468:1
    |
 LL | #[label]
    | ^^^^^^^^
 
 error: `var` doesn't refer to a field on this type
-  --> $DIR/subdiagnostic-derive.rs:486:39
+  --> $DIR/subdiagnostic-derive.rs:488:39
    |
 LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
    |                                       ^^^^^^^
 
 error: `var` doesn't refer to a field on this type
-  --> $DIR/subdiagnostic-derive.rs:505:43
+  --> $DIR/subdiagnostic-derive.rs:507:43
    |
 LL |     #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
    |                                           ^^^^^^^
 
 error: `#[suggestion_part]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:528:5
+  --> $DIR/subdiagnostic-derive.rs:530:5
    |
 LL |     #[suggestion_part]
    |     ^^^^^^^^^^^^^^^^^^
@@ -287,7 +271,7 @@ LL |     #[suggestion_part]
    = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
 
 error: `#[suggestion_part(...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:531:5
+  --> $DIR/subdiagnostic-derive.rs:533:5
    |
 LL |     #[suggestion_part(code = "...")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -295,7 +279,7 @@ LL |     #[suggestion_part(code = "...")]
    = help: `#[suggestion_part(...)]` is only valid in multipart suggestions
 
 error: suggestion without `#[primary_span]` field
-  --> $DIR/subdiagnostic-derive.rs:525:1
+  --> $DIR/subdiagnostic-derive.rs:527:1
    |
 LL | / #[suggestion(no_crate_example, code = "...")]
 LL | |
@@ -307,7 +291,7 @@ LL | | }
    | |_^
 
 error: invalid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:540:42
+  --> $DIR/subdiagnostic-derive.rs:542:42
    |
 LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
    |                                          ^^^^
@@ -315,7 +299,7 @@ LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "mac
    = help: only `no_span`, `style` and `applicability` are valid nested attributes
 
 error: multipart suggestion without any `#[suggestion_part(...)]` fields
-  --> $DIR/subdiagnostic-derive.rs:540:1
+  --> $DIR/subdiagnostic-derive.rs:542:1
    |
 LL | / #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
 LL | |
@@ -326,19 +310,19 @@ LL | | }
    | |_^
 
 error: `#[suggestion_part(...)]` attribute without `code = "..."`
-  --> $DIR/subdiagnostic-derive.rs:550:5
+  --> $DIR/subdiagnostic-derive.rs:552:5
    |
 LL |     #[suggestion_part]
    |     ^^^^^^^^^^^^^^^^^^
 
-error: unexpected end of input, unexpected token in nested attribute, expected ident
-  --> $DIR/subdiagnostic-derive.rs:558:23
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+  --> $DIR/subdiagnostic-derive.rs:560:5
    |
 LL |     #[suggestion_part()]
-   |                       ^
+   |     ^^^^^^^^^^^^^^^^^^^^
 
 error: `#[primary_span]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:567:5
+  --> $DIR/subdiagnostic-derive.rs:569:5
    |
 LL |     #[primary_span]
    |     ^^^^^^^^^^^^^^^
@@ -346,7 +330,7 @@ LL |     #[primary_span]
    = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
 
 error: multipart suggestion without any `#[suggestion_part(...)]` fields
-  --> $DIR/subdiagnostic-derive.rs:564:1
+  --> $DIR/subdiagnostic-derive.rs:566:1
    |
 LL | / #[multipart_suggestion(no_crate_example)]
 LL | |
@@ -358,121 +342,91 @@ LL | | }
    | |_^
 
 error: `#[suggestion_part(...)]` attribute without `code = "..."`
-  --> $DIR/subdiagnostic-derive.rs:575:5
+  --> $DIR/subdiagnostic-derive.rs:577:5
    |
 LL |     #[suggestion_part]
    |     ^^^^^^^^^^^^^^^^^^
 
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+  --> $DIR/subdiagnostic-derive.rs:580:5
+   |
+LL |     #[suggestion_part()]
+   |     ^^^^^^^^^^^^^^^^^^^^
+
 error: `code` is the only valid nested attribute
-  --> $DIR/subdiagnostic-derive.rs:581:23
+  --> $DIR/subdiagnostic-derive.rs:583:23
    |
 LL |     #[suggestion_part(foo = "bar")]
    |                       ^^^
 
 error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
-  --> $DIR/subdiagnostic-derive.rs:585:5
+  --> $DIR/subdiagnostic-derive.rs:588:5
    |
 LL |     #[suggestion_part(code = "...")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
-  --> $DIR/subdiagnostic-derive.rs:588:5
+  --> $DIR/subdiagnostic-derive.rs:591:5
    |
 LL |     #[suggestion_part()]
    |     ^^^^^^^^^^^^^^^^^^^^
 
-error: unexpected end of input, unexpected token in nested attribute, expected ident
-  --> $DIR/subdiagnostic-derive.rs:578:23
-   |
-LL |     #[suggestion_part()]
-   |                       ^
-
-error: expected `,`
-  --> $DIR/subdiagnostic-derive.rs:581:27
-   |
-LL |     #[suggestion_part(foo = "bar")]
-   |                           ^
-
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:596:37
+  --> $DIR/subdiagnostic-derive.rs:599:37
    |
 LL |     #[suggestion_part(code = "...", code = ",,,")]
    |                                     ^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:596:23
+  --> $DIR/subdiagnostic-derive.rs:599:23
    |
 LL |     #[suggestion_part(code = "...", code = ",,,")]
    |                       ^^^^
 
 error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
-  --> $DIR/subdiagnostic-derive.rs:625:5
+  --> $DIR/subdiagnostic-derive.rs:628:5
    |
 LL |     #[applicability]
    |     ^^^^^^^^^^^^^^^^
 
 error: expected exactly one string literal for `code = ...`
-  --> $DIR/subdiagnostic-derive.rs:673:34
+  --> $DIR/subdiagnostic-derive.rs:676:34
    |
 LL |     #[suggestion_part(code("foo"))]
    |                                  ^
 
-error: unexpected token
-  --> $DIR/subdiagnostic-derive.rs:673:28
-   |
-LL |     #[suggestion_part(code("foo"))]
-   |                            ^^^^^
-
 error: expected exactly one string literal for `code = ...`
-  --> $DIR/subdiagnostic-derive.rs:683:41
+  --> $DIR/subdiagnostic-derive.rs:687:41
    |
 LL |     #[suggestion_part(code("foo", "bar"))]
    |                                         ^
 
-error: unexpected token
-  --> $DIR/subdiagnostic-derive.rs:683:28
-   |
-LL |     #[suggestion_part(code("foo", "bar"))]
-   |                            ^^^^^
-
 error: expected exactly one string literal for `code = ...`
-  --> $DIR/subdiagnostic-derive.rs:693:30
+  --> $DIR/subdiagnostic-derive.rs:698:30
    |
 LL |     #[suggestion_part(code(3))]
    |                              ^
 
-error: unexpected token
-  --> $DIR/subdiagnostic-derive.rs:693:28
-   |
-LL |     #[suggestion_part(code(3))]
-   |                            ^
-
 error: expected exactly one string literal for `code = ...`
-  --> $DIR/subdiagnostic-derive.rs:703:29
+  --> $DIR/subdiagnostic-derive.rs:709:29
    |
 LL |     #[suggestion_part(code())]
    |                             ^
 
-error: expected string literal
-  --> $DIR/subdiagnostic-derive.rs:715:30
-   |
-LL |     #[suggestion_part(code = 3)]
-   |                              ^
-
 error: specified multiple times
-  --> $DIR/subdiagnostic-derive.rs:757:1
+  --> $DIR/subdiagnostic-derive.rs:764:1
    |
 LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: previously specified here
-  --> $DIR/subdiagnostic-derive.rs:757:1
+  --> $DIR/subdiagnostic-derive.rs:764:1
    |
 LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `#[suggestion_hidden(...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:766:1
+  --> $DIR/subdiagnostic-derive.rs:773:1
    |
 LL | #[suggestion_hidden(no_crate_example, code = "")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -480,7 +434,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "")]
    = help: Use `#[suggestion(..., style = "hidden")]` instead
 
 error: `#[suggestion_hidden(...)]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:774:1
+  --> $DIR/subdiagnostic-derive.rs:781:1
    |
 LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -488,7 +442,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
    = help: Use `#[suggestion(..., style = "hidden")]` instead
 
 error: invalid suggestion style
-  --> $DIR/subdiagnostic-derive.rs:782:51
+  --> $DIR/subdiagnostic-derive.rs:789:51
    |
 LL | #[suggestion(no_crate_example, code = "", style = "foo")]
    |                                                   ^^^^^
@@ -496,31 +450,25 @@ LL | #[suggestion(no_crate_example, code = "", style = "foo")]
    = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
 
 error: expected `= "xxx"`
-  --> $DIR/subdiagnostic-derive.rs:790:49
+  --> $DIR/subdiagnostic-derive.rs:797:49
    |
 LL | #[suggestion(no_crate_example, code = "", style = 42)]
    |                                                 ^
 
 error: a diagnostic slug must be the first argument to the attribute
-  --> $DIR/subdiagnostic-derive.rs:798:48
+  --> $DIR/subdiagnostic-derive.rs:805:48
    |
 LL | #[suggestion(no_crate_example, code = "", style)]
    |                                                ^
 
 error: expected `= "xxx"`
-  --> $DIR/subdiagnostic-derive.rs:806:48
-   |
-LL | #[suggestion(no_crate_example, code = "", style("foo"))]
-   |                                                ^
-
-error: expected `,`
-  --> $DIR/subdiagnostic-derive.rs:806:48
+  --> $DIR/subdiagnostic-derive.rs:813:48
    |
 LL | #[suggestion(no_crate_example, code = "", style("foo"))]
    |                                                ^
 
 error: `#[primary_span]` is not a valid attribute
-  --> $DIR/subdiagnostic-derive.rs:818:5
+  --> $DIR/subdiagnostic-derive.rs:826:5
    |
 LL |     #[primary_span]
    |     ^^^^^^^^^^^^^^^
@@ -529,7 +477,7 @@ LL |     #[primary_span]
    = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
 
 error: suggestion without `#[primary_span]` field
-  --> $DIR/subdiagnostic-derive.rs:815:1
+  --> $DIR/subdiagnostic-derive.rs:823:1
    |
 LL | / #[suggestion(no_crate_example, code = "")]
 LL | |
@@ -540,6 +488,54 @@ LL | |     sub: Vec<Span>,
 LL | | }
    | |_^
 
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:97:9
+   |
+LL | #[label("...")]
+   |         ^^^^^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:313:1
+   |
+LL | union AC {
+   | ^^^^^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:583:27
+   |
+LL |     #[suggestion_part(foo = "bar")]
+   |                           ^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:676:28
+   |
+LL |     #[suggestion_part(code("foo"))]
+   |                            ^^^^^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:687:28
+   |
+LL |     #[suggestion_part(code("foo", "bar"))]
+   |                            ^^^^^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:698:28
+   |
+LL |     #[suggestion_part(code(3))]
+   |                            ^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:721:30
+   |
+LL |     #[suggestion_part(code = 3)]
+   |                              ^ maybe a missing crate `core`?
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+  --> $DIR/subdiagnostic-derive.rs:813:48
+   |
+LL | #[suggestion(no_crate_example, code = "", style("foo"))]
+   |                                                ^ maybe a missing crate `core`?
+
 error: cannot find attribute `foo` in this scope
   --> $DIR/subdiagnostic-derive.rs:68:3
    |
@@ -547,61 +543,61 @@ LL | #[foo]
    |   ^^^
 
 error: cannot find attribute `foo` in this scope
-  --> $DIR/subdiagnostic-derive.rs:163:3
+  --> $DIR/subdiagnostic-derive.rs:164:3
    |
 LL | #[foo]
    |   ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:177:7
+  --> $DIR/subdiagnostic-derive.rs:178:7
    |
 LL |     #[bar]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:189:7
+  --> $DIR/subdiagnostic-derive.rs:190:7
    |
 LL |     #[bar = "..."]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:201:7
+  --> $DIR/subdiagnostic-derive.rs:202:7
    |
 LL |     #[bar = 4]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:213:7
+  --> $DIR/subdiagnostic-derive.rs:214:7
    |
 LL |     #[bar("...")]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:274:7
+  --> $DIR/subdiagnostic-derive.rs:275:7
    |
 LL |     #[bar]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:285:7
+  --> $DIR/subdiagnostic-derive.rs:286:7
    |
 LL |     #[bar = "..."]
    |       ^^^
 
 error: cannot find attribute `bar` in this scope
-  --> $DIR/subdiagnostic-derive.rs:296:7
+  --> $DIR/subdiagnostic-derive.rs:297:7
    |
 LL |     #[bar("...")]
    |       ^^^
 
 error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
-  --> $DIR/subdiagnostic-derive.rs:126:9
+  --> $DIR/subdiagnostic-derive.rs:127:9
    |
 LL | #[label(slug)]
    |         ^^^^ not found in `crate::fluent_generated`
 
 error[E0425]: cannot find value `__code_29` in this scope
-  --> $DIR/subdiagnostic-derive.rs:709:10
+  --> $DIR/subdiagnostic-derive.rs:715:10
    |
 LL | #[derive(Subdiagnostic)]
    |          ^^^^^^^^^^^^^ not found in this scope
@@ -610,4 +606,5 @@ LL | #[derive(Subdiagnostic)]
 
 error: aborting due to 86 previous errors
 
-For more information about this error, try `rustc --explain E0425`.
+Some errors have detailed explanations: E0425, E0433.
+For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs
index 0dccb633df9..7282d09706c 100644
--- a/tests/ui/abi/stack-probes-lto.rs
+++ b/tests/ui/abi/stack-probes-lto.rs
@@ -1,13 +1,7 @@
+// revisions: x32 x64
 // run-pass
-// ignore-arm
-// ignore-aarch64
-// ignore-mips
-// ignore-mips64
-// ignore-sparc
-// ignore-sparc64
-// ignore-loongarch64
-// ignore-wasm
-// ignore-emscripten no processes
+//[x32] only-x86
+//[x64] only-x86_64
 // ignore-sgx no processes
 // ignore-musl FIXME #31506
 // ignore-fuchsia no exception handler registered for segfault
diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs
index 8137c92304d..4b8a79a4b68 100644
--- a/tests/ui/abi/stack-probes.rs
+++ b/tests/ui/abi/stack-probes.rs
@@ -1,12 +1,7 @@
+// revisions: x32 x64
 // run-pass
-// ignore-arm
-// ignore-aarch64
-// ignore-mips
-// ignore-mips64
-// ignore-sparc
-// ignore-sparc64
-// ignore-loongarch64
-// ignore-wasm
+//[x32] only-x86
+//[x64] only-x86_64
 // ignore-emscripten no processes
 // ignore-sgx no processes
 // ignore-fuchsia no exception handler registered for segfault
diff --git a/tests/ui/annotate-snippet/auxiliary/other_file.rs b/tests/ui/annotate-snippet/auxiliary/other_file.rs
new file mode 100644
index 00000000000..6f5f412d086
--- /dev/null
+++ b/tests/ui/annotate-snippet/auxiliary/other_file.rs
@@ -0,0 +1,6 @@
+pub struct WithPrivateMethod;
+
+impl WithPrivateMethod {
+    /// Private to get an error involving two files
+    fn private_method(&self) {}
+}
diff --git a/tests/ui/annotate-snippet/multiple-files.rs b/tests/ui/annotate-snippet/multiple-files.rs
new file mode 100644
index 00000000000..981cdbb10a9
--- /dev/null
+++ b/tests/ui/annotate-snippet/multiple-files.rs
@@ -0,0 +1,8 @@
+// aux-build:other_file.rs
+// compile-flags: --error-format human-annotate-rs -Z unstable-options
+
+extern crate other_file;
+
+fn main() {
+    other_file::WithPrivateMethod.private_method();
+}
diff --git a/tests/ui/annotate-snippet/multiple-files.stderr b/tests/ui/annotate-snippet/multiple-files.stderr
new file mode 100644
index 00000000000..4236ec811d0
--- /dev/null
+++ b/tests/ui/annotate-snippet/multiple-files.stderr
@@ -0,0 +1,11 @@
+error[E0624]: method `private_method` is private
+  --> $DIR/multiple-files.rs:7:35
+   |
+LL |     other_file::WithPrivateMethod.private_method();
+   |                                   ^^^^^^^^^^^^^^ private method
+   |
+  ::: $DIR/auxiliary/other_file.rs:5:5
+   |
+LL |     fn private_method(&self) {}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^ private method defined here
+   |
diff --git a/tests/ui/asm/x86_64/issue-96797.rs b/tests/ui/asm/x86_64/issue-96797.rs
index 954f8c5ccc3..951dd949b32 100644
--- a/tests/ui/asm/x86_64/issue-96797.rs
+++ b/tests/ui/asm/x86_64/issue-96797.rs
@@ -1,6 +1,5 @@
 // build-pass
 // compile-flags: -O
-// min-llvm-version: 14.0.5
 // needs-asm-support
 // only-x86_64
 // only-linux
diff --git a/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr b/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr
index c06c506a311..65d18761b18 100644
--- a/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr
+++ b/tests/ui/associated-types/dont-suggest-cyclic-constraint.stderr
@@ -6,7 +6,7 @@ LL |     debug_assert_eq!(iter.next(), Some(value));
    |
    = note: expected enum `Option<<I as Iterator>::Item>`
               found enum `Option<&<I as Iterator>::Item>`
-help: use `Option::as_ref()` to convert `Option<<I as Iterator>::Item>` to `Option<&<I as Iterator>::Item>`
+help: use `Option::as_ref` to convert `Option<<I as Iterator>::Item>` to `Option<&<I as Iterator>::Item>`
    |
 LL |     debug_assert_eq!(iter.next().as_ref(), Some(value));
    |                                 +++++++++
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
index f1f0d7e5907..5c8d64fc6cb 100644
--- a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
+++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
@@ -4,11 +4,11 @@ error[E0311]: the parameter type `U` may not live long enough
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
    |                            ^^^^^^^
    |
-note: the parameter type `U` must be valid for the anonymous lifetime defined here...
+note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics-and-bounds.rs:12:18
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                  ^^^^^
+   |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
   --> $DIR/async-generics-and-bounds.rs:12:28
    |
@@ -21,11 +21,11 @@ error[E0311]: the parameter type `T` may not live long enough
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
    |                            ^^^^^^^
    |
-note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics-and-bounds.rs:12:18
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                  ^^^^^
+   |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
   --> $DIR/async-generics-and-bounds.rs:12:28
    |
diff --git a/tests/ui/async-await/in-trait/async-generics.stderr b/tests/ui/async-await/in-trait/async-generics.stderr
index 2f05564564c..6ae73d9e3a6 100644
--- a/tests/ui/async-await/in-trait/async-generics.stderr
+++ b/tests/ui/async-await/in-trait/async-generics.stderr
@@ -4,11 +4,11 @@ error[E0311]: the parameter type `U` may not live long enough
 LL |     async fn foo(&self) -> &(T, U);
    |                            ^^^^^^^
    |
-note: the parameter type `U` must be valid for the anonymous lifetime defined here...
+note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics.rs:9:18
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                  ^^^^^
+   |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
   --> $DIR/async-generics.rs:9:28
    |
@@ -21,11 +21,11 @@ error[E0311]: the parameter type `T` may not live long enough
 LL |     async fn foo(&self) -> &(T, U);
    |                            ^^^^^^^
    |
-note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics.rs:9:18
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                  ^^^^^
+   |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
   --> $DIR/async-generics.rs:9:28
    |
diff --git a/tests/ui/auto-traits/issue-83857-ub.rs b/tests/ui/auto-traits/issue-83857-ub.rs
new file mode 100644
index 00000000000..0a8865295c6
--- /dev/null
+++ b/tests/ui/auto-traits/issue-83857-ub.rs
@@ -0,0 +1,31 @@
+#![allow(suspicious_auto_trait_impls)]
+
+struct Always<T, U>(T, U);
+unsafe impl<T, U> Send for Always<T, U> {}
+struct Foo<T, U>(Always<T, U>);
+
+trait False {}
+unsafe impl<U: False> Send for Foo<u32, U> {}
+
+trait WithAssoc {
+    type Output;
+}
+impl<T: Send> WithAssoc for T {
+    type Output = Self;
+}
+impl WithAssoc for Foo<u32, ()> {
+    type Output = Box<i32>;
+}
+
+fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
+    //~^ ERROR `Foo<T, U>` cannot be sent between threads safely
+    f(foo(v));
+}
+
+fn foo<T: Send>(x: T) -> <T as WithAssoc>::Output {
+    x
+}
+
+fn main() {
+    generic(Foo(Always(0, ())), |b| *b);
+}
diff --git a/tests/ui/auto-traits/issue-83857-ub.stderr b/tests/ui/auto-traits/issue-83857-ub.stderr
new file mode 100644
index 00000000000..d2aef17e7f8
--- /dev/null
+++ b/tests/ui/auto-traits/issue-83857-ub.stderr
@@ -0,0 +1,22 @@
+error[E0277]: `Foo<T, U>` cannot be sent between threads safely
+  --> $DIR/issue-83857-ub.rs:20:38
+   |
+LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
+   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo<T, U>` cannot be sent between threads safely
+   |
+   = help: the trait `Send` is not implemented for `Foo<T, U>`
+note: required for `Foo<T, U>` to implement `WithAssoc`
+  --> $DIR/issue-83857-ub.rs:13:15
+   |
+LL | impl<T: Send> WithAssoc for T {
+   |         ----  ^^^^^^^^^     ^
+   |         |
+   |         unsatisfied trait bound introduced here
+help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
+   |
+LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) where Foo<T, U>: Send {
+   |                                                                                +++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/codegen/issue-55976.rs b/tests/ui/codegen/issue-55976.rs
index 3142704b78c..fee54fc6206 100644
--- a/tests/ui/codegen/issue-55976.rs
+++ b/tests/ui/codegen/issue-55976.rs
@@ -1,7 +1,5 @@
 // run-pass
 // ^-- The above is needed as this issue is related to LLVM/codegen.
-// min-llvm-version:15.0.0
-// ^-- The above is needed as this issue is fixed by the opaque pointers.
 
 fn main() {
     type_error(|x| &x);
diff --git a/tests/ui/const-generics/issue-93647.rs b/tests/ui/const-generics/issue-93647.rs
index a0083a0c629..806540e1775 100644
--- a/tests/ui/const-generics/issue-93647.rs
+++ b/tests/ui/const-generics/issue-93647.rs
@@ -1,7 +1,6 @@
 struct X<const N: usize = {
     (||1usize)()
     //~^ ERROR cannot call non-const closure
-    //~| ERROR the trait bound
 }>;
 
 fn main() {}
diff --git a/tests/ui/const-generics/issue-93647.stderr b/tests/ui/const-generics/issue-93647.stderr
index 20a6af5c549..18370eea571 100644
--- a/tests/ui/const-generics/issue-93647.stderr
+++ b/tests/ui/const-generics/issue-93647.stderr
@@ -1,17 +1,3 @@
-error[E0277]: the trait bound `[closure@$DIR/issue-93647.rs:2:6: 2:8]: Fn<()>` is not satisfied
-  --> $DIR/issue-93647.rs:2:5
-   |
-LL |     (||1usize)()
-   |     ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-93647.rs:2:6: 2:8]`, but that implementation is not `const`
-  --> $DIR/issue-93647.rs:2:5
-   |
-LL |     (||1usize)()
-   |     ^^^^^^^^^^^^
-   = note: wrap the `[closure@$DIR/issue-93647.rs:2:6: 2:8]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constants
   --> $DIR/issue-93647.rs:2:5
    |
@@ -22,7 +8,6 @@ LL |     (||1usize)()
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/const-generics/issues/issue-100313.rs b/tests/ui/const-generics/issues/issue-100313.rs
index 9a9d4721c84..4e9d3626aa8 100644
--- a/tests/ui/const-generics/issues/issue-100313.rs
+++ b/tests/ui/const-generics/issues/issue-100313.rs
@@ -9,7 +9,6 @@ impl <const B: &'static bool> T<B> {
         unsafe {
             *(B as *const bool as *mut bool) = false;
             //~^ ERROR evaluation of constant value failed [E0080]
-            //~| ERROR casting `&T` to `&mut T` is undefined behavior
         }
     }
 }
diff --git a/tests/ui/const-generics/issues/issue-100313.stderr b/tests/ui/const-generics/issues/issue-100313.stderr
index ffc34a3a41e..d4b486376ca 100644
--- a/tests/ui/const-generics/issues/issue-100313.stderr
+++ b/tests/ui/const-generics/issues/issue-100313.stderr
@@ -1,11 +1,3 @@
-error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/issue-100313.rs:10:13
-   |
-LL |             *(B as *const bool as *mut bool) = false;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `#[deny(cast_ref_to_mut)]` on by default
-
 error[E0080]: evaluation of constant value failed
   --> $DIR/issue-100313.rs:10:13
    |
@@ -18,11 +10,11 @@ note: inside `T::<&true>::set_false`
 LL |             *(B as *const bool as *mut bool) = false;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: inside `_`
-  --> $DIR/issue-100313.rs:19:5
+  --> $DIR/issue-100313.rs:18:5
    |
 LL |     x.set_false();
    |     ^^^^^^^^^^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/const-generics/late-bound-vars/in_closure.rs b/tests/ui/const-generics/late-bound-vars/in_closure.rs
index 00fb535f048..235d147c7ec 100644
--- a/tests/ui/const-generics/late-bound-vars/in_closure.rs
+++ b/tests/ui/const-generics/late-bound-vars/in_closure.rs
@@ -13,8 +13,10 @@
 // normalize-stderr-test "\s\d{1,}: .*\n" -> ""
 // normalize-stderr-test "\s at .*\n" -> ""
 // normalize-stderr-test ".*note: Some details.*\n" -> ""
-// normalize-stderr-test "\n\n[ ]*\n" -> ""
+// normalize-stderr-test "\n[ ]*\n" -> ""
 // normalize-stderr-test "compiler/.*: projection" -> "projection"
+// normalize-stderr-test ".*omitted \d{1,} frame.*\n" -> ""
+// normalize-stderr-test "error: [\s\n]*query stack during panic:\n" -> ""
 // this should run-pass
 
 #![feature(generic_const_exprs)]
diff --git a/tests/ui/const-generics/late-bound-vars/in_closure.stderr b/tests/ui/const-generics/late-bound-vars/in_closure.stderr
index 9dc5ea1f16a..ac406bf2bb1 100644
--- a/tests/ui/const-generics/late-bound-vars/in_closure.stderr
+++ b/tests/ui/const-generics/late-bound-vars/in_closure.stderr
@@ -1,4 +1,3 @@
-error: query stack during panic:
 #0 [mir_borrowck] borrow-checking `test::{closure#0}::{constant#1}`
 #1 [mir_drops_elaborated_and_const_checked] elaborating drops for `test::{closure#0}::{constant#1}`
 #2 [mir_for_ctfe] caching mir of `test::{closure#0}::{constant#1}` for CTFE
@@ -8,5 +7,4 @@ error: query stack during panic:
 #6 [typeck] type-checking `test`
 #7 [analysis] running analysis passes on this crate
 end of query stack
-error: aborting due to previous error
-
+error: aborting due to previous error
\ No newline at end of file
diff --git a/tests/ui/const-generics/late-bound-vars/simple.rs b/tests/ui/const-generics/late-bound-vars/simple.rs
index 5d19aaf0b95..411a974cef9 100644
--- a/tests/ui/const-generics/late-bound-vars/simple.rs
+++ b/tests/ui/const-generics/late-bound-vars/simple.rs
@@ -15,6 +15,8 @@
 // normalize-stderr-test ".*note: Some details.*\n" -> ""
 // normalize-stderr-test "\n\n[ ]*\n" -> ""
 // normalize-stderr-test "compiler/.*: projection" -> "projection"
+// normalize-stderr-test ".*omitted \d{1,} frame.*\n" -> ""
+// normalize-stderr-test "error: [\s\n]*query stack" -> "error: query stack"
 
 #![feature(generic_const_exprs)]
 #![allow(incomplete_features)]
diff --git a/tests/ui/const_prop/apfloat-f64-roundtrip.rs b/tests/ui/const_prop/apfloat-f64-roundtrip.rs
new file mode 100644
index 00000000000..9fb2ac96beb
--- /dev/null
+++ b/tests/ui/const_prop/apfloat-f64-roundtrip.rs
@@ -0,0 +1,9 @@
+// run-pass
+// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes
+// min-llvm-version: 16.0 (requires APFloat fixes in LLVM)
+
+// Regression test for a broken MIR optimization (issue #113407).
+pub fn main() {
+    let f = f64::from_bits(0x19873cc2) as f32;
+    assert_eq!(f.to_bits(), 0);
+}
diff --git a/tests/ui/const_prop/apfloat-remainder-regression.rs b/tests/ui/const_prop/apfloat-remainder-regression.rs
new file mode 100644
index 00000000000..08932c333fd
--- /dev/null
+++ b/tests/ui/const_prop/apfloat-remainder-regression.rs
@@ -0,0 +1,15 @@
+// run-pass
+// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes
+
+// Regression test for a broken MIR optimization (issue #102403).
+pub fn f() -> f64 {
+    std::hint::black_box(-1.0) % std::hint::black_box(-1.0)
+}
+
+pub fn g() -> f64 {
+    -1.0 % -1.0
+}
+
+pub fn main() {
+    assert_eq!(f().signum(), g().signum());
+}
diff --git a/tests/ui/consts/const-block-const-bound.rs b/tests/ui/consts/const-block-const-bound.rs
index 3704a1a5a39..123e5cb1b3e 100644
--- a/tests/ui/consts/const-block-const-bound.rs
+++ b/tests/ui/consts/const-block-const-bound.rs
@@ -1,3 +1,5 @@
+// known-bug: #103507
+
 #![allow(unused)]
 #![feature(const_trait_impl, inline_const, negative_impls)]
 
@@ -14,6 +16,6 @@ impl Drop for UnconstDrop {
 fn main() {
     const {
         f(UnconstDrop);
-        //~^ ERROR can't drop
+        //FIXME ~^ ERROR can't drop
     }
 }
diff --git a/tests/ui/consts/const-block-const-bound.stderr b/tests/ui/consts/const-block-const-bound.stderr
index caf24e7afcf..b402f0ea915 100644
--- a/tests/ui/consts/const-block-const-bound.stderr
+++ b/tests/ui/consts/const-block-const-bound.stderr
@@ -1,17 +1,11 @@
-error[E0277]: can't drop `UnconstDrop` in const contexts
-  --> $DIR/const-block-const-bound.rs:16:9
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-block-const-bound.rs:8:32
    |
-LL |         f(UnconstDrop);
-   |         ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `UnconstDrop`
-   |
-   = note: the trait bound `UnconstDrop: ~const Destruct` is not satisfied
-help: consider borrowing here
-   |
-LL |         &f(UnconstDrop);
-   |         +
-LL |         &mut f(UnconstDrop);
-   |         ++++
+LL | const fn f<T: ~const Destruct>(x: T) {}
+   |                                ^      - value is dropped here
+   |                                |
+   |                                the destructor for this type cannot be evaluated in constant functions
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/consts/const-eval/const-eval-query-stack.rs b/tests/ui/consts/const-eval/const-eval-query-stack.rs
index 81f28c1755d..33753dc7445 100644
--- a/tests/ui/consts/const-eval/const-eval-query-stack.rs
+++ b/tests/ui/consts/const-eval/const-eval-query-stack.rs
@@ -10,7 +10,7 @@
 // normalize-stderr-test "\s\d{1,}: .*\n" -> ""
 // normalize-stderr-test "\s at .*\n" -> ""
 // normalize-stderr-test ".*note: Some details.*\n" -> ""
-
+// normalize-stderr-test ".*omitted \d{1,} frame.*\n" -> ""
 #![allow(unconditional_panic)]
 
 const X: i32 = 1 / 0; //~ERROR constant
diff --git a/tests/ui/consts/const-eval/nonnull_as_ref.rs b/tests/ui/consts/const-eval/nonnull_as_ref.rs
new file mode 100644
index 00000000000..eb4683e2c30
--- /dev/null
+++ b/tests/ui/consts/const-eval/nonnull_as_ref.rs
@@ -0,0 +1,8 @@
+// check-pass
+
+use std::ptr::NonNull;
+
+const NON_NULL: NonNull<u8> = unsafe { NonNull::new_unchecked((&42u8 as *const u8).cast_mut()) };
+const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
+
+fn main() {}
diff --git a/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs b/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs
new file mode 100644
index 00000000000..3b48e972923
--- /dev/null
+++ b/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs
@@ -0,0 +1,6 @@
+use std::ptr::NonNull;
+
+const NON_NULL: NonNull<u8> = unsafe { NonNull::dangling() };
+const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
+
+fn main() {}
diff --git a/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr b/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr
new file mode 100644
index 00000000000..de93cb0c3ca
--- /dev/null
+++ b/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr
@@ -0,0 +1,16 @@
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
+   |
+   = note: dereferencing pointer failed: 0x1[noalloc] is a dangling pointer (it has no provenance)
+   |
+note: inside `NonNull::<u8>::as_ref::<'_>`
+  --> $SRC_DIR/core/src/ptr/non_null.rs:LL:COL
+note: inside `_`
+  --> $DIR/nonnull_as_ref_ub.rs:4:39
+   |
+LL | const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
+   |                                       ^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr
index dc2c702d885..0d915cec07d 100644
--- a/tests/ui/consts/const_cmp_type_id.stderr
+++ b/tests/ui/consts/const_cmp_type_id.stderr
@@ -1,16 +1,3 @@
-error[E0277]: can't compare `TypeId` with `TypeId` in const contexts
-  --> $DIR/const_cmp_type_id.rs:8:13
-   |
-LL |     assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `TypeId == TypeId`
-   |
-   = help: the trait `~const PartialEq` is not implemented for `TypeId`
-note: the trait `PartialEq` is implemented for `TypeId`, but that implementation is not `const`
-  --> $DIR/const_cmp_type_id.rs:8:13
-   |
-LL |     assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constant functions
   --> $DIR/const_cmp_type_id.rs:8:13
    |
@@ -21,19 +8,6 @@ note: impl defined here, but it is not `const`
   --> $SRC_DIR/core/src/any.rs:LL:COL
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0277]: can't compare `TypeId` with `TypeId` in const contexts
-  --> $DIR/const_cmp_type_id.rs:9:13
-   |
-LL |     assert!(TypeId::of::<()>() != TypeId::of::<u8>());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `TypeId == TypeId`
-   |
-   = help: the trait `~const PartialEq` is not implemented for `TypeId`
-note: the trait `PartialEq` is implemented for `TypeId`, but that implementation is not `const`
-  --> $DIR/const_cmp_type_id.rs:9:13
-   |
-LL |     assert!(TypeId::of::<()>() != TypeId::of::<u8>());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constant functions
   --> $DIR/const_cmp_type_id.rs:9:13
    |
@@ -44,19 +18,6 @@ note: impl defined here, but it is not `const`
   --> $SRC_DIR/core/src/any.rs:LL:COL
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0277]: can't compare `TypeId` with `TypeId` in const contexts
-  --> $DIR/const_cmp_type_id.rs:10:22
-   |
-LL |     const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `TypeId < TypeId` and `TypeId > TypeId`
-   |
-   = help: the trait `~const PartialOrd` is not implemented for `TypeId`
-note: the trait `PartialOrd` is implemented for `TypeId`, but that implementation is not `const`
-  --> $DIR/const_cmp_type_id.rs:10:22
-   |
-LL |     const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constants
   --> $DIR/const_cmp_type_id.rs:10:22
    |
@@ -68,7 +29,6 @@ note: impl defined here, but it is not `const`
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 6 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/invalid-inline-const-in-match-arm.rs b/tests/ui/consts/invalid-inline-const-in-match-arm.rs
index 17acb2d9d17..4d2d8fb1303 100644
--- a/tests/ui/consts/invalid-inline-const-in-match-arm.rs
+++ b/tests/ui/consts/invalid-inline-const-in-match-arm.rs
@@ -5,6 +5,5 @@ fn main() {
     match () {
         const { (|| {})() } => {}
         //~^ ERROR cannot call non-const closure in constants
-        //~| ERROR the trait bound
     }
 }
diff --git a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
index ac174849f06..257ecd7f3cf 100644
--- a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
+++ b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr
@@ -1,17 +1,3 @@
-error[E0277]: the trait bound `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]: Fn<()>` is not satisfied
-  --> $DIR/invalid-inline-const-in-match-arm.rs:6:17
-   |
-LL |         const { (|| {})() } => {}
-   |                 ^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]`, but that implementation is not `const`
-  --> $DIR/invalid-inline-const-in-match-arm.rs:6:17
-   |
-LL |         const { (|| {})() } => {}
-   |                 ^^^^^^^^^
-   = note: wrap the `[closure@$DIR/invalid-inline-const-in-match-arm.rs:6:18: 6:20]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constants
   --> $DIR/invalid-inline-const-in-match-arm.rs:6:17
    |
@@ -22,7 +8,6 @@ LL |         const { (|| {})() } => {}
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-28113.rs b/tests/ui/consts/issue-28113.rs
index e45c009d69f..f8131c9f3b7 100644
--- a/tests/ui/consts/issue-28113.rs
+++ b/tests/ui/consts/issue-28113.rs
@@ -3,7 +3,6 @@
 const X: u8 =
     || -> u8 { 5 }()
     //~^ ERROR cannot call non-const closure
-    //~| ERROR the trait bound
 ;
 
 fn main() {}
diff --git a/tests/ui/consts/issue-28113.stderr b/tests/ui/consts/issue-28113.stderr
index e177a3585c4..1294cc99bf7 100644
--- a/tests/ui/consts/issue-28113.stderr
+++ b/tests/ui/consts/issue-28113.stderr
@@ -1,17 +1,3 @@
-error[E0277]: the trait bound `[closure@$DIR/issue-28113.rs:4:5: 4:13]: Fn<()>` is not satisfied
-  --> $DIR/issue-28113.rs:4:5
-   |
-LL |     || -> u8 { 5 }()
-   |     ^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-28113.rs:4:5: 4:13]`, but that implementation is not `const`
-  --> $DIR/issue-28113.rs:4:5
-   |
-LL |     || -> u8 { 5 }()
-   |     ^^^^^^^^^^^^^^^^
-   = note: wrap the `[closure@$DIR/issue-28113.rs:4:5: 4:13]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constants
   --> $DIR/issue-28113.rs:4:5
    |
@@ -22,7 +8,6 @@ LL |     || -> u8 { 5 }()
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-56164.rs b/tests/ui/consts/issue-56164.rs
index 00875c4b582..22c257d0b08 100644
--- a/tests/ui/consts/issue-56164.rs
+++ b/tests/ui/consts/issue-56164.rs
@@ -1,6 +1,5 @@
 const fn foo() { (||{})() }
 //~^ ERROR cannot call non-const closure
-//~| ERROR the trait bound
 
 const fn bad(input: fn()) {
     input()
diff --git a/tests/ui/consts/issue-56164.stderr b/tests/ui/consts/issue-56164.stderr
index e46c649faf0..1b267214a02 100644
--- a/tests/ui/consts/issue-56164.stderr
+++ b/tests/ui/consts/issue-56164.stderr
@@ -1,17 +1,3 @@
-error[E0277]: the trait bound `[closure@$DIR/issue-56164.rs:1:19: 1:21]: Fn<()>` is not satisfied
-  --> $DIR/issue-56164.rs:1:18
-   |
-LL | const fn foo() { (||{})() }
-   |                  ^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-56164.rs:1:19: 1:21]`, but that implementation is not `const`
-  --> $DIR/issue-56164.rs:1:18
-   |
-LL | const fn foo() { (||{})() }
-   |                  ^^^^^^^^
-   = note: wrap the `[closure@$DIR/issue-56164.rs:1:19: 1:21]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constant functions
   --> $DIR/issue-56164.rs:1:18
    |
@@ -23,12 +9,11 @@ LL | const fn foo() { (||{})() }
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
 error: function pointer calls are not allowed in constant functions
-  --> $DIR/issue-56164.rs:6:5
+  --> $DIR/issue-56164.rs:5:5
    |
 LL |     input()
    |     ^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-68542-closure-in-array-len.rs b/tests/ui/consts/issue-68542-closure-in-array-len.rs
index a88e0cc6017..37958e7919d 100644
--- a/tests/ui/consts/issue-68542-closure-in-array-len.rs
+++ b/tests/ui/consts/issue-68542-closure-in-array-len.rs
@@ -4,7 +4,6 @@
 
 struct Bug {
     a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
-    //~^ ERROR the trait bound
 }
 
 fn main() {}
diff --git a/tests/ui/consts/issue-68542-closure-in-array-len.stderr b/tests/ui/consts/issue-68542-closure-in-array-len.stderr
index ace62f09d05..d23513ed7ff 100644
--- a/tests/ui/consts/issue-68542-closure-in-array-len.stderr
+++ b/tests/ui/consts/issue-68542-closure-in-array-len.stderr
@@ -1,17 +1,3 @@
-error[E0277]: the trait bound `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]: Fn<()>` is not satisfied
-  --> $DIR/issue-68542-closure-in-array-len.rs:6:13
-   |
-LL |     a: [(); (|| { 0 })()]
-   |             ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`, but that implementation is not `const`
-  --> $DIR/issue-68542-closure-in-array-len.rs:6:13
-   |
-LL |     a: [(); (|| { 0 })()]
-   |             ^^^^^^^^^^^^
-   = note: wrap the `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constants
   --> $DIR/issue-68542-closure-in-array-len.rs:6:13
    |
@@ -22,7 +8,6 @@ LL |     a: [(); (|| { 0 })()]
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-73976-monomorphic.stderr b/tests/ui/consts/issue-73976-monomorphic.stderr
index 09661d3f344..b23796db4f1 100644
--- a/tests/ui/consts/issue-73976-monomorphic.stderr
+++ b/tests/ui/consts/issue-73976-monomorphic.stderr
@@ -1,16 +1,3 @@
-error[E0277]: can't compare `TypeId` with `TypeId` in const contexts
-  --> $DIR/issue-73976-monomorphic.rs:21:5
-   |
-LL |     GetTypeId::<T>::VALUE == GetTypeId::<usize>::VALUE
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `TypeId == TypeId`
-   |
-   = help: the trait `~const PartialEq` is not implemented for `TypeId`
-note: the trait `PartialEq` is implemented for `TypeId`, but that implementation is not `const`
-  --> $DIR/issue-73976-monomorphic.rs:21:5
-   |
-LL |     GetTypeId::<T>::VALUE == GetTypeId::<usize>::VALUE
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constant functions
   --> $DIR/issue-73976-monomorphic.rs:21:5
    |
@@ -21,7 +8,6 @@ note: impl defined here, but it is not `const`
   --> $SRC_DIR/core/src/any.rs:LL:COL
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/issue-94675.rs b/tests/ui/consts/issue-94675.rs
index 38c8129b8cf..2358175fe92 100644
--- a/tests/ui/consts/issue-94675.rs
+++ b/tests/ui/consts/issue-94675.rs
@@ -1,3 +1,5 @@
+// known-bug: #103507
+
 #![feature(const_trait_impl, const_mut_refs)]
 
 struct Foo<'a> {
@@ -7,9 +9,9 @@ struct Foo<'a> {
 impl<'a> Foo<'a> {
     const fn spam(&mut self, baz: &mut Vec<u32>) {
         self.bar[0] = baz.len();
-        //~^ ERROR: cannot call
-        //~| ERROR: cannot call
-        //~| ERROR: the trait bound
+        //FIXME ~^ ERROR: cannot call
+        //FIXME ~| ERROR: cannot call
+        //FIXME ~| ERROR: the trait bound
     }
 }
 
diff --git a/tests/ui/consts/issue-94675.stderr b/tests/ui/consts/issue-94675.stderr
index b4e5db44e71..cee4dfda2c9 100644
--- a/tests/ui/consts/issue-94675.stderr
+++ b/tests/ui/consts/issue-94675.stderr
@@ -1,26 +1,13 @@
 error[E0015]: cannot call non-const fn `Vec::<u32>::len` in constant functions
-  --> $DIR/issue-94675.rs:9:27
+  --> $DIR/issue-94675.rs:11:27
    |
 LL |         self.bar[0] = baz.len();
    |                           ^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error[E0277]: the trait bound `Vec<usize>: ~const IndexMut<usize>` is not satisfied
-  --> $DIR/issue-94675.rs:9:9
-   |
-LL |         self.bar[0] = baz.len();
-   |         ^^^^^^^^^^^ vector indices are of type `usize` or ranges of `usize`
-   |
-   = help: the trait `~const IndexMut<usize>` is not implemented for `Vec<usize>`
-note: the trait `IndexMut<usize>` is implemented for `Vec<usize>`, but that implementation is not `const`
-  --> $DIR/issue-94675.rs:9:9
-   |
-LL |         self.bar[0] = baz.len();
-   |         ^^^^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constant functions
-  --> $DIR/issue-94675.rs:9:9
+  --> $DIR/issue-94675.rs:11:9
    |
 LL |         self.bar[0] = baz.len();
    |         ^^^^^^^^^^^
@@ -29,7 +16,6 @@ note: impl defined here, but it is not `const`
   --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/precise-drop-with-promoted.rs b/tests/ui/consts/precise-drop-with-promoted.rs
index 6f2317a5a27..5da325afb72 100644
--- a/tests/ui/consts/precise-drop-with-promoted.rs
+++ b/tests/ui/consts/precise-drop-with-promoted.rs
@@ -1,6 +1,12 @@
 // Regression test for issue #89938.
-// check-pass
 // compile-flags: --crate-type=lib
+// known-bug: #103507
+// failure-status: 101
+// normalize-stderr-test "note: .*\n\n" -> ""
+// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
+// normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
+// rustc-env:RUST_BACKTRACE=0
+
 #![feature(const_precise_live_drops)]
 
 pub const fn f() {
diff --git a/tests/ui/consts/precise-drop-with-promoted.stderr b/tests/ui/consts/precise-drop-with-promoted.stderr
new file mode 100644
index 00000000000..a56672048eb
--- /dev/null
+++ b/tests/ui/consts/precise-drop-with-promoted.stderr
@@ -0,0 +1,6 @@
+error: the compiler unexpectedly panicked. this is a bug.
+
+query stack during panic:
+#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `f`
+#1 [analysis] running analysis passes on this crate
+end of query stack
diff --git a/tests/ui/consts/promoted_const_call.rs b/tests/ui/consts/promoted_const_call.rs
index dae6cafaebb..d6e48266fd3 100644
--- a/tests/ui/consts/promoted_const_call.rs
+++ b/tests/ui/consts/promoted_const_call.rs
@@ -1,3 +1,5 @@
+// known-bug: #103507
+
 #![feature(const_mut_refs)]
 #![feature(const_trait_impl)]
 
@@ -7,15 +9,15 @@ impl const Drop for Panic { fn drop(&mut self) { panic!(); } }
 pub const fn id<T>(x: T) -> T { x }
 pub const C: () = {
     let _: &'static _ = &id(&Panic);
-    //~^ ERROR: temporary value dropped while borrowed
-    //~| ERROR: temporary value dropped while borrowed
+    //FIXME ~^ ERROR: temporary value dropped while borrowed
+    //FIXME ~| ERROR: temporary value dropped while borrowed
 };
 
 fn main() {
     let _: &'static _ = &id(&Panic);
-    //~^ ERROR: temporary value dropped while borrowed
-    //~| ERROR: temporary value dropped while borrowed
+    //FIXME ~^ ERROR: temporary value dropped while borrowed
+    //FIXME ~| ERROR: temporary value dropped while borrowed
     let _: &'static _ = &&(Panic, 0).1;
-    //~^ ERROR: temporary value dropped while borrowed
-    //~| ERROR: temporary value dropped while borrowed
+    //FIXME~^ ERROR: temporary value dropped while borrowed
+    //FIXME~| ERROR: temporary value dropped while borrowed
 }
diff --git a/tests/ui/consts/promoted_const_call.stderr b/tests/ui/consts/promoted_const_call.stderr
index 1cbd8cbe699..1f6abc0ce7c 100644
--- a/tests/ui/consts/promoted_const_call.stderr
+++ b/tests/ui/consts/promoted_const_call.stderr
@@ -1,5 +1,13 @@
+error[E0493]: destructor of `Panic` cannot be evaluated at compile-time
+  --> $DIR/promoted_const_call.rs:11:30
+   |
+LL |     let _: &'static _ = &id(&Panic);
+   |                              ^^^^^ - value is dropped here
+   |                              |
+   |                              the destructor for this type cannot be evaluated in constants
+
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:9:26
+  --> $DIR/promoted_const_call.rs:11:26
    |
 LL |     let _: &'static _ = &id(&Panic);
    |            ----------    ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -10,7 +18,7 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:9:30
+  --> $DIR/promoted_const_call.rs:11:30
    |
 LL |     let _: &'static _ = &id(&Panic);
    |            ----------        ^^^^^ - temporary value is freed at the end of this statement
@@ -19,7 +27,7 @@ LL |     let _: &'static _ = &id(&Panic);
    |            type annotation requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:15:26
+  --> $DIR/promoted_const_call.rs:17:26
    |
 LL |     let _: &'static _ = &id(&Panic);
    |            ----------    ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -30,7 +38,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:15:30
+  --> $DIR/promoted_const_call.rs:17:30
    |
 LL |     let _: &'static _ = &id(&Panic);
    |            ----------        ^^^^^ - temporary value is freed at the end of this statement
@@ -39,7 +47,7 @@ LL |     let _: &'static _ = &id(&Panic);
    |            type annotation requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:18:26
+  --> $DIR/promoted_const_call.rs:20:26
    |
 LL |     let _: &'static _ = &&(Panic, 0).1;
    |            ----------    ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -50,7 +58,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call.rs:18:27
+  --> $DIR/promoted_const_call.rs:20:27
    |
 LL |     let _: &'static _ = &&(Panic, 0).1;
    |            ----------     ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -60,6 +68,7 @@ LL |     let _: &'static _ = &&(Panic, 0).1;
 LL | }
    | - temporary value is freed at the end of this statement
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0716`.
+Some errors have detailed explanations: E0493, E0716.
+For more information about an error, try `rustc --explain E0493`.
diff --git a/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs b/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs
new file mode 100644
index 00000000000..759c32c8453
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/auxiliary/proc-macro-helper.rs
@@ -0,0 +1,12 @@
+// force-host
+// no-prefer-dynamic
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+
+#[proc_macro_attribute]
+pub fn diagnostic(i: TokenStream, _: TokenStream) -> TokenStream {
+    i
+}
diff --git a/tests/ui/diagnostic_namespace/can_use_the_diagnostic_name_in_other_places.rs b/tests/ui/diagnostic_namespace/can_use_the_diagnostic_name_in_other_places.rs
new file mode 100644
index 00000000000..08b4d68779c
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/can_use_the_diagnostic_name_in_other_places.rs
@@ -0,0 +1,13 @@
+// check-pass
+
+mod diagnostic {}
+
+macro_rules! diagnostic{
+    () => {}
+}
+
+#[allow(non_upper_case_globals)]
+const diagnostic: () = ();
+
+fn main() {
+}
diff --git a/tests/ui/diagnostic_namespace/existing_proc_macros.rs b/tests/ui/diagnostic_namespace/existing_proc_macros.rs
new file mode 100644
index 00000000000..d6d1fb01496
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/existing_proc_macros.rs
@@ -0,0 +1,24 @@
+#![feature(diagnostic_namespace)]
+// check-pass
+// aux-build:proc-macro-helper.rs
+
+extern crate proc_macro_helper;
+
+mod test1 {
+    use proc_macro_helper::diagnostic;
+
+    #[diagnostic]
+    struct Foo;
+
+}
+
+mod test2 {
+    mod diagnostic {
+        pub use proc_macro_helper::diagnostic as on_unimplemented;
+    }
+
+    #[diagnostic::on_unimplemented]
+    trait Foo {}
+}
+
+fn main() {}
diff --git a/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.rs b/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.rs
new file mode 100644
index 00000000000..a686ed9c84e
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.rs
@@ -0,0 +1,13 @@
+#[diagnostic::non_existing_attribute]
+//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
+//~|WARNING unknown diagnostic attribute [unknown_diagnostic_attributes]
+pub trait Bar {
+}
+
+#[diagnostic::non_existing_attribute(with_option = "foo")]
+//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
+//~|WARNING unknown diagnostic attribute [unknown_diagnostic_attributes]
+struct Foo;
+
+fn main() {
+}
diff --git a/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.stderr b/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.stderr
new file mode 100644
index 00000000000..45c95cbb3c7
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/feature-gate-diagnostic_namespace.stderr
@@ -0,0 +1,35 @@
+error[E0658]: `#[diagnostic]` attribute name space is experimental
+  --> $DIR/feature-gate-diagnostic_namespace.rs:1:3
+   |
+LL | #[diagnostic::non_existing_attribute]
+   |   ^^^^^^^^^^
+   |
+   = note: see issue #94785 <https://github.com/rust-lang/rust/issues/94785> for more information
+   = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
+
+error[E0658]: `#[diagnostic]` attribute name space is experimental
+  --> $DIR/feature-gate-diagnostic_namespace.rs:7:3
+   |
+LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
+   |   ^^^^^^^^^^
+   |
+   = note: see issue #94785 <https://github.com/rust-lang/rust/issues/94785> for more information
+   = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
+
+warning: unknown diagnostic attribute
+  --> $DIR/feature-gate-diagnostic_namespace.rs:1:15
+   |
+LL | #[diagnostic::non_existing_attribute]
+   |               ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(unknown_diagnostic_attributes)]` on by default
+
+warning: unknown diagnostic attribute
+  --> $DIR/feature-gate-diagnostic_namespace.rs:7:15
+   |
+LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
+   |               ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.rs b/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.rs
new file mode 100644
index 00000000000..677bd5a7343
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.rs
@@ -0,0 +1,13 @@
+#![feature(diagnostic_namespace)]
+// check-pass
+#[diagnostic::non_existing_attribute]
+//~^WARN unknown diagnostic attribute
+pub trait Bar {
+}
+
+#[diagnostic::non_existing_attribute(with_option = "foo")]
+//~^WARN unknown diagnostic attribute
+struct Foo;
+
+fn main() {
+}
diff --git a/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr b/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr
new file mode 100644
index 00000000000..4f9b7ba2bcf
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/non_existing_attributes_accepted.stderr
@@ -0,0 +1,16 @@
+warning: unknown diagnostic attribute
+  --> $DIR/non_existing_attributes_accepted.rs:3:15
+   |
+LL | #[diagnostic::non_existing_attribute]
+   |               ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(unknown_diagnostic_attributes)]` on by default
+
+warning: unknown diagnostic attribute
+  --> $DIR/non_existing_attributes_accepted.rs:8:15
+   |
+LL | #[diagnostic::non_existing_attribute(with_option = "foo")]
+   |               ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/diagnostic_namespace/requires_path.rs b/tests/ui/diagnostic_namespace/requires_path.rs
new file mode 100644
index 00000000000..e8d6ca73ad0
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/requires_path.rs
@@ -0,0 +1,9 @@
+#![feature(diagnostic_namespace)]
+
+#[diagnostic]
+//~^ERROR cannot find attribute `diagnostic` in this scope
+pub struct Bar;
+
+
+fn main() {
+}
diff --git a/tests/ui/diagnostic_namespace/requires_path.stderr b/tests/ui/diagnostic_namespace/requires_path.stderr
new file mode 100644
index 00000000000..ce867621daa
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/requires_path.stderr
@@ -0,0 +1,8 @@
+error: cannot find attribute `diagnostic` in this scope
+  --> $DIR/requires_path.rs:3:3
+   |
+LL | #[diagnostic]
+   |   ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/dyn-star/llvm-old-style-ptrs.rs b/tests/ui/dyn-star/llvm-old-style-ptrs.rs
index 4c042a53979..460af99f9c5 100644
--- a/tests/ui/dyn-star/llvm-old-style-ptrs.rs
+++ b/tests/ui/dyn-star/llvm-old-style-ptrs.rs
@@ -1,8 +1,6 @@
 // run-pass
 // compile-flags: -Copt-level=0 -Cllvm-args=-opaque-pointers=0
 
-// (opaque-pointers flag is called force-opaque-pointers in LLVM 13...)
-// min-llvm-version: 14.0
 // (the ability to disable opaque pointers has been removed in LLVM 17)
 // ignore-llvm-version: 17 - 99
 
diff --git a/tests/ui/feature-gates/print-with-path.cfg.stderr b/tests/ui/feature-gates/print-with-path.cfg.stderr
new file mode 100644
index 00000000000..a6c51baa320
--- /dev/null
+++ b/tests/ui/feature-gates/print-with-path.cfg.stderr
@@ -0,0 +1,2 @@
+error: the `-Z unstable-options` flag must also be passed to enable the path print option
+
diff --git a/tests/ui/feature-gates/print-with-path.rs b/tests/ui/feature-gates/print-with-path.rs
new file mode 100644
index 00000000000..f929c14c218
--- /dev/null
+++ b/tests/ui/feature-gates/print-with-path.rs
@@ -0,0 +1,7 @@
+// check-fail
+// revisions: cfg target-features target-cpus
+// [cfg]compile-flags: --print cfg=cfg.txt
+// [target-cpus]compile-flags: --print target-cpu=target_cpu.txt
+// [target-features]compile-flags: --print target-features=target_features.txt
+
+fn main() {}
diff --git a/tests/ui/feature-gates/print-with-path.target-cpus.stderr b/tests/ui/feature-gates/print-with-path.target-cpus.stderr
new file mode 100644
index 00000000000..a6c51baa320
--- /dev/null
+++ b/tests/ui/feature-gates/print-with-path.target-cpus.stderr
@@ -0,0 +1,2 @@
+error: the `-Z unstable-options` flag must also be passed to enable the path print option
+
diff --git a/tests/ui/feature-gates/print-with-path.target-features.stderr b/tests/ui/feature-gates/print-with-path.target-features.stderr
new file mode 100644
index 00000000000..a6c51baa320
--- /dev/null
+++ b/tests/ui/feature-gates/print-with-path.target-features.stderr
@@ -0,0 +1,2 @@
+error: the `-Z unstable-options` flag must also be passed to enable the path print option
+
diff --git a/tests/ui/generator/auto-trait-regions.rs b/tests/ui/generator/auto-trait-regions.rs
index fd13e41319f..350f3cc34ce 100644
--- a/tests/ui/generator/auto-trait-regions.rs
+++ b/tests/ui/generator/auto-trait-regions.rs
@@ -26,7 +26,7 @@ fn assert_foo<T: Foo>(f: T) {}
 fn main() {
     // Make sure 'static is erased for generator interiors so we can't match it in trait selection
     let x: &'static _ = &OnlyFooIfStaticRef(No);
-    let gen = || {
+    let gen = move || {
         let x = x;
         yield;
         assert_foo(x);
@@ -36,7 +36,7 @@ fn main() {
 
     // Allow impls which matches any lifetime
     let x = &OnlyFooIfRef(No);
-    let gen = || {
+    let gen = move || {
         let x = x;
         yield;
         assert_foo(x);
@@ -44,7 +44,7 @@ fn main() {
     assert_foo(gen); // ok
 
     // Disallow impls which relates lifetimes in the generator interior
-    let gen = || {
+    let gen = move || {
         let a = A(&mut true, &mut true, No);
         //~^ temporary value dropped while borrowed
         //~| temporary value dropped while borrowed
diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs
index dacbc93dec8..8da3baeb17a 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait2.rs
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.rs
@@ -18,6 +18,9 @@
 // normalize-stderr-test ".*note: Some details.*\n" -> ""
 // normalize-stderr-test "\n\n[ ]*\n" -> ""
 // normalize-stderr-test "compiler/.*: projection" -> "projection"
+// normalize-stderr-test ".*omitted \d{1,} frame.*\n" -> ""
+// normalize-stderr-test "error: [\s\n]*query stack" -> "error: query stack"
+// normalize-stderr-test "[\n\s]*\nquery stack during panic:" -> "query stack during panic:"
 // edition:2018
 
 #![feature(type_alias_impl_trait)]
diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.stderr b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
index 3187be3334c..2538eb46dfa 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait2.stderr
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
@@ -1,9 +1,9 @@
 error: 
-  --> $DIR/issue-90014-tait2.rs:41:27
+  --> $DIR/issue-90014-tait2.rs:44:27
    |
 LL |     fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^query stack during panic:
-#0 [typeck] type-checking `<impl at $DIR/issue-90014-tait2.rs:40:1: 40:13>::make_fut`
+#0 [typeck] type-checking `<impl at $DIR/issue-90014-tait2.rs:43:1: 43:13>::make_fut`
 #1 [type_of] computing type of `Fut::{opaque#0}`
 #2 [check_mod_item_types] checking item types in top-level module
 #3 [analysis] running analysis passes on this crate
diff --git a/tests/ui/generic-const-items/associated-const-equality.rs b/tests/ui/generic-const-items/associated-const-equality.rs
new file mode 100644
index 00000000000..785d3aa5018
--- /dev/null
+++ b/tests/ui/generic-const-items/associated-const-equality.rs
@@ -0,0 +1,22 @@
+// check-pass
+
+#![feature(generic_const_items, associated_const_equality)]
+#![allow(incomplete_features)]
+
+trait Owner {
+    const C<const N: u32>: u32;
+    const K<const N: u32>: u32;
+}
+
+impl Owner for () {
+    const C<const N: u32>: u32 = N;
+    const K<const N: u32>: u32 = N + 1;
+}
+
+fn take0<const N: u32>(_: impl Owner<C<N> = { N }>) {}
+fn take1(_: impl Owner<K<99> = 100>) {}
+
+fn main() {
+    take0::<128>(());
+    take1(());
+}
diff --git a/tests/ui/generic-const-items/basic.rs b/tests/ui/generic-const-items/basic.rs
new file mode 100644
index 00000000000..73bfa803acd
--- /dev/null
+++ b/tests/ui/generic-const-items/basic.rs
@@ -0,0 +1,61 @@
+// check-pass
+
+// Basic usage patterns of free & associated generic const items.
+
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+fn main() {
+    const NULL<T>: Option<T> = None::<T>;
+    const NOTHING<T>: Option<T> = None; // arg inferred
+
+    let _ = NOTHING::<String>;
+    let _: Option<u8> = NULL; // arg inferred
+
+    const IDENTITY<const X: u64>: u64 = X;
+
+    const COUNT: u64 = IDENTITY::<48>;
+    const AMOUNT: u64 = IDENTITY::<COUNT>;
+    const NUMBER: u64 = IDENTITY::<{ AMOUNT * 2 }>;
+    let _ = NUMBER;
+    let _ = IDENTITY::<0>;
+
+    let _ = match 0 {
+        IDENTITY::<1> => 2,
+        IDENTITY::<{ 1 + 1 }> => 4,
+        _ => 0,
+    };
+
+    const CREATE<I: Inhabited>: I = I::PROOF;
+    let _ = CREATE::<u64>;
+    let _: u64 = CREATE; // arg inferred
+
+    let _ = <() as Main<u64>>::MAKE::<u64>;
+    let _: (u64, u64) = <()>::MAKE; // args inferred
+}
+
+pub fn usage<'any>() {
+    const REGION_POLY<'a>: &'a () = &();
+
+    let _: &'any () = REGION_POLY::<'any>;
+    let _: &'any () = REGION_POLY::<'_>;
+    let _: &'static () = REGION_POLY;
+}
+
+trait Main<O> {
+    type Output<I>;
+    const MAKE<I: Inhabited>: Self::Output<I>;
+}
+
+impl<O: Inhabited> Main<O> for () {
+    type Output<I> = (O, I);
+    const MAKE<I: Inhabited>: Self::Output<I> = (O::PROOF, I::PROOF);
+}
+
+trait Inhabited {
+    const PROOF: Self;
+}
+
+impl Inhabited for u64 {
+    const PROOF: Self = 512;
+}
diff --git a/tests/ui/generic-const-items/compare-impl-item.rs b/tests/ui/generic-const-items/compare-impl-item.rs
new file mode 100644
index 00000000000..01e4477c698
--- /dev/null
+++ b/tests/ui/generic-const-items/compare-impl-item.rs
@@ -0,0 +1,30 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+trait Trait<P> {
+    const A: ();
+    const B<const K: u64, const Q: u64>: u64;
+    const C<T>: T;
+    const D<const N: usize>: usize;
+
+    const E: usize;
+    const F<T: PartialEq>: ();
+}
+
+impl<P> Trait<P> for () {
+    const A<T>: () = ();
+    //~^ ERROR const `A` has 1 type parameter but its trait declaration has 0 type parameters
+    const B<const K: u64>: u64 = 0;
+    //~^ ERROR const `B` has 1 const parameter but its trait declaration has 2 const parameters
+    const C<'a>: &'a str = "";
+    //~^ ERROR const `C` has 0 type parameters but its trait declaration has 1 type parameter
+    const D<const N: u16>: u16 = N;
+    //~^ ERROR const `D` has an incompatible generic parameter for trait `Trait`
+
+    const E: usize = 1024
+    where
+        P: Copy; //~ ERROR impl has stricter requirements than trait
+    const F<T: Eq>: () = (); //~ ERROR impl has stricter requirements than trait
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/compare-impl-item.stderr b/tests/ui/generic-const-items/compare-impl-item.stderr
new file mode 100644
index 00000000000..8610d8cba00
--- /dev/null
+++ b/tests/ui/generic-const-items/compare-impl-item.stderr
@@ -0,0 +1,66 @@
+error[E0049]: const `A` has 1 type parameter but its trait declaration has 0 type parameters
+  --> $DIR/compare-impl-item.rs:15:13
+   |
+LL |     const A: ();
+   |            - expected 0 type parameters
+...
+LL |     const A<T>: () = ();
+   |             ^ found 1 type parameter
+
+error[E0049]: const `B` has 1 const parameter but its trait declaration has 2 const parameters
+  --> $DIR/compare-impl-item.rs:17:13
+   |
+LL |     const B<const K: u64, const Q: u64>: u64;
+   |             ------------  ------------
+   |             |
+   |             expected 2 const parameters
+...
+LL |     const B<const K: u64>: u64 = 0;
+   |             ^^^^^^^^^^^^ found 1 const parameter
+
+error[E0049]: const `C` has 0 type parameters but its trait declaration has 1 type parameter
+  --> $DIR/compare-impl-item.rs:19:13
+   |
+LL |     const C<T>: T;
+   |             - expected 1 type parameter
+...
+LL |     const C<'a>: &'a str = "";
+   |             ^^ found 0 type parameters
+
+error[E0053]: const `D` has an incompatible generic parameter for trait `Trait`
+  --> $DIR/compare-impl-item.rs:21:13
+   |
+LL | trait Trait<P> {
+   |       -----
+...
+LL |     const D<const N: usize>: usize;
+   |             -------------- expected const parameter of type `usize`
+...
+LL | impl<P> Trait<P> for () {
+   | -----------------------
+...
+LL |     const D<const N: u16>: u16 = N;
+   |             ^^^^^^^^^^^^ found const parameter of type `u16`
+
+error[E0276]: impl has stricter requirements than trait
+  --> $DIR/compare-impl-item.rs:26:12
+   |
+LL |     const E: usize;
+   |     -------------- definition of `E` from trait
+...
+LL |         P: Copy;
+   |            ^^^^ impl has extra requirement `P: Copy`
+
+error[E0276]: impl has stricter requirements than trait
+  --> $DIR/compare-impl-item.rs:27:16
+   |
+LL |     const F<T: PartialEq>: ();
+   |     ------------------------- definition of `F` from trait
+...
+LL |     const F<T: Eq>: () = ();
+   |                ^^ impl has extra requirement `T: Eq`
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0049, E0053, E0276.
+For more information about an error, try `rustc --explain E0049`.
diff --git a/tests/ui/generic-const-items/const-trait-impl.rs b/tests/ui/generic-const-items/const-trait-impl.rs
new file mode 100644
index 00000000000..8da1448df4f
--- /dev/null
+++ b/tests/ui/generic-const-items/const-trait-impl.rs
@@ -0,0 +1,24 @@
+// check-pass
+
+// Test that we can call methods from const trait impls inside of generic const items.
+
+#![feature(generic_const_items, const_trait_impl)]
+#![allow(incomplete_features)]
+#![crate_type = "lib"]
+
+// FIXME(generic_const_items): Interpret `~const` as always-const.
+const CREATE<T: ~const Create>: T = T::create();
+
+pub const K0: i32 = CREATE::<i32>;
+pub const K1: i32 = CREATE; // arg inferred
+
+#[const_trait]
+trait Create {
+    fn create() -> Self;
+}
+
+impl const Create for i32 {
+    fn create() -> i32 {
+        4096
+    }
+}
diff --git a/tests/ui/generic-const-items/duplicate-where-clause.rs b/tests/ui/generic-const-items/duplicate-where-clause.rs
new file mode 100644
index 00000000000..68da4073fc1
--- /dev/null
+++ b/tests/ui/generic-const-items/duplicate-where-clause.rs
@@ -0,0 +1,27 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+trait Tr<P> {
+    const K: ()
+    where
+        P: Copy
+    where
+        P: Eq;
+    //~^ ERROR cannot define duplicate `where` clauses on an item
+}
+
+// Test that we error on the first where-clause but also that we don't suggest to swap it with the
+// body as it would conflict with the second where-clause.
+// FIXME(generic_const_items): We should provide a structured sugg to merge the 1st into the 2nd WC.
+
+impl<P> Tr<P> for () {
+    const K: ()
+    where
+        P: Eq
+    = ()
+    where
+        P: Copy;
+    //~^^^^^ ERROR where clauses are not allowed before const item bodies
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/duplicate-where-clause.stderr b/tests/ui/generic-const-items/duplicate-where-clause.stderr
new file mode 100644
index 00000000000..5fa61b01ee9
--- /dev/null
+++ b/tests/ui/generic-const-items/duplicate-where-clause.stderr
@@ -0,0 +1,27 @@
+error: cannot define duplicate `where` clauses on an item
+  --> $DIR/duplicate-where-clause.rs:9:9
+   |
+LL |         P: Copy
+   |         - previous `where` clause starts here
+LL |     where
+LL |         P: Eq;
+   |         ^
+   |
+help: consider joining the two `where` clauses into one
+   |
+LL |         P: Copy,
+   |                ~
+
+error: where clauses are not allowed before const item bodies
+  --> $DIR/duplicate-where-clause.rs:19:5
+   |
+LL |       const K: ()
+   |             - while parsing this const item
+LL | /     where
+LL | |         P: Eq
+   | |_____________^ unexpected where clause
+LL |       = ()
+   |         -- the item body
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/generic-const-items/elided-lifetimes.rs b/tests/ui/generic-const-items/elided-lifetimes.rs
new file mode 100644
index 00000000000..cca73e2e81e
--- /dev/null
+++ b/tests/ui/generic-const-items/elided-lifetimes.rs
@@ -0,0 +1,18 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// Check that we forbid elided lifetimes inside the generics of const items.
+
+const K<T>: () = ()
+where
+    &T: Copy; //~ ERROR `&` without an explicit lifetime name cannot be used here
+
+const I<const S: &str>: &str = "";
+//~^ ERROR `&` without an explicit lifetime name cannot be used here
+//~| ERROR `&str` is forbidden as the type of a const generic parameter
+
+const B<T: Trait<'_>>: () = (); //~ ERROR `'_` cannot be used here
+
+trait Trait<'a> {}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/elided-lifetimes.stderr b/tests/ui/generic-const-items/elided-lifetimes.stderr
new file mode 100644
index 00000000000..8cd3f9ee7a9
--- /dev/null
+++ b/tests/ui/generic-const-items/elided-lifetimes.stderr
@@ -0,0 +1,35 @@
+error[E0637]: `&` without an explicit lifetime name cannot be used here
+  --> $DIR/elided-lifetimes.rs:8:5
+   |
+LL |     &T: Copy;
+   |     ^ explicit lifetime name needed here
+   |
+help: consider introducing a higher-ranked lifetime here
+   |
+LL |     for<'a> &'a T: Copy;
+   |     +++++++  ++
+
+error[E0637]: `&` without an explicit lifetime name cannot be used here
+  --> $DIR/elided-lifetimes.rs:10:18
+   |
+LL | const I<const S: &str>: &str = "";
+   |                  ^ explicit lifetime name needed here
+
+error[E0637]: `'_` cannot be used here
+  --> $DIR/elided-lifetimes.rs:14:18
+   |
+LL | const B<T: Trait<'_>>: () = ();
+   |                  ^^ `'_` is a reserved lifetime name
+
+error: `&str` is forbidden as the type of a const generic parameter
+  --> $DIR/elided-lifetimes.rs:10:18
+   |
+LL | const I<const S: &str>: &str = "";
+   |                  ^^^^
+   |
+   = note: the only supported types are integers, `bool` and `char`
+   = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0637`.
diff --git a/tests/ui/generic-const-items/evaluatable-bounds.rs b/tests/ui/generic-const-items/evaluatable-bounds.rs
new file mode 100644
index 00000000000..cdcfcf9188a
--- /dev/null
+++ b/tests/ui/generic-const-items/evaluatable-bounds.rs
@@ -0,0 +1,31 @@
+// This is a regression test for issue #104400.
+
+// revisions: unconstrained constrained
+//[constrained] check-pass
+
+// Test that we can constrain generic const items that appear inside associated consts by
+// adding a (makeshift) "evaluatable"-bound to the item.
+
+#![feature(generic_const_items, generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Trait {
+    const LEN: usize;
+
+    #[cfg(unconstrained)]
+    const ARRAY: [i32; Self::LEN]; //[unconstrained]~ ERROR unconstrained generic constant
+
+    #[cfg(constrained)]
+    const ARRAY: [i32; Self::LEN]
+    where
+        [(); Self::LEN]:;
+}
+
+impl Trait for () {
+    const LEN: usize = 2;
+    const ARRAY: [i32; Self::LEN] = [360, 720];
+}
+
+fn main() {
+    let [_, _] = <() as Trait>::ARRAY;
+}
diff --git a/tests/ui/generic-const-items/evaluatable-bounds.unconstrained.stderr b/tests/ui/generic-const-items/evaluatable-bounds.unconstrained.stderr
new file mode 100644
index 00000000000..930080f7c37
--- /dev/null
+++ b/tests/ui/generic-const-items/evaluatable-bounds.unconstrained.stderr
@@ -0,0 +1,10 @@
+error: unconstrained generic constant
+  --> $DIR/evaluatable-bounds.rs:16:5
+   |
+LL |     const ARRAY: [i32; Self::LEN];
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: try adding a `where` bound using this expression: `where [(); Self::LEN]:`
+
+error: aborting due to previous error
+
diff --git a/tests/ui/generic-const-items/feature-gate-generic_const_items.rs b/tests/ui/generic-const-items/feature-gate-generic_const_items.rs
new file mode 100644
index 00000000000..5c241f256eb
--- /dev/null
+++ b/tests/ui/generic-const-items/feature-gate-generic_const_items.rs
@@ -0,0 +1,37 @@
+pub trait Trait<A> {
+    const ONE<T>: i32;
+    //~^ ERROR generic const items are experimental
+
+    const TWO: ()
+    where
+        A: Copy;
+    //~^^ ERROR generic const items are experimental
+}
+
+const CONST<T>: i32 = 0;
+//~^ ERROR generic const items are experimental
+
+const EMPTY<>: i32 = 0;
+//~^ ERROR generic const items are experimental
+
+const TRUE: () = ()
+where
+    String: Clone;
+//~^^ ERROR generic const items are experimental
+
+// Ensure that we flag generic const items inside macro calls as well:
+
+macro_rules! discard {
+    ($item:item) => {}
+}
+
+discard! { const FREE<T>: () = (); }
+//~^ ERROR generic const items are experimental
+
+discard! { impl () { const ASSOC<const N: ()>: () = (); } }
+//~^ ERROR generic const items are experimental
+
+discard! { impl () { const ASSOC: i32 = 0 where String: Copy; } }
+//~^ ERROR generic const items are experimental
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/feature-gate-generic_const_items.stderr b/tests/ui/generic-const-items/feature-gate-generic_const_items.stderr
new file mode 100644
index 00000000000..a1fdf5f6ef3
--- /dev/null
+++ b/tests/ui/generic-const-items/feature-gate-generic_const_items.stderr
@@ -0,0 +1,77 @@
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:2:14
+   |
+LL |     const ONE<T>: i32;
+   |              ^^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:6:5
+   |
+LL | /     where
+LL | |         A: Copy;
+   | |_______________^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:11:12
+   |
+LL | const CONST<T>: i32 = 0;
+   |            ^^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:14:12
+   |
+LL | const EMPTY<>: i32 = 0;
+   |            ^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:18:1
+   |
+LL | / where
+LL | |     String: Clone;
+   | |_________________^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:28:22
+   |
+LL | discard! { const FREE<T>: () = (); }
+   |                      ^^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:31:33
+   |
+LL | discard! { impl () { const ASSOC<const N: ()>: () = (); } }
+   |                                 ^^^^^^^^^^^^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error[E0658]: generic const items are experimental
+  --> $DIR/feature-gate-generic_const_items.rs:34:43
+   |
+LL | discard! { impl () { const ASSOC: i32 = 0 where String: Copy; } }
+   |                                           ^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
+   = help: add `#![feature(generic_const_items)]` to the crate attributes to enable
+
+error: aborting due to 8 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/generic-const-items/inference-failure.rs b/tests/ui/generic-const-items/inference-failure.rs
new file mode 100644
index 00000000000..fd4f424dd97
--- /dev/null
+++ b/tests/ui/generic-const-items/inference-failure.rs
@@ -0,0 +1,15 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+const NONE<T>: Option<T> = None::<T>;
+const IGNORE<T>: () = ();
+
+fn none() {
+    let _ = NONE; //~ ERROR type annotations needed
+}
+
+fn ignore() {
+    let _ = IGNORE; //~ ERROR type annotations needed
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/inference-failure.stderr b/tests/ui/generic-const-items/inference-failure.stderr
new file mode 100644
index 00000000000..22ff1b9ba7f
--- /dev/null
+++ b/tests/ui/generic-const-items/inference-failure.stderr
@@ -0,0 +1,20 @@
+error[E0282]: type annotations needed for `Option<T>`
+  --> $DIR/inference-failure.rs:8:9
+   |
+LL |     let _ = NONE;
+   |         ^
+   |
+help: consider giving this pattern a type, where the type for type parameter `T` is specified
+   |
+LL |     let _: Option<T> = NONE;
+   |          +++++++++++
+
+error[E0282]: type annotations needed
+  --> $DIR/inference-failure.rs:12:13
+   |
+LL |     let _ = IGNORE;
+   |             ^^^^^^ cannot infer type for type parameter `T` declared on the constant `IGNORE`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/generic-const-items/misplaced-where-clause.fixed b/tests/ui/generic-const-items/misplaced-where-clause.fixed
new file mode 100644
index 00000000000..bff470c2883
--- /dev/null
+++ b/tests/ui/generic-const-items/misplaced-where-clause.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+
+#![feature(generic_const_items)]
+#![allow(incomplete_features, dead_code)]
+
+const K<T>: u64
+= T::K where
+    T: Tr<()>;
+//~^^^ ERROR where clauses are not allowed before const item bodies
+
+trait Tr<P> {
+    const K: u64
+    = 0 where
+        P: Copy;
+    //~^^^ ERROR where clauses are not allowed before const item bodies
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/misplaced-where-clause.rs b/tests/ui/generic-const-items/misplaced-where-clause.rs
new file mode 100644
index 00000000000..b14c6d594a5
--- /dev/null
+++ b/tests/ui/generic-const-items/misplaced-where-clause.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+#![feature(generic_const_items)]
+#![allow(incomplete_features, dead_code)]
+
+const K<T>: u64
+where
+    T: Tr<()>
+= T::K;
+//~^^^ ERROR where clauses are not allowed before const item bodies
+
+trait Tr<P> {
+    const K: u64
+    where
+        P: Copy
+    = 0;
+    //~^^^ ERROR where clauses are not allowed before const item bodies
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/misplaced-where-clause.stderr b/tests/ui/generic-const-items/misplaced-where-clause.stderr
new file mode 100644
index 00000000000..431741d8724
--- /dev/null
+++ b/tests/ui/generic-const-items/misplaced-where-clause.stderr
@@ -0,0 +1,36 @@
+error: where clauses are not allowed before const item bodies
+  --> $DIR/misplaced-where-clause.rs:7:1
+   |
+LL |   const K<T>: u64
+   |         - while parsing this const item
+LL | / where
+LL | |     T: Tr<()>
+   | |_____________^ unexpected where clause
+LL |   = T::K;
+   |     ---- the item body
+   |
+help: move the body before the where clause
+   |
+LL ~ = T::K where
+LL ~     T: Tr<()>;
+   |
+
+error: where clauses are not allowed before const item bodies
+  --> $DIR/misplaced-where-clause.rs:14:5
+   |
+LL |       const K: u64
+   |             - while parsing this const item
+LL | /     where
+LL | |         P: Copy
+   | |_______________^ unexpected where clause
+LL |       = 0;
+   |         - the item body
+   |
+help: move the body before the where clause
+   |
+LL ~     = 0 where
+LL ~         P: Copy;
+   |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/generic-const-items/parameter-defaults.rs b/tests/ui/generic-const-items/parameter-defaults.rs
new file mode 100644
index 00000000000..a6f82c249fe
--- /dev/null
+++ b/tests/ui/generic-const-items/parameter-defaults.rs
@@ -0,0 +1,14 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// Check that we emit a *hard* error (not just a lint warning or error for example) for generic
+// parameter defaults on free const items since we are not limited by backward compatibility.
+#![allow(invalid_type_param_default)] // Should have no effect here.
+
+// FIXME(default_type_parameter_fallback): Consider reallowing them once they work properly.
+
+const NONE<T = ()>: Option<T> = None::<T>; //~ ERROR defaults for type parameters are only allowed
+
+fn main() {
+    let _ = NONE;
+}
diff --git a/tests/ui/generic-const-items/parameter-defaults.stderr b/tests/ui/generic-const-items/parameter-defaults.stderr
new file mode 100644
index 00000000000..62da45e55d6
--- /dev/null
+++ b/tests/ui/generic-const-items/parameter-defaults.stderr
@@ -0,0 +1,8 @@
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/parameter-defaults.rs:10:12
+   |
+LL | const NONE<T = ()>: Option<T> = None::<T>;
+   |            ^^^^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/generic-const-items/recursive.rs b/tests/ui/generic-const-items/recursive.rs
new file mode 100644
index 00000000000..3266b37d380
--- /dev/null
+++ b/tests/ui/generic-const-items/recursive.rs
@@ -0,0 +1,12 @@
+// FIXME(generic_const_items): This leads to a stack overflow in the compiler!
+// known-bug: unknown
+// ignore-test
+
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+const RECUR<T>: () = RECUR::<(T,)>;
+
+fn main() {
+    let _ = RECUR::<()>;
+}
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs
new file mode 100644
index 00000000000..dd00b327d2d
--- /dev/null
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs
@@ -0,0 +1,12 @@
+#![feature(generic_const_items, trivial_bounds)]
+#![allow(incomplete_features)]
+
+// Ensure that we check if trivial bounds on const items hold or not.
+
+const UNUSABLE: () = ()
+where
+    String: Copy;
+
+fn main() {
+    let _ = UNUSABLE; //~ ERROR the trait bound `String: Copy` is not satisfied
+}
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr
new file mode 100644
index 00000000000..c3ef94529a4
--- /dev/null
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `String: Copy` is not satisfied
+  --> $DIR/trivially-unsatisfied-bounds-0.rs:11:13
+   |
+LL |     let _ = UNUSABLE;
+   |             ^^^^^^^^ the trait `Copy` is not implemented for `String`
+   |
+note: required by a bound in `UNUSABLE`
+  --> $DIR/trivially-unsatisfied-bounds-0.rs:8:13
+   |
+LL | const UNUSABLE: () = ()
+   |       -------- required by a bound in this constant
+LL | where
+LL |     String: Copy;
+   |             ^^^^ required by this bound in `UNUSABLE`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.rs b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.rs
new file mode 100644
index 00000000000..9243deac870
--- /dev/null
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.rs
@@ -0,0 +1,12 @@
+#![feature(generic_const_items, trivial_bounds)]
+#![allow(incomplete_features, dead_code, trivial_bounds)]
+
+// FIXME(generic_const_items): This looks like a bug to me. I expected that we wouldn't emit any
+// errors. I thought we'd skip the evaluation of consts whose bounds don't hold.
+
+const UNUSED: () = ()
+where
+    String: Copy;
+//~^^^ ERROR evaluation of constant value failed
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.stderr b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.stderr
new file mode 100644
index 00000000000..a68400798d8
--- /dev/null
+++ b/tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.stderr
@@ -0,0 +1,11 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/trivially-unsatisfied-bounds-1.rs:7:1
+   |
+LL | / const UNUSED: () = ()
+LL | | where
+LL | |     String: Copy;
+   | |_________________^ entering unreachable code
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/generic-const-items/unsatisfied-bounds.rs b/tests/ui/generic-const-items/unsatisfied-bounds.rs
new file mode 100644
index 00000000000..05879900172
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-bounds.rs
@@ -0,0 +1,34 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// Ensure that we check if bounds on const items hold or not.
+
+use std::convert::Infallible;
+
+const C<T: Copy>: () = ();
+
+const K<T>: () = ()
+where
+    Infallible: From<T>;
+
+trait Trait<P> {
+    const A: u32
+    where
+        P: Copy;
+
+    const B<T>: u32
+    where
+        Infallible: From<T>;
+}
+
+impl<P> Trait<P> for () {
+    const A: u32 = 0;
+    const B<T>: u32 = 1;
+}
+
+fn main() {
+    let () = C::<String>; //~ ERROR the trait bound `String: Copy` is not satisfied
+    let () = K::<()>; //~ ERROR the trait bound `Infallible: From<()>` is not satisfied
+    let _ = <() as Trait<Vec<u8>>>::A; //~ ERROR the trait bound `Vec<u8>: Copy` is not satisfied
+    let _ = <() as Trait<&'static str>>::B::<()>; //~ ERROR the trait bound `Infallible: From<()>` is not satisfied
+}
diff --git a/tests/ui/generic-const-items/unsatisfied-bounds.stderr b/tests/ui/generic-const-items/unsatisfied-bounds.stderr
new file mode 100644
index 00000000000..1fda460372a
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-bounds.stderr
@@ -0,0 +1,62 @@
+error[E0277]: the trait bound `String: Copy` is not satisfied
+  --> $DIR/unsatisfied-bounds.rs:30:18
+   |
+LL |     let () = C::<String>;
+   |                  ^^^^^^ the trait `Copy` is not implemented for `String`
+   |
+note: required by a bound in `C`
+  --> $DIR/unsatisfied-bounds.rs:8:12
+   |
+LL | const C<T: Copy>: () = ();
+   |            ^^^^ required by this bound in `C`
+
+error[E0277]: the trait bound `Infallible: From<()>` is not satisfied
+  --> $DIR/unsatisfied-bounds.rs:31:18
+   |
+LL |     let () = K::<()>;
+   |                  ^^ the trait `From<()>` is not implemented for `Infallible`
+   |
+   = help: the trait `From<!>` is implemented for `Infallible`
+note: required by a bound in `K`
+  --> $DIR/unsatisfied-bounds.rs:12:17
+   |
+LL | const K<T>: () = ()
+   |       - required by a bound in this constant
+LL | where
+LL |     Infallible: From<T>;
+   |                 ^^^^^^^ required by this bound in `K`
+
+error[E0277]: the trait bound `Vec<u8>: Copy` is not satisfied
+  --> $DIR/unsatisfied-bounds.rs:32:13
+   |
+LL |     let _ = <() as Trait<Vec<u8>>>::A;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Vec<u8>`
+   |
+note: required by a bound in `Trait::A`
+  --> $DIR/unsatisfied-bounds.rs:17:12
+   |
+LL |     const A: u32
+   |           - required by a bound in this associated constant
+LL |     where
+LL |         P: Copy;
+   |            ^^^^ required by this bound in `Trait::A`
+
+error[E0277]: the trait bound `Infallible: From<()>` is not satisfied
+  --> $DIR/unsatisfied-bounds.rs:33:46
+   |
+LL |     let _ = <() as Trait<&'static str>>::B::<()>;
+   |                                              ^^ the trait `From<()>` is not implemented for `Infallible`
+   |
+   = help: the trait `From<!>` is implemented for `Infallible`
+note: required by a bound in `Trait::B`
+  --> $DIR/unsatisfied-bounds.rs:21:21
+   |
+LL |     const B<T>: u32
+   |           - required by a bound in this associated constant
+LL |     where
+LL |         Infallible: From<T>;
+   |                     ^^^^^^^ required by this bound in `Trait::B`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.rs b/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.rs
new file mode 100644
index 00000000000..961e5b4aeeb
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.rs
@@ -0,0 +1,12 @@
+#![feature(generic_const_items, generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// Ensure that we check if (makeshift) "evaluatable"-bounds on const items hold or not.
+
+const POSITIVE<const N: usize>: usize = N
+where
+    [(); N - 1]:; //~ ERROR evaluation of `POSITIVE::<0>::{constant#0}` failed
+
+fn main() {
+    let _ = POSITIVE::<0>;
+}
diff --git a/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.stderr b/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.stderr
new file mode 100644
index 00000000000..bed213b0caa
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-evaluatable-bounds.stderr
@@ -0,0 +1,9 @@
+error[E0080]: evaluation of `POSITIVE::<0>::{constant#0}` failed
+  --> $DIR/unsatisfied-evaluatable-bounds.rs:8:10
+   |
+LL |     [(); N - 1]:;
+   |          ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs
new file mode 100644
index 00000000000..204cf9def36
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs
@@ -0,0 +1,17 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// Ensure that we check if outlives-bounds on const items hold or not.
+
+const C<'a, T: 'a>: () = ();
+const K<'a, 'b: 'a>: () = ();
+
+fn parametrized0<'any>() {
+    let () = C::<'static, &'any ()>; //~ ERROR lifetime may not live long enough
+}
+
+fn parametrized1<'any>() {
+    let () = K::<'static, 'any>; //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}
diff --git a/tests/ui/generic-const-items/unsatisfied-outlives-bounds.stderr b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.stderr
new file mode 100644
index 00000000000..72e4265b3d7
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.stderr
@@ -0,0 +1,18 @@
+error: lifetime may not live long enough
+  --> $DIR/unsatisfied-outlives-bounds.rs:10:14
+   |
+LL | fn parametrized0<'any>() {
+   |                  ---- lifetime `'any` defined here
+LL |     let () = C::<'static, &'any ()>;
+   |              ^^^^^^^^^^^^^^^^^^^^^^ requires that `'any` must outlive `'static`
+
+error: lifetime may not live long enough
+  --> $DIR/unsatisfied-outlives-bounds.rs:14:14
+   |
+LL | fn parametrized1<'any>() {
+   |                  ---- lifetime `'any` defined here
+LL |     let () = K::<'static, 'any>;
+   |              ^^^^^^^^^^^^^^^^^^ requires that `'any` must outlive `'static`
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/generics/issue-94923.rs b/tests/ui/generics/issue-94923.rs
index d337a5dffc9..893bac0d5e8 100644
--- a/tests/ui/generics/issue-94923.rs
+++ b/tests/ui/generics/issue-94923.rs
@@ -1,6 +1,5 @@
 // run-pass
 // regression test for issue #94923
-// min-llvm-version: 15.0.0
 // compile-flags: -C opt-level=3
 
 fn f0<T>(mut x: usize) -> usize {
diff --git a/tests/ui/hello_world/main.rs b/tests/ui/hello_world/main.rs
index 22ce47414b2..39cb74b709b 100644
--- a/tests/ui/hello_world/main.rs
+++ b/tests/ui/hello_world/main.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// build-pass
 
 // Test that compiling hello world succeeds with no output of any kind.
 
diff --git a/tests/ui/impl-trait/auto-trait-leak b/tests/ui/impl-trait/auto-trait-leak
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/tests/ui/impl-trait/auto-trait-leak
diff --git a/tests/ui/impl-trait/autoderef.rs b/tests/ui/impl-trait/autoderef.rs
index 0d07a549640..cd2cdd9e3b3 100644
--- a/tests/ui/impl-trait/autoderef.rs
+++ b/tests/ui/impl-trait/autoderef.rs
@@ -1,5 +1,5 @@
 // revisions: current next
-//[next] compile-flag: -Ztrait-solver=next
+//[next] compile-flags: -Ztrait-solver=next
 // check-pass
 
 use std::path::Path;
diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.rs b/tests/ui/impl-trait/hidden-type-is-opaque-2.rs
index 970d84120e0..212e7b10802 100644
--- a/tests/ui/impl-trait/hidden-type-is-opaque-2.rs
+++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.rs
@@ -6,7 +6,8 @@
 
 fn reify_as() -> Thunk<impl FnOnce(Continuation) -> Continuation> {
     Thunk::new(|mut cont| {
-        cont.reify_as(); //~ ERROR type annotations needed
+        //~^ ERROR type annotations needed
+        cont.reify_as();
         cont
     })
 }
@@ -15,7 +16,8 @@ type Tait = impl FnOnce(Continuation) -> Continuation;
 
 fn reify_as_tait() -> Thunk<Tait> {
     Thunk::new(|mut cont| {
-        cont.reify_as(); //~ ERROR type annotations needed
+        //~^ ERROR type annotations needed
+        cont.reify_as();
         cont
     })
 }
diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr b/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr
index 957052feba9..39bf2214232 100644
--- a/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr
+++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.stderr
@@ -1,14 +1,30 @@
 error[E0282]: type annotations needed
-  --> $DIR/hidden-type-is-opaque-2.rs:9:9
+  --> $DIR/hidden-type-is-opaque-2.rs:8:17
    |
+LL |     Thunk::new(|mut cont| {
+   |                 ^^^^^^^^
+LL |
 LL |         cont.reify_as();
-   |         ^^^^ cannot infer type
+   |         ---- type must be known at this point
+   |
+help: consider giving this closure parameter an explicit type
+   |
+LL |     Thunk::new(|mut cont: /* Type */| {
+   |                         ++++++++++++
 
 error[E0282]: type annotations needed
-  --> $DIR/hidden-type-is-opaque-2.rs:18:9
+  --> $DIR/hidden-type-is-opaque-2.rs:18:17
    |
+LL |     Thunk::new(|mut cont| {
+   |                 ^^^^^^^^
+LL |
 LL |         cont.reify_as();
-   |         ^^^^ cannot infer type
+   |         ---- type must be known at this point
+   |
+help: consider giving this closure parameter an explicit type
+   |
+LL |     Thunk::new(|mut cont: /* Type */| {
+   |                         ++++++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs b/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs
new file mode 100644
index 00000000000..2a61c5cc8df
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs
@@ -0,0 +1,29 @@
+// check-pass
+// edition: 2021
+// issue: 113796
+
+#![feature(async_fn_in_trait)]
+
+trait AsyncLendingIterator {
+    type Item<'a>
+    where
+        Self: 'a;
+
+    async fn next(&mut self) -> Option<Self::Item<'_>>;
+}
+
+struct Lend<I>(I);
+impl<I> AsyncLendingIterator for Lend<I> {
+    type Item<'a> = &'a I
+    where
+        Self: 'a;
+
+    // Checking that the synthetic `<Self as AsyncLendingIterator>::next()` GAT
+    // is well-formed requires being able to assume the WF types of `next`.
+
+    async fn next(&mut self) -> Option<Self::Item<'_>> {
+        todo!()
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
new file mode 100644
index 00000000000..3a93dfee57f
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
@@ -0,0 +1,11 @@
+// issue: 114146
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {
+    fn bar<'other: 'a>() -> impl Sized + 'a {}
+    //~^ ERROR use of undeclared lifetime name `'a`
+    //~| ERROR use of undeclared lifetime name `'a`
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
new file mode 100644
index 00000000000..3a1f8f90837
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
@@ -0,0 +1,33 @@
+error[E0261]: use of undeclared lifetime name `'a`
+  --> $DIR/bad-item-bound-within-rpitit-2.rs:6:20
+   |
+LL |     fn bar<'other: 'a>() -> impl Sized + 'a {}
+   |                    ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
+   |            +++
+help: consider introducing lifetime `'a` here
+   |
+LL | trait Foo<'a> {
+   |          ++++
+
+error[E0261]: use of undeclared lifetime name `'a`
+  --> $DIR/bad-item-bound-within-rpitit-2.rs:6:42
+   |
+LL |     fn bar<'other: 'a>() -> impl Sized + 'a {}
+   |                                          ^^ undeclared lifetime
+   |
+help: consider introducing lifetime `'a` here
+   |
+LL |     fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
+   |            +++
+help: consider introducing lifetime `'a` here
+   |
+LL | trait Foo<'a> {
+   |          ++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
new file mode 100644
index 00000000000..ff7ad4bf389
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
@@ -0,0 +1,24 @@
+// issue: 114145
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Iterable {
+    type Item<'a>
+    where
+        Self: 'a;
+
+    fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
+}
+
+impl<'a, I: 'a + Iterable> Iterable for &'a I {
+    type Item<'b> = I::Item<'a>
+    where
+        'b: 'a;
+    //~^ ERROR impl has stricter requirements than trait
+
+    fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
+        (*self).iter()
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr
new file mode 100644
index 00000000000..106b8a7c804
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr
@@ -0,0 +1,17 @@
+error[E0276]: impl has stricter requirements than trait
+  --> $DIR/bad-item-bound-within-rpitit.rs:16:13
+   |
+LL |     type Item<'a>
+   |     ------------- definition of `Item` from trait
+...
+LL |         'b: 'a;
+   |             ^^ impl has extra requirement `'b: 'a`
+   |
+help: copy the `where` clause predicates from the trait
+   |
+LL |     where Self: 'b;
+   |     ~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0276`.
diff --git a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs
new file mode 100644
index 00000000000..742537ffcc4
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs
@@ -0,0 +1,10 @@
+#![feature(return_position_impl_trait_in_trait)]
+
+struct Wrapper<G: Send>(G);
+
+trait Foo {
+    fn bar() -> Wrapper<impl Sized>;
+    //~^ ERROR `impl Sized` cannot be sent between threads safely
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
new file mode 100644
index 00000000000..dee87d08238
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
@@ -0,0 +1,16 @@
+error[E0277]: `impl Sized` cannot be sent between threads safely
+  --> $DIR/check-wf-on-non-defaulted-rpitit.rs:6:17
+   |
+LL |     fn bar() -> Wrapper<impl Sized>;
+   |                 ^^^^^^^^^^^^^^^^^^^ `impl Sized` cannot be sent between threads safely
+   |
+   = help: the trait `Send` is not implemented for `impl Sized`
+note: required by a bound in `Wrapper`
+  --> $DIR/check-wf-on-non-defaulted-rpitit.rs:3:19
+   |
+LL | struct Wrapper<G: Send>(G);
+   |                   ^^^^ required by this bound in `Wrapper`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
index 0558d95128f..25133214dc6 100644
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
@@ -1,5 +1,5 @@
 // edition:2021
-// known-bug: #108304
+// check-pass
 
 #![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
 #![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr
deleted file mode 100644
index b5fc9d44d36..00000000000
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error: concrete type differs from previous defining opaque type use
-  --> $DIR/default-body-with-rpit.rs:11:9
-   |
-LL |         ""
-   |         ^^ expected `impl Debug`, got `&'static str`
-   |
-note: previous use here
-  --> $DIR/default-body-with-rpit.rs:10:39
-   |
-LL |       async fn baz(&self) -> impl Debug {
-   |  _______________________________________^
-LL | |         ""
-LL | |     }
-   | |_____^
-
-error[E0720]: cannot resolve opaque type
-  --> $DIR/default-body-with-rpit.rs:10:28
-   |
-LL |     async fn baz(&self) -> impl Debug {
-   |                            ^^^^^^^^^^ cannot resolve opaque type
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs
new file mode 100644
index 00000000000..7682884f879
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs
@@ -0,0 +1,18 @@
+// issue: 113903
+
+#![feature(return_position_impl_trait_in_trait)]
+
+use std::ops::Deref;
+
+pub trait Tr {
+    fn w() -> impl Deref<Target = Missing<impl Sized>>;
+    //~^ ERROR cannot find type `Missing` in this scope
+}
+
+impl Tr for () {
+    fn w() -> &'static () {
+        &()
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr
new file mode 100644
index 00000000000..6e4a5bb5df3
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+  --> $DIR/rpitit-shadowed-by-missing-adt.rs:8:35
+   |
+LL |     fn w() -> impl Deref<Target = Missing<impl Sized>>;
+   |                                   ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.stderr
index beac6620911..4d60b133048 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.stderr
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.stderr
@@ -47,10 +47,6 @@ note: required by a bound in `NeedsDisplay`
    |
 LL | struct NeedsDisplay<T: Display>(T);
    |                        ^^^^^^^ required by this bound in `NeedsDisplay`
-help: consider restricting type parameter `T`
-   |
-LL |     fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
-   |              +++++++++++++++++++
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/impl-trait/normalize-tait-in-const.rs b/tests/ui/impl-trait/normalize-tait-in-const.rs
index d2e34c00b64..dd03fd3f754 100644
--- a/tests/ui/impl-trait/normalize-tait-in-const.rs
+++ b/tests/ui/impl-trait/normalize-tait-in-const.rs
@@ -1,9 +1,4 @@
 // known-bug: #103507
-// failure-status: 101
-// normalize-stderr-test "note: .*\n\n" -> ""
-// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
-// normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
-// rustc-env:RUST_BACKTRACE=0
 
 #![feature(type_alias_impl_trait)]
 #![feature(const_trait_impl)]
diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr
index 84b00918724..06247e2ea1e 100644
--- a/tests/ui/impl-trait/normalize-tait-in-const.stderr
+++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr
@@ -1,8 +1,12 @@
-error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:LL:CC: Failed to normalize <for<'a, 'b> fn(&'a Alias<'b>) {foo} as std::ops::FnOnce<(&&S,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead
+error[E0493]: destructor of `F` cannot be evaluated at compile-time
+  --> $DIR/normalize-tait-in-const.rs:25:79
+   |
+LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
+   |                                                                               ^^^ the destructor for this type cannot be evaluated in constant functions
+LL |     fun(filter_positive());
+LL | }
+   | - value is dropped here
 
-query stack during panic:
-#0 [eval_to_allocation_raw] const-evaluating + checking `BAR`
-#1 [eval_to_const_value_raw] simplifying constant for the type system `BAR`
-end of query stack
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/impl-trait/recursive-auto-trait.rs b/tests/ui/impl-trait/recursive-auto-trait.rs
new file mode 100644
index 00000000000..d7b68144ff6
--- /dev/null
+++ b/tests/ui/impl-trait/recursive-auto-trait.rs
@@ -0,0 +1,10 @@
+// check-pass
+fn is_send<T: Send>(_: T) {}
+fn foo() -> impl Send {
+    if false {
+        is_send(foo());
+    }
+    ()
+}
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-1.rs b/tests/ui/imports/ambiguous-1.rs
new file mode 100644
index 00000000000..2c9815864f0
--- /dev/null
+++ b/tests/ui/imports/ambiguous-1.rs
@@ -0,0 +1,30 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883
+
+macro_rules! m {
+    () => {
+      pub fn id() {}
+    };
+}
+
+mod openssl {
+    pub use self::evp::*;
+    //~^ WARNING ambiguous glob re-exports
+    pub use self::handwritten::*;
+
+    mod evp {
+      m!();
+    }
+
+    mod handwritten {
+      m!();
+    }
+}
+
+pub use openssl::*;
+
+fn main() {
+    id();
+    //~^ WARNING `id` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-1.stderr b/tests/ui/imports/ambiguous-1.stderr
new file mode 100644
index 00000000000..61b3077c354
--- /dev/null
+++ b/tests/ui/imports/ambiguous-1.stderr
@@ -0,0 +1,36 @@
+warning: ambiguous glob re-exports
+  --> $DIR/ambiguous-1.rs:11:13
+   |
+LL |     pub use self::evp::*;
+   |             ^^^^^^^^^^^^ the name `id` in the value namespace is first re-exported here
+LL |
+LL |     pub use self::handwritten::*;
+   |             -------------------- but the name `id` in the value namespace is also re-exported here
+   |
+   = note: `#[warn(ambiguous_glob_reexports)]` on by default
+
+warning: `id` is ambiguous
+  --> $DIR/ambiguous-1.rs:27:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-1.rs:11:13
+   |
+LL |     pub use self::evp::*;
+   |             ^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-1.rs:13:13
+   |
+LL |     pub use self::handwritten::*;
+   |             ^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/imports/ambiguous-10.rs b/tests/ui/imports/ambiguous-10.rs
new file mode 100644
index 00000000000..5078b734b47
--- /dev/null
+++ b/tests/ui/imports/ambiguous-10.rs
@@ -0,0 +1,19 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
+
+mod a {
+    pub enum Token {}
+}
+
+mod b {
+    use crate::a::*;
+    #[derive(Debug)]
+    pub enum Token {}
+}
+
+use crate::a::*;
+use crate::b::*;
+fn c(_: Token) {}
+//~^ WARNING `Token` is ambiguous
+//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+fn main() { }
diff --git a/tests/ui/imports/ambiguous-10.stderr b/tests/ui/imports/ambiguous-10.stderr
new file mode 100644
index 00000000000..704af616b43
--- /dev/null
+++ b/tests/ui/imports/ambiguous-10.stderr
@@ -0,0 +1,25 @@
+warning: `Token` is ambiguous
+  --> $DIR/ambiguous-10.rs:16:9
+   |
+LL | fn c(_: Token) {}
+   |         ^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Token` could refer to the enum imported here
+  --> $DIR/ambiguous-10.rs:14:5
+   |
+LL | use crate::a::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Token` to disambiguate
+note: `Token` could also refer to the enum imported here
+  --> $DIR/ambiguous-10.rs:15:5
+   |
+LL | use crate::b::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Token` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-11.rs b/tests/ui/imports/ambiguous-11.rs
new file mode 100644
index 00000000000..0565b9d22ac
--- /dev/null
+++ b/tests/ui/imports/ambiguous-11.rs
@@ -0,0 +1,14 @@
+// aux-build: ambiguous-11-extern.rs
+
+extern crate ambiguous_11_extern;
+
+mod s {
+  pub trait Error {}
+}
+
+use s::*;
+use ambiguous_11_extern::*;
+fn a<E: Error>(_: E) {}
+//~^ ERROR `Error` is ambiguous
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-11.stderr b/tests/ui/imports/ambiguous-11.stderr
new file mode 100644
index 00000000000..765d6afa8d7
--- /dev/null
+++ b/tests/ui/imports/ambiguous-11.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `Error` is ambiguous
+  --> $DIR/ambiguous-11.rs:11:9
+   |
+LL | fn a<E: Error>(_: E) {}
+   |         ^^^^^ ambiguous name
+   |
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Error` could refer to the trait imported here
+  --> $DIR/ambiguous-11.rs:9:5
+   |
+LL | use s::*;
+   |     ^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+note: `Error` could also refer to the enum imported here
+  --> $DIR/ambiguous-11.rs:10:5
+   |
+LL | use ambiguous_11_extern::*;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/imports/ambiguous-12.rs b/tests/ui/imports/ambiguous-12.rs
new file mode 100644
index 00000000000..6259c13572c
--- /dev/null
+++ b/tests/ui/imports/ambiguous-12.rs
@@ -0,0 +1,25 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
+
+macro_rules! m {
+    () => {
+        pub fn b() {}
+    };
+}
+
+pub mod ciphertext {
+    m!();
+}
+pub mod public {
+    use crate::ciphertext::*;
+    m!();
+}
+
+use crate::ciphertext::*;
+use crate::public::*;
+
+fn main() {
+    b();
+    //~^ WARNING `b` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-12.stderr b/tests/ui/imports/ambiguous-12.stderr
new file mode 100644
index 00000000000..4725c38849c
--- /dev/null
+++ b/tests/ui/imports/ambiguous-12.stderr
@@ -0,0 +1,25 @@
+warning: `b` is ambiguous
+  --> $DIR/ambiguous-12.rs:22:5
+   |
+LL |     b();
+   |     ^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `b` could refer to the function imported here
+  --> $DIR/ambiguous-12.rs:18:5
+   |
+LL | use crate::ciphertext::*;
+   |     ^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `b` to disambiguate
+note: `b` could also refer to the function imported here
+  --> $DIR/ambiguous-12.rs:19:5
+   |
+LL | use crate::public::*;
+   |     ^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `b` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-13.rs b/tests/ui/imports/ambiguous-13.rs
new file mode 100644
index 00000000000..82f933c49ac
--- /dev/null
+++ b/tests/ui/imports/ambiguous-13.rs
@@ -0,0 +1,22 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
+
+pub mod object {
+    #[derive(Debug)]
+    pub struct Rect;
+}
+
+pub mod content {
+  use crate::object::*;
+
+  #[derive(Debug)]
+  pub struct Rect;
+}
+
+use crate::object::*;
+use crate::content::*;
+
+fn a(_: Rect) {}
+//~^ WARNING `Rect` is ambiguous
+//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+fn main() { }
diff --git a/tests/ui/imports/ambiguous-13.stderr b/tests/ui/imports/ambiguous-13.stderr
new file mode 100644
index 00000000000..3e78100b658
--- /dev/null
+++ b/tests/ui/imports/ambiguous-13.stderr
@@ -0,0 +1,25 @@
+warning: `Rect` is ambiguous
+  --> $DIR/ambiguous-13.rs:19:9
+   |
+LL | fn a(_: Rect) {}
+   |         ^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Rect` could refer to the struct imported here
+  --> $DIR/ambiguous-13.rs:16:5
+   |
+LL | use crate::object::*;
+   |     ^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Rect` to disambiguate
+note: `Rect` could also refer to the struct imported here
+  --> $DIR/ambiguous-13.rs:17:5
+   |
+LL | use crate::content::*;
+   |     ^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Rect` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-14.rs b/tests/ui/imports/ambiguous-14.rs
new file mode 100644
index 00000000000..5e880b48c36
--- /dev/null
+++ b/tests/ui/imports/ambiguous-14.rs
@@ -0,0 +1,26 @@
+// check-pass
+// https://github.com/rust-lang/rust/issues/98467
+
+mod a {
+    pub fn foo() {}
+}
+
+mod b {
+    pub fn foo() {}
+}
+
+mod f {
+    pub use a::*;
+    pub use b::*;
+}
+
+mod g {
+    pub use a::*;
+    pub use f::*;
+}
+
+fn main() {
+    g::foo();
+    //~^ WARNING `foo` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-14.stderr b/tests/ui/imports/ambiguous-14.stderr
new file mode 100644
index 00000000000..bece5853668
--- /dev/null
+++ b/tests/ui/imports/ambiguous-14.stderr
@@ -0,0 +1,25 @@
+warning: `foo` is ambiguous
+  --> $DIR/ambiguous-14.rs:23:8
+   |
+LL |     g::foo();
+   |        ^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `foo` could refer to the function imported here
+  --> $DIR/ambiguous-14.rs:13:13
+   |
+LL |     pub use a::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+note: `foo` could also refer to the function imported here
+  --> $DIR/ambiguous-14.rs:14:13
+   |
+LL |     pub use b::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-15.rs b/tests/ui/imports/ambiguous-15.rs
new file mode 100644
index 00000000000..8c75c393a41
--- /dev/null
+++ b/tests/ui/imports/ambiguous-15.rs
@@ -0,0 +1,27 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
+
+mod t2 {
+    #[derive(Debug)]
+    pub enum Error {}
+
+    mod s {
+        pub use std::fmt::*;
+        pub trait Error: Sized {}
+    }
+
+    use self::s::*;
+}
+
+pub use t2::*;
+
+mod t3 {
+    pub trait Error {}
+}
+
+use self::t3::*;
+fn a<E: Error>(_: E) {}
+//~^ WARNING `Error` is ambiguous
+//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-15.stderr b/tests/ui/imports/ambiguous-15.stderr
new file mode 100644
index 00000000000..838256752d0
--- /dev/null
+++ b/tests/ui/imports/ambiguous-15.stderr
@@ -0,0 +1,25 @@
+warning: `Error` is ambiguous
+  --> $DIR/ambiguous-15.rs:23:9
+   |
+LL | fn a<E: Error>(_: E) {}
+   |         ^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Error` could refer to the trait imported here
+  --> $DIR/ambiguous-15.rs:22:5
+   |
+LL | use self::t3::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+note: `Error` could also refer to the enum imported here
+  --> $DIR/ambiguous-15.rs:16:9
+   |
+LL | pub use t2::*;
+   |         ^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-16.rs b/tests/ui/imports/ambiguous-16.rs
new file mode 100644
index 00000000000..e51e30e3ed5
--- /dev/null
+++ b/tests/ui/imports/ambiguous-16.rs
@@ -0,0 +1,27 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099
+
+mod framing {
+    mod public_message {
+        use super::*;
+
+        #[derive(Debug)]
+        pub struct ConfirmedTranscriptHashInput;
+    }
+
+    mod public_message_in {
+        use super::*;
+
+        #[derive(Debug)]
+        pub struct ConfirmedTranscriptHashInput;
+    }
+
+    pub use self::public_message::*;
+    pub use self::public_message_in::*;
+}
+
+use crate::framing::ConfirmedTranscriptHashInput;
+//~^ WARNING `ConfirmedTranscriptHashInput` is ambiguous
+//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+fn main() { }
diff --git a/tests/ui/imports/ambiguous-16.stderr b/tests/ui/imports/ambiguous-16.stderr
new file mode 100644
index 00000000000..7366cabc47a
--- /dev/null
+++ b/tests/ui/imports/ambiguous-16.stderr
@@ -0,0 +1,25 @@
+warning: `ConfirmedTranscriptHashInput` is ambiguous
+  --> $DIR/ambiguous-16.rs:23:21
+   |
+LL | use crate::framing::ConfirmedTranscriptHashInput;
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `ConfirmedTranscriptHashInput` could refer to the struct imported here
+  --> $DIR/ambiguous-16.rs:19:13
+   |
+LL |     pub use self::public_message::*;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
+note: `ConfirmedTranscriptHashInput` could also refer to the struct imported here
+  --> $DIR/ambiguous-16.rs:20:13
+   |
+LL |     pub use self::public_message_in::*;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-17.rs b/tests/ui/imports/ambiguous-17.rs
new file mode 100644
index 00000000000..7d01404ce07
--- /dev/null
+++ b/tests/ui/imports/ambiguous-17.rs
@@ -0,0 +1,29 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
+
+pub use evp::*; //~ WARNING ambiguous glob re-exports
+pub use handwritten::*;
+
+macro_rules! m {
+    () => {
+        pub fn id() {}
+    };
+}
+mod evp {
+    use *;
+    m!();
+}
+
+mod handwritten {
+    pub use handwritten::evp::*;
+    mod evp {
+        use *;
+        m!();
+    }
+}
+
+fn main() {
+    id();
+    //~^ WARNING `id` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-17.stderr b/tests/ui/imports/ambiguous-17.stderr
new file mode 100644
index 00000000000..55bc01095c7
--- /dev/null
+++ b/tests/ui/imports/ambiguous-17.stderr
@@ -0,0 +1,35 @@
+warning: ambiguous glob re-exports
+  --> $DIR/ambiguous-17.rs:4:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^ the name `id` in the value namespace is first re-exported here
+LL | pub use handwritten::*;
+   |         -------------- but the name `id` in the value namespace is also re-exported here
+   |
+   = note: `#[warn(ambiguous_glob_reexports)]` on by default
+
+warning: `id` is ambiguous
+  --> $DIR/ambiguous-17.rs:26:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-17.rs:4:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-17.rs:5:9
+   |
+LL | pub use handwritten::*;
+   |         ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/imports/ambiguous-2.rs b/tests/ui/imports/ambiguous-2.rs
new file mode 100644
index 00000000000..7b38f3006b1
--- /dev/null
+++ b/tests/ui/imports/ambiguous-2.rs
@@ -0,0 +1,9 @@
+// check-pass
+// aux-build: ../ambiguous-1.rs
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396
+
+extern crate ambiguous_1;
+
+fn main() {
+    ambiguous_1::id();
+}
diff --git a/tests/ui/imports/ambiguous-3.rs b/tests/ui/imports/ambiguous-3.rs
new file mode 100644
index 00000000000..61a5b6b83fb
--- /dev/null
+++ b/tests/ui/imports/ambiguous-3.rs
@@ -0,0 +1,21 @@
+// check-pass
+// https://github.com/rust-lang/rust/issues/47525
+
+fn main() {
+    use a::*;
+    x();
+    //~^ WARNING `x` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
+
+mod a {
+    mod b {
+        pub fn x() { println!(module_path!()); }
+    }
+    mod c {
+        pub fn x() { println!(module_path!()); }
+    }
+
+    pub use self::b::*;
+    pub use self::c::*;
+}
diff --git a/tests/ui/imports/ambiguous-3.stderr b/tests/ui/imports/ambiguous-3.stderr
new file mode 100644
index 00000000000..f019f6d8957
--- /dev/null
+++ b/tests/ui/imports/ambiguous-3.stderr
@@ -0,0 +1,25 @@
+warning: `x` is ambiguous
+  --> $DIR/ambiguous-3.rs:6:5
+   |
+LL |     x();
+   |     ^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `x` could refer to the function imported here
+  --> $DIR/ambiguous-3.rs:19:13
+   |
+LL |     pub use self::b::*;
+   |             ^^^^^^^^^^
+   = help: consider adding an explicit import of `x` to disambiguate
+note: `x` could also refer to the function imported here
+  --> $DIR/ambiguous-3.rs:20:13
+   |
+LL |     pub use self::c::*;
+   |             ^^^^^^^^^^
+   = help: consider adding an explicit import of `x` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-4-extern.rs b/tests/ui/imports/ambiguous-4-extern.rs
new file mode 100644
index 00000000000..02546768e0e
--- /dev/null
+++ b/tests/ui/imports/ambiguous-4-extern.rs
@@ -0,0 +1,26 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883
+
+macro_rules! m {
+    () => {
+      pub fn id() {}
+    };
+}
+
+pub use evp::*; //~ WARNING ambiguous glob re-exports
+pub use handwritten::*;
+
+mod evp {
+    use *;
+    m! {}
+}
+mod handwritten {
+    use *;
+    m! {}
+}
+
+fn main() {
+    id();
+    //~^ WARNING `id` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-4-extern.stderr b/tests/ui/imports/ambiguous-4-extern.stderr
new file mode 100644
index 00000000000..0011973212b
--- /dev/null
+++ b/tests/ui/imports/ambiguous-4-extern.stderr
@@ -0,0 +1,35 @@
+warning: ambiguous glob re-exports
+  --> $DIR/ambiguous-4-extern.rs:10:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^ the name `id` in the value namespace is first re-exported here
+LL | pub use handwritten::*;
+   |         -------------- but the name `id` in the value namespace is also re-exported here
+   |
+   = note: `#[warn(ambiguous_glob_reexports)]` on by default
+
+warning: `id` is ambiguous
+  --> $DIR/ambiguous-4-extern.rs:23:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-4-extern.rs:10:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-4-extern.rs:11:9
+   |
+LL | pub use handwritten::*;
+   |         ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/imports/ambiguous-4.rs b/tests/ui/imports/ambiguous-4.rs
new file mode 100644
index 00000000000..10f883339c3
--- /dev/null
+++ b/tests/ui/imports/ambiguous-4.rs
@@ -0,0 +1,9 @@
+// check-pass
+// aux-build: ../ambiguous-4-extern.rs
+
+extern crate ambiguous_4_extern;
+
+fn main() {
+    ambiguous_4_extern::id();
+    // `warning_ambiguous` had been lost at metadata.
+}
diff --git a/tests/ui/imports/ambiguous-5.rs b/tests/ui/imports/ambiguous-5.rs
new file mode 100644
index 00000000000..56092246ab3
--- /dev/null
+++ b/tests/ui/imports/ambiguous-5.rs
@@ -0,0 +1,24 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
+
+mod a {
+    pub struct Class(u16);
+}
+
+use a::Class;
+
+mod gpos {
+    use super::gsubgpos::*;
+    use super::*;
+    struct MarkRecord(Class);
+    //~^ WARNING `Class` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
+
+mod gsubgpos {
+    use super::*;
+    #[derive(Clone)]
+    pub struct Class;
+}
+
+fn main() { }
diff --git a/tests/ui/imports/ambiguous-5.stderr b/tests/ui/imports/ambiguous-5.stderr
new file mode 100644
index 00000000000..4bc35f86d3a
--- /dev/null
+++ b/tests/ui/imports/ambiguous-5.stderr
@@ -0,0 +1,25 @@
+warning: `Class` is ambiguous
+  --> $DIR/ambiguous-5.rs:13:23
+   |
+LL |     struct MarkRecord(Class);
+   |                       ^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Class` could refer to the struct imported here
+  --> $DIR/ambiguous-5.rs:12:9
+   |
+LL |     use super::*;
+   |         ^^^^^^^^
+   = help: consider adding an explicit import of `Class` to disambiguate
+note: `Class` could also refer to the struct imported here
+  --> $DIR/ambiguous-5.rs:11:9
+   |
+LL |     use super::gsubgpos::*;
+   |         ^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Class` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-6.rs b/tests/ui/imports/ambiguous-6.rs
new file mode 100644
index 00000000000..ba2623bf48a
--- /dev/null
+++ b/tests/ui/imports/ambiguous-6.rs
@@ -0,0 +1,20 @@
+// check-pass
+// edition: 2021
+// https://github.com/rust-lang/rust/issues/112713
+
+pub fn foo() -> u32 {
+    use sub::*;
+    C
+    //~^ WARNING `C` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
+
+mod sub {
+    mod mod1 { pub const C: u32 = 1; }
+    mod mod2 { pub const C: u32 = 2; }
+
+    pub use mod1::*;
+    pub use mod2::*;
+}
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-6.stderr b/tests/ui/imports/ambiguous-6.stderr
new file mode 100644
index 00000000000..d7871a0b8cb
--- /dev/null
+++ b/tests/ui/imports/ambiguous-6.stderr
@@ -0,0 +1,25 @@
+warning: `C` is ambiguous
+  --> $DIR/ambiguous-6.rs:7:5
+   |
+LL |     C
+   |     ^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `C` could refer to the constant imported here
+  --> $DIR/ambiguous-6.rs:16:13
+   |
+LL |     pub use mod1::*;
+   |             ^^^^^^^
+   = help: consider adding an explicit import of `C` to disambiguate
+note: `C` could also refer to the constant imported here
+  --> $DIR/ambiguous-6.rs:17:13
+   |
+LL |     pub use mod2::*;
+   |             ^^^^^^^
+   = help: consider adding an explicit import of `C` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/imports/ambiguous-7.rs b/tests/ui/imports/ambiguous-7.rs
new file mode 100644
index 00000000000..5148ff4cc33
--- /dev/null
+++ b/tests/ui/imports/ambiguous-7.rs
@@ -0,0 +1,18 @@
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
+
+mod t2 {
+    #[derive(Debug)]
+    pub enum Error {}
+}
+
+pub use t2::*;
+
+mod t3 {
+    pub trait Error {}
+}
+
+use self::t3::*;
+fn a<E: Error>(_: E) {}
+//~^ ERROR `Error` is ambiguous
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-7.stderr b/tests/ui/imports/ambiguous-7.stderr
new file mode 100644
index 00000000000..2c6b56c61fd
--- /dev/null
+++ b/tests/ui/imports/ambiguous-7.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `Error` is ambiguous
+  --> $DIR/ambiguous-7.rs:15:9
+   |
+LL | fn a<E: Error>(_: E) {}
+   |         ^^^^^ ambiguous name
+   |
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Error` could refer to the trait imported here
+  --> $DIR/ambiguous-7.rs:14:5
+   |
+LL | use self::t3::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+note: `Error` could also refer to the enum imported here
+  --> $DIR/ambiguous-7.rs:8:9
+   |
+LL | pub use t2::*;
+   |         ^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/imports/ambiguous-8.rs b/tests/ui/imports/ambiguous-8.rs
new file mode 100644
index 00000000000..d44cd9587ac
--- /dev/null
+++ b/tests/ui/imports/ambiguous-8.rs
@@ -0,0 +1,14 @@
+// aux-build: ambiguous-8-extern.rs
+
+extern crate ambiguous_8_extern;
+
+mod s {
+  pub trait Error {}
+}
+
+use s::*;
+use ambiguous_8_extern::*;
+fn a<E: Error>(_: E) {}
+//~^ ERROR `Error` is ambiguous
+
+fn main() {}
diff --git a/tests/ui/imports/ambiguous-8.stderr b/tests/ui/imports/ambiguous-8.stderr
new file mode 100644
index 00000000000..32056fba69f
--- /dev/null
+++ b/tests/ui/imports/ambiguous-8.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `Error` is ambiguous
+  --> $DIR/ambiguous-8.rs:11:9
+   |
+LL | fn a<E: Error>(_: E) {}
+   |         ^^^^^ ambiguous name
+   |
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Error` could refer to the trait imported here
+  --> $DIR/ambiguous-8.rs:9:5
+   |
+LL | use s::*;
+   |     ^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+note: `Error` could also refer to the enum imported here
+  --> $DIR/ambiguous-8.rs:10:5
+   |
+LL | use ambiguous_8_extern::*;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/imports/ambiguous-9.rs b/tests/ui/imports/ambiguous-9.rs
new file mode 100644
index 00000000000..9da2467ad9d
--- /dev/null
+++ b/tests/ui/imports/ambiguous-9.rs
@@ -0,0 +1,29 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
+
+pub mod dsl {
+    mod range {
+        pub fn date_range() {}
+    }
+    pub use self::range::*; //~ WARNING ambiguous glob re-exports
+    use super::prelude::*;
+}
+
+pub mod prelude {
+    mod t {
+      pub fn date_range() {}
+    }
+    pub use self::t::*; //~ WARNING ambiguous glob re-exports
+    pub use super::dsl::*;
+}
+
+use dsl::*;
+use prelude::*;
+
+fn main() {
+    date_range();
+    //~^ WARNING `date_range` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+    //~| WARNING `date_range` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+}
diff --git a/tests/ui/imports/ambiguous-9.stderr b/tests/ui/imports/ambiguous-9.stderr
new file mode 100644
index 00000000000..6c7d79174da
--- /dev/null
+++ b/tests/ui/imports/ambiguous-9.stderr
@@ -0,0 +1,65 @@
+warning: ambiguous glob re-exports
+  --> $DIR/ambiguous-9.rs:8:13
+   |
+LL |     pub use self::range::*;
+   |             ^^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
+LL |     use super::prelude::*;
+   |         ----------------- but the name `date_range` in the value namespace is also re-exported here
+   |
+   = note: `#[warn(ambiguous_glob_reexports)]` on by default
+
+warning: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:24:5
+   |
+LL |     date_range();
+   |     ^^^^^^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `date_range` could refer to the function imported here
+  --> $DIR/ambiguous-9.rs:8:13
+   |
+LL |     pub use self::range::*;
+   |             ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+note: `date_range` could also refer to the function imported here
+  --> $DIR/ambiguous-9.rs:9:9
+   |
+LL |     use super::prelude::*;
+   |         ^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+warning: ambiguous glob re-exports
+  --> $DIR/ambiguous-9.rs:16:13
+   |
+LL |     pub use self::t::*;
+   |             ^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
+LL |     pub use super::dsl::*;
+   |             ------------- but the name `date_range` in the value namespace is also re-exported here
+
+warning: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:24:5
+   |
+LL |     date_range();
+   |     ^^^^^^^^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `date_range` could refer to the function imported here
+  --> $DIR/ambiguous-9.rs:20:5
+   |
+LL | use dsl::*;
+   |     ^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+note: `date_range` could also refer to the function imported here
+  --> $DIR/ambiguous-9.rs:21:5
+   |
+LL | use prelude::*;
+   |     ^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+
+warning: 4 warnings emitted
+
diff --git a/tests/ui/imports/auxiliary/ambiguous-11-extern.rs b/tests/ui/imports/auxiliary/ambiguous-11-extern.rs
new file mode 100644
index 00000000000..e679bc3dc45
--- /dev/null
+++ b/tests/ui/imports/auxiliary/ambiguous-11-extern.rs
@@ -0,0 +1,6 @@
+mod t2 {
+    #[derive(Debug)]
+    pub enum Error {}
+}
+
+pub use t2::*;
diff --git a/tests/ui/imports/auxiliary/ambiguous-8-extern.rs b/tests/ui/imports/auxiliary/ambiguous-8-extern.rs
new file mode 100644
index 00000000000..c7bf1bae038
--- /dev/null
+++ b/tests/ui/imports/auxiliary/ambiguous-8-extern.rs
@@ -0,0 +1,12 @@
+mod t2 {
+    #[derive(Debug)]
+    pub enum Error {}
+
+    mod t {
+        pub trait Error: Sized {}
+    }
+
+    use self::t::*;
+}
+
+pub use t2::*;
diff --git a/tests/ui/imports/auxiliary/extern-with-ambiguous-1-extern.rs b/tests/ui/imports/auxiliary/extern-with-ambiguous-1-extern.rs
new file mode 100644
index 00000000000..5cd10212281
--- /dev/null
+++ b/tests/ui/imports/auxiliary/extern-with-ambiguous-1-extern.rs
@@ -0,0 +1,4 @@
+mod a {
+    pub mod error {}
+}
+pub use a::*;
diff --git a/tests/ui/imports/auxiliary/extern-with-ambiguous-2-extern.rs b/tests/ui/imports/auxiliary/extern-with-ambiguous-2-extern.rs
new file mode 100644
index 00000000000..37899676892
--- /dev/null
+++ b/tests/ui/imports/auxiliary/extern-with-ambiguous-2-extern.rs
@@ -0,0 +1,9 @@
+mod a {
+    pub mod error {}
+}
+pub use a::*;
+
+mod b {
+    pub mod error {}
+}
+pub use b::*;
diff --git a/tests/ui/imports/auxiliary/extern-with-ambiguous-3-extern.rs b/tests/ui/imports/auxiliary/extern-with-ambiguous-3-extern.rs
new file mode 100644
index 00000000000..ad4e0480493
--- /dev/null
+++ b/tests/ui/imports/auxiliary/extern-with-ambiguous-3-extern.rs
@@ -0,0 +1,14 @@
+mod a {
+    pub mod error {}
+}
+pub use a::*;
+
+mod b {
+    pub mod error {}
+}
+pub use b::*;
+
+mod c {
+    pub mod error {}
+}
+pub use c::*;
diff --git a/tests/ui/imports/duplicate.rs b/tests/ui/imports/duplicate.rs
index db6538969ec..0c5a376da38 100644
--- a/tests/ui/imports/duplicate.rs
+++ b/tests/ui/imports/duplicate.rs
@@ -34,6 +34,8 @@ fn main() {
     e::foo();
     f::foo(); //~ ERROR `foo` is ambiguous
     g::foo();
+    //~^ WARNING `foo` is ambiguous
+    //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
 
 mod ambiguous_module_errors {
diff --git a/tests/ui/imports/duplicate.stderr b/tests/ui/imports/duplicate.stderr
index 997a2741b38..d7a7dfce921 100644
--- a/tests/ui/imports/duplicate.stderr
+++ b/tests/ui/imports/duplicate.stderr
@@ -9,20 +9,20 @@ LL |     use a::foo;
    = note: `foo` must be defined only once in the value namespace of this module
 
 error[E0659]: `foo` is ambiguous
-  --> $DIR/duplicate.rs:46:15
+  --> $DIR/duplicate.rs:48:15
    |
 LL |     use self::foo::bar;
    |               ^^^ ambiguous name
    |
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `foo` could refer to the module imported here
-  --> $DIR/duplicate.rs:43:9
+  --> $DIR/duplicate.rs:45:9
    |
 LL |     use self::m1::*;
    |         ^^^^^^^^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
 note: `foo` could also refer to the module imported here
-  --> $DIR/duplicate.rs:44:9
+  --> $DIR/duplicate.rs:46:9
    |
 LL |     use self::m2::*;
    |         ^^^^^^^^^^^
@@ -49,26 +49,49 @@ LL |     pub use b::*;
    = help: consider adding an explicit import of `foo` to disambiguate
 
 error[E0659]: `foo` is ambiguous
-  --> $DIR/duplicate.rs:49:9
+  --> $DIR/duplicate.rs:51:9
    |
 LL |         foo::bar();
    |         ^^^ ambiguous name
    |
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `foo` could refer to the module imported here
-  --> $DIR/duplicate.rs:43:9
+  --> $DIR/duplicate.rs:45:9
    |
 LL |     use self::m1::*;
    |         ^^^^^^^^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
 note: `foo` could also refer to the module imported here
-  --> $DIR/duplicate.rs:44:9
+  --> $DIR/duplicate.rs:46:9
    |
 LL |     use self::m2::*;
    |         ^^^^^^^^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
 
-error: aborting due to 4 previous errors
+warning: `foo` is ambiguous
+  --> $DIR/duplicate.rs:36:8
+   |
+LL |     g::foo();
+   |        ^^^ ambiguous name
+   |
+   = 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 #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `foo` could refer to the function imported here
+  --> $DIR/duplicate.rs:24:13
+   |
+LL |     pub use a::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+note: `foo` could also refer to the function imported here
+  --> $DIR/duplicate.rs:25:13
+   |
+LL |     pub use b::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+   = note: `#[warn(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 4 previous errors; 1 warning emitted
 
 Some errors have detailed explanations: E0252, E0659.
 For more information about an error, try `rustc --explain E0252`.
diff --git a/tests/ui/imports/extern-with-ambiguous-1.rs b/tests/ui/imports/extern-with-ambiguous-1.rs
new file mode 100644
index 00000000000..42c3c20686b
--- /dev/null
+++ b/tests/ui/imports/extern-with-ambiguous-1.rs
@@ -0,0 +1,19 @@
+// edition: 2021
+// aux-build: extern-with-ambiguous-1-extern.rs
+
+// `extern-with-ambiguous-1-extern.rs` doesn't has
+// ambiguous, just for compare.
+
+extern crate extern_with_ambiguous_1_extern;
+
+mod s {
+    pub mod error {
+        use extern_with_ambiguous_1_extern::*;
+    }
+}
+use s::*;
+use extern_with_ambiguous_1_extern::*;
+use error::*;
+//~^ ERROR `error` is ambiguous
+
+fn main() {}
diff --git a/tests/ui/imports/extern-with-ambiguous-1.stderr b/tests/ui/imports/extern-with-ambiguous-1.stderr
new file mode 100644
index 00000000000..dca2b4ebee7
--- /dev/null
+++ b/tests/ui/imports/extern-with-ambiguous-1.stderr
@@ -0,0 +1,23 @@
+error[E0659]: `error` is ambiguous
+  --> $DIR/extern-with-ambiguous-1.rs:16:5
+   |
+LL | use error::*;
+   |     ^^^^^ ambiguous name
+   |
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `error` could refer to the module imported here
+  --> $DIR/extern-with-ambiguous-1.rs:14:5
+   |
+LL | use s::*;
+   |     ^^^^
+   = help: consider adding an explicit import of `error` to disambiguate
+note: `error` could also refer to the module imported here
+  --> $DIR/extern-with-ambiguous-1.rs:15:5
+   |
+LL | use extern_with_ambiguous_1_extern::*;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `error` to disambiguate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/imports/extern-with-ambiguous-2.rs b/tests/ui/imports/extern-with-ambiguous-2.rs
new file mode 100644
index 00000000000..68c623c1c4a
--- /dev/null
+++ b/tests/ui/imports/extern-with-ambiguous-2.rs
@@ -0,0 +1,16 @@
+// check-pass
+// edition: 2021
+// aux-build: extern-with-ambiguous-2-extern.rs
+
+extern crate extern_with_ambiguous_2_extern;
+
+mod s {
+    pub mod error {
+        use extern_with_ambiguous_2_extern::*;
+    }
+}
+use s::*;
+use extern_with_ambiguous_2_extern::*;
+use error::*;
+
+fn main() {}
diff --git a/tests/ui/imports/extern-with-ambiguous-3.rs b/tests/ui/imports/extern-with-ambiguous-3.rs
new file mode 100644
index 00000000000..282c1d569b0
--- /dev/null
+++ b/tests/ui/imports/extern-with-ambiguous-3.rs
@@ -0,0 +1,17 @@
+// check-pass
+// edition: 2021
+// aux-build: extern-with-ambiguous-3-extern.rs
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1643974121
+
+extern crate extern_with_ambiguous_3_extern;
+
+mod s {
+    pub mod error {
+        use extern_with_ambiguous_3_extern::*;
+    }
+}
+use s::*;
+use extern_with_ambiguous_3_extern::*;
+use error::*;
+
+fn main() {}
diff --git a/tests/ui/imports/import-after-macro-expand-1.rs b/tests/ui/imports/import-after-macro-expand-1.rs
new file mode 100644
index 00000000000..d7a8aaf2f2e
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-1.rs
@@ -0,0 +1,19 @@
+// check-pass
+// https://github.com/rust-lang/rust/issues/56593#issue-388659456
+
+struct Foo;
+
+mod foo {
+    use super::*;
+
+    #[derive(Debug)]
+    pub struct Foo;
+}
+
+mod bar {
+    use super::foo::*;
+
+    fn bar(_: Foo) {}
+}
+
+fn main() {}
diff --git a/tests/ui/imports/import-after-macro-expand-2.rs b/tests/ui/imports/import-after-macro-expand-2.rs
new file mode 100644
index 00000000000..b3996d48840
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-2.rs
@@ -0,0 +1,27 @@
+// check-pass
+// https://github.com/rust-lang/rust/issues/56593#issuecomment-1133174514
+
+use thing::*;
+
+#[derive(Debug)]
+pub enum Thing {
+    Foo
+}
+
+mod tests {
+    use super::*;
+
+    fn test_thing() {
+        let thing: crate::thing::Thing = Thing::Bar;
+        // FIXME: `thing` should refer to `crate::Thing`,
+        // FIXME: but doesn't currently refer to it due to backward compatibility
+    }
+}
+
+mod thing {
+    pub enum Thing {
+        Bar
+    }
+}
+
+fn main() { }
diff --git a/tests/ui/imports/import-after-macro-expand-3.rs b/tests/ui/imports/import-after-macro-expand-3.rs
new file mode 100644
index 00000000000..3babe1470fc
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-3.rs
@@ -0,0 +1,24 @@
+// check-pass
+// similar with `import-after-macro-expand-2.rs`
+
+use thing::*;
+
+pub enum Thing {
+    Foo
+}
+
+mod tests {
+    use super::*;
+
+    fn test_thing() {
+        let thing: crate::Thing = Thing::Foo;
+    }
+}
+
+mod thing {
+    pub enum Thing {
+        Bar
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/imports/import-after-macro-expand-4.rs b/tests/ui/imports/import-after-macro-expand-4.rs
new file mode 100644
index 00000000000..02cc3f01af9
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-4.rs
@@ -0,0 +1,30 @@
+// https://github.com/rust-lang/rust/pull/113242#issuecomment-1616034904
+// similar with `import-after-macro-expand-2.rs`
+
+mod a {
+    pub trait P {}
+}
+
+pub use a::*;
+
+mod c {
+    use crate::*;
+    pub struct S(Vec<P>);
+    //~^ ERROR the size for values of type
+    //~| WARNING trait objects without an explicit
+    //~| WARNING this is accepted in the current edition
+    //~| WARNING trait objects without an explicit
+    //~| WARNING this is accepted in the current edition
+    //~| WARNING trait objects without an explicit
+    //~| WARNING this is accepted in the current edition
+
+    // FIXME: should works, but doesn't currently refer
+    // to it due to backward compatibility
+}
+
+#[derive(Clone)]
+pub enum P {
+    A
+}
+
+fn main() {}
diff --git a/tests/ui/imports/import-after-macro-expand-4.stderr b/tests/ui/imports/import-after-macro-expand-4.stderr
new file mode 100644
index 00000000000..01f70cfc5bf
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-4.stderr
@@ -0,0 +1,53 @@
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/import-after-macro-expand-4.rs:12:22
+   |
+LL |     pub struct S(Vec<P>);
+   |                      ^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+   = note: `#[warn(bare_trait_objects)]` on by default
+help: use `dyn`
+   |
+LL |     pub struct S(Vec<dyn P>);
+   |                      +++
+
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/import-after-macro-expand-4.rs:12:22
+   |
+LL |     pub struct S(Vec<P>);
+   |                      ^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL |     pub struct S(Vec<dyn P>);
+   |                      +++
+
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/import-after-macro-expand-4.rs:12:22
+   |
+LL |     pub struct S(Vec<P>);
+   |                      ^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+help: use `dyn`
+   |
+LL |     pub struct S(Vec<dyn P>);
+   |                      +++
+
+error[E0277]: the size for values of type `(dyn a::P + 'static)` cannot be known at compilation time
+  --> $DIR/import-after-macro-expand-4.rs:12:18
+   |
+LL |     pub struct S(Vec<P>);
+   |                  ^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `(dyn a::P + 'static)`
+note: required by a bound in `Vec`
+  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error: aborting due to previous error; 3 warnings emitted
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/imports/import-after-macro-expand-5.rs b/tests/ui/imports/import-after-macro-expand-5.rs
new file mode 100644
index 00000000000..ba28b6deac7
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-5.rs
@@ -0,0 +1,31 @@
+// edition: 2021
+// check-pass
+// https://github.com/rust-lang/rust/issues/105235#issue-1474295873
+
+mod abc {
+    pub struct Beeblebrox;
+    pub struct Zaphod;
+}
+
+mod foo {
+    pub mod bar {
+        use crate::abc::*;
+
+        #[derive(Debug)]
+        pub enum Zaphod {
+            Whale,
+            President,
+        }
+    }
+    pub use bar::*;
+}
+
+mod baz {
+    pub fn do_something() {
+        println!("{:?}", crate::foo::Zaphod::Whale);
+    }
+}
+
+fn main() {
+    baz::do_something();
+}
diff --git a/tests/ui/imports/import-after-macro-expand-6.rs b/tests/ui/imports/import-after-macro-expand-6.rs
new file mode 100644
index 00000000000..ab5bb37a175
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-6.rs
@@ -0,0 +1,24 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113099#issuecomment-1633574396
+
+pub mod a {
+    pub use crate::b::*;
+}
+
+mod b {
+    pub mod http {
+        pub struct HeaderMap;
+    }
+
+    pub use self::http::*;
+    #[derive(Debug)]
+    pub struct HeaderMap;
+}
+
+use crate::a::HeaderMap;
+
+fn main() {
+    let h: crate::b::http::HeaderMap = HeaderMap;
+    // FIXME: should refer to `crate::b::HeaderMap`,
+    // FIXME: but doesn't currently refer to it due to backward compatibility
+}
diff --git a/tests/ui/imports/import-after-macro-expand-7.rs b/tests/ui/imports/import-after-macro-expand-7.rs
new file mode 100644
index 00000000000..0402dfdfda7
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-7.rs
@@ -0,0 +1,21 @@
+// check-pass
+// a compared case for `import-after-macro-expand-6.rs`
+
+pub mod a {
+    pub use crate::b::*;
+}
+
+mod b {
+    mod http {
+        pub struct HeaderMap;
+    }
+
+    pub use self::http::*;
+    pub struct HeaderMap;
+}
+
+use crate::a::HeaderMap;
+
+fn main() {
+    let h: crate::b::HeaderMap = HeaderMap;
+}
diff --git a/tests/ui/imports/import-after-macro-expand-8.rs b/tests/ui/imports/import-after-macro-expand-8.rs
new file mode 100644
index 00000000000..e11d65effdf
--- /dev/null
+++ b/tests/ui/imports/import-after-macro-expand-8.rs
@@ -0,0 +1,22 @@
+// check-pass
+// https://github.com/rust-lang/rust/pull/113242#issuecomment-1616034904
+
+mod a {
+    pub trait P {}
+}
+pub use a::*;
+
+mod b {
+    #[derive(Clone)]
+    pub enum P {
+        A
+    }
+}
+pub use b::P;
+
+mod c {
+    use crate::*;
+    pub struct S(Vec<P>);
+}
+
+fn main() {}
diff --git a/tests/ui/imports/issue-81413.rs b/tests/ui/imports/issue-81413.rs
new file mode 100644
index 00000000000..f3fb8bfab20
--- /dev/null
+++ b/tests/ui/imports/issue-81413.rs
@@ -0,0 +1,23 @@
+pub const ITEM: Item = Item;
+
+pub struct Item;
+
+pub fn item() {}
+
+pub use doesnt_exist::*;
+//~^ ERROR unresolved import `doesnt_exist`
+mod a {
+    use crate::{item, Item, ITEM};
+}
+
+mod b {
+    use crate::item;
+    use crate::Item;
+    use crate::ITEM;
+}
+
+mod c {
+    use crate::item;
+}
+
+fn main() {}
diff --git a/tests/ui/imports/issue-81413.stderr b/tests/ui/imports/issue-81413.stderr
new file mode 100644
index 00000000000..e2dfe02bc85
--- /dev/null
+++ b/tests/ui/imports/issue-81413.stderr
@@ -0,0 +1,11 @@
+error[E0432]: unresolved import `doesnt_exist`
+  --> $DIR/issue-81413.rs:7:9
+   |
+LL | pub use doesnt_exist::*;
+   |         ^^^^^^^^^^^^ maybe a missing crate `doesnt_exist`?
+   |
+   = help: consider adding `extern crate doesnt_exist` to use the `doesnt_exist` crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0432`.
diff --git a/tests/ui/issues/issue-11820.rs b/tests/ui/issues/issue-11820.rs
index 7ffe9652797..dc6349b10ee 100644
--- a/tests/ui/issues/issue-11820.rs
+++ b/tests/ui/issues/issue-11820.rs
@@ -1,6 +1,8 @@
 // run-pass
 // pretty-expanded FIXME #23616
 
+#![allow(noop_method_call)]
+
 struct NoClone;
 
 fn main() {
diff --git a/tests/ui/layout/malformed-unsized-type-in-union.rs b/tests/ui/layout/malformed-unsized-type-in-union.rs
new file mode 100644
index 00000000000..5d8ec576cf0
--- /dev/null
+++ b/tests/ui/layout/malformed-unsized-type-in-union.rs
@@ -0,0 +1,8 @@
+// issue: 113760
+
+union W { s: dyn Iterator<Item = Missing> }
+//~^ ERROR cannot find type `Missing` in this scope
+
+static ONCE: W = todo!();
+
+fn main() {}
diff --git a/tests/ui/layout/malformed-unsized-type-in-union.stderr b/tests/ui/layout/malformed-unsized-type-in-union.stderr
new file mode 100644
index 00000000000..cbb8d6af38a
--- /dev/null
+++ b/tests/ui/layout/malformed-unsized-type-in-union.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+  --> $DIR/malformed-unsized-type-in-union.rs:3:34
+   |
+LL | union W { s: dyn Iterator<Item = Missing> }
+   |                                  ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/type-alias/lazy-type-alias-enum-variant.rs b/tests/ui/lazy-type-alias/enum-variant.rs
index 78c3159d1c2..6d18e9eca62 100644
--- a/tests/ui/type-alias/lazy-type-alias-enum-variant.rs
+++ b/tests/ui/lazy-type-alias/enum-variant.rs
@@ -2,6 +2,7 @@
 // check-pass
 
 #![feature(lazy_type_alias)]
+//~^ WARN the feature `lazy_type_alias` is incomplete and may not be safe to use
 
 enum Enum {
     Unit,
diff --git a/tests/ui/lazy-type-alias/enum-variant.stderr b/tests/ui/lazy-type-alias/enum-variant.stderr
new file mode 100644
index 00000000000..4360db91778
--- /dev/null
+++ b/tests/ui/lazy-type-alias/enum-variant.stderr
@@ -0,0 +1,11 @@
+warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/enum-variant.rs:4:12
+   |
+LL | #![feature(lazy_type_alias)]
+   |            ^^^^^^^^^^^^^^^
+   |
+   = note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lazy-type-alias/type-alias-bounds-are-enforced.rs b/tests/ui/lazy-type-alias/type-alias-bounds-are-enforced.rs
new file mode 100644
index 00000000000..d0abd3ebf24
--- /dev/null
+++ b/tests/ui/lazy-type-alias/type-alias-bounds-are-enforced.rs
@@ -0,0 +1,14 @@
+// Check that we don't issue the lint `type_alias_bounds` for
+// lazy type aliases since the bounds are indeed enforced.
+
+// check-pass
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+#![deny(type_alias_bounds)]
+
+use std::ops::Mul;
+
+type Alias<T: Mul> = <T as Mul>::Output;
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.rs b/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.rs
new file mode 100644
index 00000000000..c798e4e4368
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.rs
@@ -0,0 +1,8 @@
+// Test that we check lazy type aliases for well-formedness.
+
+#![feature(lazy_type_alias)]
+#![allow(incomplete_features)]
+
+type Alias<T> = <T as std::ops::Mul>::Output; //~ ERROR cannot multiply `T` by `T`
+
+fn main() {}
diff --git a/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.stderr b/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.stderr
new file mode 100644
index 00000000000..d022f825140
--- /dev/null
+++ b/tests/ui/lazy-type-alias/unsatisfied-bounds-type-alias-body.stderr
@@ -0,0 +1,14 @@
+error[E0277]: cannot multiply `T` by `T`
+  --> $DIR/unsatisfied-bounds-type-alias-body.rs:6:17
+   |
+LL | type Alias<T> = <T as std::ops::Mul>::Output;
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T * T`
+   |
+help: consider restricting type parameter `T`
+   |
+LL | type Alias<T: std::ops::Mul> = <T as std::ops::Mul>::Output;
+   |             +++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/lint/lint-cap-trait-bounds.rs b/tests/ui/lint/lint-cap-trait-bounds.rs
new file mode 100644
index 00000000000..d9c28dd0aa6
--- /dev/null
+++ b/tests/ui/lint/lint-cap-trait-bounds.rs
@@ -0,0 +1,8 @@
+// Regression test for https://github.com/rust-lang/rust/issues/43134
+
+// check-pass
+// compile-flags: --cap-lints allow
+
+type Foo<T: Clone> = Option<T>;
+
+fn main() {}
diff --git a/tests/ui/lint/noop-method-call.fixed b/tests/ui/lint/noop-method-call.fixed
new file mode 100644
index 00000000000..eeb80279fd8
--- /dev/null
+++ b/tests/ui/lint/noop-method-call.fixed
@@ -0,0 +1,51 @@
+// check-pass
+// run-rustfix
+
+#![allow(unused)]
+
+use std::borrow::Borrow;
+use std::ops::Deref;
+
+struct PlainType<T>(T);
+
+#[derive(Clone)]
+struct CloneType<T>(T);
+
+fn check(mut encoded: &[u8]) {
+    let _ = &mut encoded;
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+    let _ = &encoded;
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+}
+
+fn main() {
+    let non_clone_type_ref = &PlainType(1u32);
+    let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref;
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+
+    let clone_type_ref = &CloneType(1u32);
+    let clone_type_ref_clone: CloneType<u32> = clone_type_ref.clone();
+
+
+    let non_deref_type = &PlainType(1u32);
+    let non_deref_type_deref: &PlainType<u32> = non_deref_type;
+    //~^ WARN call to `.deref()` on a reference in this situation does nothing
+
+    let non_borrow_type = &PlainType(1u32);
+    let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type;
+    //~^ WARN call to `.borrow()` on a reference in this situation does nothing
+
+    // Borrowing a &&T does not warn since it has collapsed the double reference
+    let non_borrow_type = &&PlainType(1u32);
+    let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
+}
+
+fn generic<T>(non_clone_type: &PlainType<T>) {
+    non_clone_type;
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+}
+
+fn non_generic(non_clone_type: &PlainType<u32>) {
+    non_clone_type;
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+}
diff --git a/tests/ui/lint/noop-method-call.rs b/tests/ui/lint/noop-method-call.rs
index dbcf2a5131b..9569a0dfc61 100644
--- a/tests/ui/lint/noop-method-call.rs
+++ b/tests/ui/lint/noop-method-call.rs
@@ -1,7 +1,7 @@
 // check-pass
+// run-rustfix
 
 #![allow(unused)]
-#![warn(noop_method_call)]
 
 use std::borrow::Borrow;
 use std::ops::Deref;
@@ -11,45 +11,41 @@ struct PlainType<T>(T);
 #[derive(Clone)]
 struct CloneType<T>(T);
 
+fn check(mut encoded: &[u8]) {
+    let _ = &mut encoded.clone();
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+    let _ = &encoded.clone();
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
+}
+
 fn main() {
     let non_clone_type_ref = &PlainType(1u32);
     let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
-    //~^ WARNING call to `.clone()` on a reference in this situation does nothing
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
 
     let clone_type_ref = &CloneType(1u32);
     let clone_type_ref_clone: CloneType<u32> = clone_type_ref.clone();
 
-    let clone_type_ref = &&CloneType(1u32);
-    let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
-    //~^ WARNING using `.clone()` on a double reference, which returns `&CloneType<u32>`
 
     let non_deref_type = &PlainType(1u32);
     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
-    //~^ WARNING call to `.deref()` on a reference in this situation does nothing
-
-    let non_deref_type = &&PlainType(1u32);
-    let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
-    //~^ WARNING using `.deref()` on a double reference, which returns `&PlainType<u32>`
+    //~^ WARN call to `.deref()` on a reference in this situation does nothing
 
     let non_borrow_type = &PlainType(1u32);
     let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
-    //~^ WARNING call to `.borrow()` on a reference in this situation does nothing
+    //~^ WARN call to `.borrow()` on a reference in this situation does nothing
 
     // Borrowing a &&T does not warn since it has collapsed the double reference
     let non_borrow_type = &&PlainType(1u32);
     let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
-
-    let xs = ["a", "b", "c"];
-    let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
-    //~^ WARNING using `.clone()` on a double reference, which returns `&str`
 }
 
 fn generic<T>(non_clone_type: &PlainType<T>) {
     non_clone_type.clone();
-    //~^ WARNING call to `.clone()` on a reference in this situation does nothing
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
 }
 
 fn non_generic(non_clone_type: &PlainType<u32>) {
     non_clone_type.clone();
-    //~^ WARNING call to `.clone()` on a reference in this situation does nothing
+    //~^ WARN call to `.clone()` on a reference in this situation does nothing
 }
diff --git a/tests/ui/lint/noop-method-call.stderr b/tests/ui/lint/noop-method-call.stderr
index 37cd1a0fc18..aefc2706fd5 100644
--- a/tests/ui/lint/noop-method-call.stderr
+++ b/tests/ui/lint/noop-method-call.stderr
@@ -1,67 +1,59 @@
 warning: call to `.clone()` on a reference in this situation does nothing
-  --> $DIR/noop-method-call.rs:16:71
+  --> $DIR/noop-method-call.rs:15:25
    |
-LL |     let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
-   |                                                                       ^^^^^^^^ unnecessary method call
-   |
-   = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
-note: the lint level is defined here
-  --> $DIR/noop-method-call.rs:4:9
+LL |     let _ = &mut encoded.clone();
+   |                         ^^^^^^^^ help: remove this redundant call
    |
-LL | #![warn(noop_method_call)]
-   |         ^^^^^^^^^^^^^^^^
+   = note: the type `[u8]` does not implement `Clone`, so calling `clone` on `&[u8]` copies the reference, which does not do anything and can be removed
+   = note: `#[warn(noop_method_call)]` on by default
 
-warning: using `.clone()` on a double reference, which returns `&CloneType<u32>` instead of cloning the inner type
-  --> $DIR/noop-method-call.rs:23:63
+warning: call to `.clone()` on a reference in this situation does nothing
+  --> $DIR/noop-method-call.rs:17:21
    |
-LL |     let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
-   |                                                               ^^^^^^^^
+LL |     let _ = &encoded.clone();
+   |                     ^^^^^^^^ help: remove this redundant call
    |
-   = note: `#[warn(suspicious_double_ref_op)]` on by default
+   = note: the type `[u8]` does not implement `Clone`, so calling `clone` on `&[u8]` copies the reference, which does not do anything and can be removed
 
-warning: call to `.deref()` on a reference in this situation does nothing
-  --> $DIR/noop-method-call.rs:27:63
+warning: call to `.clone()` on a reference in this situation does nothing
+  --> $DIR/noop-method-call.rs:23:71
    |
-LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
-   |                                                               ^^^^^^^^ unnecessary method call
+LL |     let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
+   |                                                                       ^^^^^^^^ help: remove this redundant call
    |
-   = note: the type `&PlainType<u32>` which `deref` is being called on is the same as the type returned from `deref`, so the method call does not do anything and can be removed
+   = note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
 
-warning: using `.deref()` on a double reference, which returns `&PlainType<u32>` instead of dereferencing the inner type
+warning: call to `.deref()` on a reference in this situation does nothing
   --> $DIR/noop-method-call.rs:31:63
    |
 LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
-   |                                                               ^^^^^^^^
+   |                                                               ^^^^^^^^ help: remove this redundant call
+   |
+   = note: the type `PlainType<u32>` does not implement `Deref`, so calling `deref` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
 
 warning: call to `.borrow()` on a reference in this situation does nothing
   --> $DIR/noop-method-call.rs:35:66
    |
 LL |     let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
-   |                                                                  ^^^^^^^^^ unnecessary method call
-   |
-   = note: the type `&PlainType<u32>` which `borrow` is being called on is the same as the type returned from `borrow`, so the method call does not do anything and can be removed
-
-warning: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type
-  --> $DIR/noop-method-call.rs:43:44
+   |                                                                  ^^^^^^^^^ help: remove this redundant call
    |
-LL |     let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
-   |                                            ^^^^^^^^
+   = note: the type `PlainType<u32>` does not implement `Borrow`, so calling `borrow` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
 
 warning: call to `.clone()` on a reference in this situation does nothing
-  --> $DIR/noop-method-call.rs:48:19
+  --> $DIR/noop-method-call.rs:44:19
    |
 LL |     non_clone_type.clone();
-   |                   ^^^^^^^^ unnecessary method call
+   |                   ^^^^^^^^ help: remove this redundant call
    |
-   = note: the type `&PlainType<T>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
+   = note: the type `PlainType<T>` does not implement `Clone`, so calling `clone` on `&PlainType<T>` copies the reference, which does not do anything and can be removed
 
 warning: call to `.clone()` on a reference in this situation does nothing
-  --> $DIR/noop-method-call.rs:53:19
+  --> $DIR/noop-method-call.rs:49:19
    |
 LL |     non_clone_type.clone();
-   |                   ^^^^^^^^ unnecessary method call
+   |                   ^^^^^^^^ help: remove this redundant call
    |
-   = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
+   = note: the type `PlainType<u32>` does not implement `Clone`, so calling `clone` on `&PlainType<u32>` copies the reference, which does not do anything and can be removed
 
-warning: 8 warnings emitted
+warning: 7 warnings emitted
 
diff --git a/tests/ui/lint/cast_ref_to_mut.rs b/tests/ui/lint/reference_casting.rs
index 745d7070143..9963820499e 100644
--- a/tests/ui/lint/cast_ref_to_mut.rs
+++ b/tests/ui/lint/reference_casting.rs
@@ -1,6 +1,7 @@
 // check-fail
 
 #![feature(ptr_from_ref)]
+#![deny(invalid_reference_casting)]
 
 extern "C" {
     // N.B., mutability can be easily incorrect in FFI calls -- as
diff --git a/tests/ui/lint/cast_ref_to_mut.stderr b/tests/ui/lint/reference_casting.stderr
index baff00d6c04..d5b9bbef643 100644
--- a/tests/ui/lint/cast_ref_to_mut.stderr
+++ b/tests/ui/lint/reference_casting.stderr
@@ -1,61 +1,65 @@
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:19:9
+  --> $DIR/reference_casting.rs:20:9
    |
 LL |         (*(a as *const _ as *mut String)).push_str(" world");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: `#[deny(cast_ref_to_mut)]` on by default
+note: the lint level is defined here
+  --> $DIR/reference_casting.rs:4:9
+   |
+LL | #![deny(invalid_reference_casting)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:21:9
+  --> $DIR/reference_casting.rs:22:9
    |
 LL |         *(a as *const _ as *mut _) = String::from("Replaced");
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:23:9
+  --> $DIR/reference_casting.rs:24:9
    |
 LL |         *(a as *const _ as *mut String) += " world";
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:25:25
+  --> $DIR/reference_casting.rs:26:25
    |
 LL |         let _num = &mut *(num as *const i32 as *mut i32);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:27:25
+  --> $DIR/reference_casting.rs:28:25
    |
 LL |         let _num = &mut *(num as *const i32).cast_mut();
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:29:20
+  --> $DIR/reference_casting.rs:30:20
    |
 LL |         let _num = *{ num as *const i32 }.cast_mut();
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:31:9
+  --> $DIR/reference_casting.rs:32:9
    |
 LL |         *std::ptr::from_ref(num).cast_mut() += 1;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:33:9
+  --> $DIR/reference_casting.rs:34:9
    |
 LL |         *std::ptr::from_ref({ num }).cast_mut() += 1;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:35:9
+  --> $DIR/reference_casting.rs:36:9
    |
 LL |         *{ std::ptr::from_ref(num) }.cast_mut() += 1;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
-  --> $DIR/cast_ref_to_mut.rs:37:9
+  --> $DIR/reference_casting.rs:38:9
    |
 LL |         *(std::ptr::from_ref({ num }) as *mut i32) += 1;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/suspicious-double-ref-op.rs b/tests/ui/lint/suspicious-double-ref-op.rs
index b9bcd31c2a8..bc8c23c7b89 100644
--- a/tests/ui/lint/suspicious-double-ref-op.rs
+++ b/tests/ui/lint/suspicious-double-ref-op.rs
@@ -1,6 +1,14 @@
 #![feature(lazy_cell)]
 #![deny(suspicious_double_ref_op, noop_method_call)]
 
+use std::borrow::Borrow;
+use std::ops::Deref;
+
+struct PlainType<T>(T);
+
+#[derive(Clone)]
+struct CloneType<T>(T);
+
 pub fn clone_on_double_ref() {
     let x = vec![1];
     let y = &&x;
@@ -20,11 +28,16 @@ fn rust_clippy_issue_9272() {
     println!("{str}")
 }
 
-fn check(mut encoded: &[u8]) {
-    let _ = &mut encoded.clone();
-    //~^ ERROR call to `.clone()` on a reference in this situation does nothing
-    let _ = &encoded.clone();
-    //~^ ERROR call to `.clone()` on a reference in this situation does nothing
-}
+fn main() {
+    let clone_type_ref = &&CloneType(1u32);
+    let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
+    //~^ ERROR using `.clone()` on a double reference, which returns `&CloneType<u32>`
+
+    let non_deref_type = &&PlainType(1u32);
+    let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
+    //~^ ERROR using `.deref()` on a double reference, which returns `&PlainType<u32>`
 
-fn main() {}
+    let xs = ["a", "b", "c"];
+    let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
+    //~^ ERROR using `.clone()` on a double reference, which returns `&str`
+}
diff --git a/tests/ui/lint/suspicious-double-ref-op.stderr b/tests/ui/lint/suspicious-double-ref-op.stderr
index d15487ca238..f5a71d40fc1 100644
--- a/tests/ui/lint/suspicious-double-ref-op.stderr
+++ b/tests/ui/lint/suspicious-double-ref-op.stderr
@@ -1,5 +1,5 @@
 error: using `.clone()` on a double reference, which returns `&Vec<i32>` instead of cloning the inner type
-  --> $DIR/suspicious-double-ref-op.rs:7:23
+  --> $DIR/suspicious-double-ref-op.rs:15:23
    |
 LL |     let z: &Vec<_> = y.clone();
    |                       ^^^^^^^^
@@ -10,26 +10,23 @@ note: the lint level is defined here
 LL | #![deny(suspicious_double_ref_op, noop_method_call)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: call to `.clone()` on a reference in this situation does nothing
-  --> $DIR/suspicious-double-ref-op.rs:24:25
+error: using `.clone()` on a double reference, which returns `&CloneType<u32>` instead of cloning the inner type
+  --> $DIR/suspicious-double-ref-op.rs:33:63
    |
-LL |     let _ = &mut encoded.clone();
-   |                         ^^^^^^^^ unnecessary method call
-   |
-   = note: the type `&[u8]` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
-note: the lint level is defined here
-  --> $DIR/suspicious-double-ref-op.rs:2:35
-   |
-LL | #![deny(suspicious_double_ref_op, noop_method_call)]
-   |                                   ^^^^^^^^^^^^^^^^
+LL |     let clone_type_ref_clone: &CloneType<u32> = clone_type_ref.clone();
+   |                                                               ^^^^^^^^
 
-error: call to `.clone()` on a reference in this situation does nothing
-  --> $DIR/suspicious-double-ref-op.rs:26:21
+error: using `.deref()` on a double reference, which returns `&PlainType<u32>` instead of dereferencing the inner type
+  --> $DIR/suspicious-double-ref-op.rs:37:63
    |
-LL |     let _ = &encoded.clone();
-   |                     ^^^^^^^^ unnecessary method call
+LL |     let non_deref_type_deref: &PlainType<u32> = non_deref_type.deref();
+   |                                                               ^^^^^^^^
+
+error: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type
+  --> $DIR/suspicious-double-ref-op.rs:41:44
    |
-   = note: the type `&[u8]` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
+LL |     let _v: Vec<&str> = xs.iter().map(|x| x.clone()).collect(); // could use `*x` instead
+   |                                            ^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
diff --git a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs
new file mode 100644
index 00000000000..93b7ddf5e9e
--- /dev/null
+++ b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.rs
@@ -0,0 +1,6 @@
+// issue: 114131
+
+fn main() {
+    let hello = len(vec![]);
+    //~^ ERROR cannot find function `len` in this scope
+}
diff --git a/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
new file mode 100644
index 00000000000..9694f80ab6d
--- /dev/null
+++ b/tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
@@ -0,0 +1,15 @@
+error[E0425]: cannot find function `len` in this scope
+  --> $DIR/suggest-method-on-call-with-macro-rcvr.rs:4:17
+   |
+LL |     let hello = len(vec![]);
+   |                 ^^^ not found in this scope
+   |
+help: use the `.` operator to call the method `len` on `&Vec<_>`
+   |
+LL -     let hello = len(vec![]);
+LL +     let hello = vec![].len();
+   |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/mismatched_types/closure-ref-114180.rs b/tests/ui/mismatched_types/closure-ref-114180.rs
new file mode 100644
index 00000000000..d84bdbedaf6
--- /dev/null
+++ b/tests/ui/mismatched_types/closure-ref-114180.rs
@@ -0,0 +1,8 @@
+// check-fail
+
+fn main() {
+    let mut v = vec![(1,)];
+    let compare = |(a,), (e,)| todo!();
+    v.sort_by(compare);
+    //~^ ERROR type mismatch in closure arguments
+}
diff --git a/tests/ui/mismatched_types/closure-ref-114180.stderr b/tests/ui/mismatched_types/closure-ref-114180.stderr
new file mode 100644
index 00000000000..8a146d784e2
--- /dev/null
+++ b/tests/ui/mismatched_types/closure-ref-114180.stderr
@@ -0,0 +1,22 @@
+error[E0631]: type mismatch in closure arguments
+  --> $DIR/closure-ref-114180.rs:6:15
+   |
+LL |     let compare = |(a,), (e,)| todo!();
+   |                   ------------ found signature defined here
+LL |     v.sort_by(compare);
+   |       ------- ^^^^^^^ expected due to this
+   |       |
+   |       required by a bound introduced by this call
+   |
+   = note: expected closure signature `for<'a, 'b> fn(&'a ({integer},), &'b ({integer},)) -> _`
+              found closure signature `fn((_,), (_,)) -> _`
+note: required by a bound in `slice::<impl [T]>::sort_by`
+  --> $SRC_DIR/alloc/src/slice.rs:LL:COL
+help: consider adjusting the signature so it borrows its arguments
+   |
+LL |     let compare = |&(a,), &(e,)| todo!();
+   |                    +      +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/tests/ui/mismatched_types/ref-pat-suggestions.stderr b/tests/ui/mismatched_types/ref-pat-suggestions.stderr
index 62824004db5..148ed00b01d 100644
--- a/tests/ui/mismatched_types/ref-pat-suggestions.stderr
+++ b/tests/ui/mismatched_types/ref-pat-suggestions.stderr
@@ -103,10 +103,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:11:23
    |
 LL |     let _: fn(u32) = |&_a| ();
-   |                       ^--
-   |                       ||
-   |                       |expected due to this
+   |                       ^^^
+   |                       |
    |                       expected `u32`, found `&_`
+   |                       expected due to this
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -120,10 +120,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:12:23
    |
 LL |     let _: fn(u32) = |&mut _a| ();
-   |                       ^^^^^--
-   |                       |    |
-   |                       |    expected due to this
+   |                       ^^^^^^^
+   |                       |
    |                       expected `u32`, found `&mut _`
+   |                       expected due to this
    |
    = note:           expected type `u32`
            found mutable reference `&mut _`
@@ -142,10 +142,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:13:25
    |
 LL |     let _: fn(&u32) = |&&_a| ();
-   |                         ^--
-   |                         ||
-   |                         |expected due to this
-   |                         expected `u32`, found `&_`
+   |                        -^^^
+   |                        ||
+   |                        |expected `u32`, found `&_`
+   |                        expected due to this
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -159,10 +159,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:14:33
    |
 LL |     let _: fn(&mut u32) = |&mut &_a| ();
-   |                                 ^--
-   |                                 ||
-   |                                 |expected due to this
-   |                                 expected `u32`, found `&_`
+   |                            -----^^^
+   |                            |    |
+   |                            |    expected `u32`, found `&_`
+   |                            expected due to this
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -176,10 +176,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:15:25
    |
 LL |     let _: fn(&u32) = |&&mut _a| ();
-   |                         ^^^^^--
-   |                         |    |
-   |                         |    expected due to this
-   |                         expected `u32`, found `&mut _`
+   |                        -^^^^^^^
+   |                        ||
+   |                        |expected `u32`, found `&mut _`
+   |                        expected due to this
    |
    = note:           expected type `u32`
            found mutable reference `&mut _`
@@ -193,10 +193,10 @@ error[E0308]: mismatched types
   --> $DIR/ref-pat-suggestions.rs:16:33
    |
 LL |     let _: fn(&mut u32) = |&mut &mut _a| ();
-   |                                 ^^^^^--
-   |                                 |    |
-   |                                 |    expected due to this
-   |                                 expected `u32`, found `&mut _`
+   |                            -----^^^^^^^
+   |                            |    |
+   |                            |    expected `u32`, found `&mut _`
+   |                            expected due to this
    |
    = note:           expected type `u32`
            found mutable reference `&mut _`
diff --git a/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs b/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
new file mode 100644
index 00000000000..64ff1f8b1d2
--- /dev/null
+++ b/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
@@ -0,0 +1,15 @@
+// run-pass
+// check-run-results
+// regression test for issue #109567
+
+fn f() -> f64 {
+    std::hint::black_box(-1.0) % std::hint::black_box(-1.0)
+}
+
+const G: f64 = -1.0 % -1.0;
+
+pub fn main() {
+    assert_eq!(-1, G.signum() as i32);
+    assert_eq!((-0.0_f64).to_bits(), G.to_bits());
+    assert_eq!(f().signum(), G.signum());
+}
diff --git a/tests/ui/object-safety/assoc_const_bounds.rs b/tests/ui/object-safety/assoc_const_bounds.rs
index 94b1f63165b..bfa21fd9aea 100644
--- a/tests/ui/object-safety/assoc_const_bounds.rs
+++ b/tests/ui/object-safety/assoc_const_bounds.rs
@@ -1,7 +1,12 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features, dead_code)]
+
+// check-pass
+
 trait Foo<T> {
     const BAR: bool
-        where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
-            Self: Sized;
+    where
+        Self: Sized;
 }
 
 trait Cake {}
diff --git a/tests/ui/object-safety/assoc_const_bounds.stderr b/tests/ui/object-safety/assoc_const_bounds.stderr
deleted file mode 100644
index 09bc11e178a..00000000000
--- a/tests/ui/object-safety/assoc_const_bounds.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
-  --> $DIR/assoc_const_bounds.rs:3:9
-   |
-LL | trait Foo<T> {
-   |              - while parsing this item list starting here
-LL |     const BAR: bool
-   |                    - expected one of 7 possible tokens
-LL |         where
-   |         ^^^^^ unexpected token
-LL |             Self: Sized;
-LL | }
-   | - the item list ends here
-
-error: aborting due to previous error
-
diff --git a/tests/ui/object-safety/assoc_const_bounds_sized.rs b/tests/ui/object-safety/assoc_const_bounds_sized.rs
index 2a76e5dce2b..87d1f06f036 100644
--- a/tests/ui/object-safety/assoc_const_bounds_sized.rs
+++ b/tests/ui/object-safety/assoc_const_bounds_sized.rs
@@ -1,7 +1,12 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features, dead_code)]
+
+// check-pass
+
 trait Foo {
     const BAR: bool
-        where //~ ERROR: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
-            Self: Sized;
+    where
+        Self: Sized;
 }
 
 fn foo(_: &dyn Foo) {}
diff --git a/tests/ui/object-safety/assoc_const_bounds_sized.stderr b/tests/ui/object-safety/assoc_const_bounds_sized.stderr
deleted file mode 100644
index e1f57f67795..00000000000
--- a/tests/ui/object-safety/assoc_const_bounds_sized.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found keyword `where`
-  --> $DIR/assoc_const_bounds_sized.rs:3:9
-   |
-LL | trait Foo {
-   |           - while parsing this item list starting here
-LL |     const BAR: bool
-   |                    - expected one of 7 possible tokens
-LL |         where
-   |         ^^^^^ unexpected token
-LL |             Self: Sized;
-LL | }
-   | - the item list ends here
-
-error: aborting due to previous error
-
diff --git a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr
index 2592b747918..7263c03bab3 100644
--- a/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr
+++ b/tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr
@@ -3,8 +3,10 @@ stack backtrace:
    0: std::panicking::begin_panic
    1: short_ice_remove_middle_frames_2::eight
    2: short_ice_remove_middle_frames_2::seven::{{closure}}
+      [... omitted 3 frames ...]
    3: short_ice_remove_middle_frames_2::fifth
    4: short_ice_remove_middle_frames_2::fourth::{{closure}}
+      [... omitted 4 frames ...]
    5: short_ice_remove_middle_frames_2::first
    6: short_ice_remove_middle_frames_2::main
    7: core::ops::function::FnOnce::call_once
diff --git a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr
index 9c15f2e08fe..a2216680660 100644
--- a/tests/ui/panics/short-ice-remove-middle-frames.run.stderr
+++ b/tests/ui/panics/short-ice-remove-middle-frames.run.stderr
@@ -4,6 +4,7 @@ stack backtrace:
    1: short_ice_remove_middle_frames::seven
    2: short_ice_remove_middle_frames::sixth
    3: short_ice_remove_middle_frames::fifth::{{closure}}
+      [... omitted 4 frames ...]
    4: short_ice_remove_middle_frames::second
    5: short_ice_remove_middle_frames::first::{{closure}}
    6: short_ice_remove_middle_frames::first
diff --git a/tests/ui/parser/generic-statics.rs b/tests/ui/parser/generic-statics.rs
new file mode 100644
index 00000000000..2fb8781fdff
--- /dev/null
+++ b/tests/ui/parser/generic-statics.rs
@@ -0,0 +1,4 @@
+static S<T>: i32 = 0;
+//~^ ERROR static items may not have generic parameters
+
+fn main() {}
diff --git a/tests/ui/parser/generic-statics.stderr b/tests/ui/parser/generic-statics.stderr
new file mode 100644
index 00000000000..c757232b061
--- /dev/null
+++ b/tests/ui/parser/generic-statics.stderr
@@ -0,0 +1,8 @@
+error: static items may not have generic parameters
+  --> $DIR/generic-statics.rs:1:9
+   |
+LL | static S<T>: i32 = 0;
+   |         ^^^
+
+error: aborting due to previous error
+
diff --git a/tests/ui/parser/ternary_operator.rs b/tests/ui/parser/ternary_operator.rs
new file mode 100644
index 00000000000..23d537e77f7
--- /dev/null
+++ b/tests/ui/parser/ternary_operator.rs
@@ -0,0 +1,69 @@
+// A good chunk of these errors aren't shown to the user, but are still
+// required in the test for it to pass.
+
+fn a() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+    let x = 5 > 2 ? true : false;
+    //~^ ERROR Rust has no ternary operator
+    //~| HELP use an `if-else` expression instead
+    //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
+    //~| HELP the trait `Try` is not implemented for `{integer}`
+    //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
+    //~| HELP the trait `FromResidual<_>` is not implemented for `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE the `?` operator cannot be applied to type `{integer}`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE cannot use the `?` operator in a function that returns `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+}
+
+fn b() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+    let x = 5 > 2 ? { true } : { false };
+    //~^ ERROR Rust has no ternary operator
+    //~| HELP use an `if-else` expression instead
+    //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
+    //~| HELP the trait `Try` is not implemented for `{integer}`
+    //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
+    //~| HELP the trait `FromResidual<_>` is not implemented for `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE the `?` operator cannot be applied to type `{integer}`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE cannot use the `?` operator in a function that returns `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+}
+
+fn c() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+    let x = 5 > 2 ? f32::MAX : f32::MIN;
+    //~^ ERROR Rust has no ternary operator
+    //~| HELP use an `if-else` expression instead
+    //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
+    //~| HELP the trait `Try` is not implemented for `{integer}`
+    //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
+    //~| HELP the trait `FromResidual<_>` is not implemented for `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE the `?` operator cannot be applied to type `{integer}`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE cannot use the `?` operator in a function that returns `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+}
+
+fn main() { //~ NOTE this function should return `Result` or `Option` to accept `?`
+    let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
+    //~^ ERROR Rust has no ternary operator
+    //~| HELP use an `if-else` expression instead
+    //~| ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `:`
+    //~| NOTE expected one of `.`, `;`, `?`, `else`, or an operator
+    //~| ERROR the `?` operator can only be applied to values that implement `Try` [E0277]
+    //~| HELP the trait `Try` is not implemented for `{integer}`
+    //~| ERROR the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) [E0277]
+    //~| HELP the trait `FromResidual<_>` is not implemented for `()`
+    //~| NOTE type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE the `?` operator cannot be applied to type `{integer}`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE in this expansion of desugaring of operator `?`
+    //~| NOTE cannot use the `?` operator in a function that returns `()`
+    //~| NOTE in this expansion of desugaring of operator `?`
+}
diff --git a/tests/ui/parser/ternary_operator.stderr b/tests/ui/parser/ternary_operator.stderr
new file mode 100644
index 00000000000..af9565bbead
--- /dev/null
+++ b/tests/ui/parser/ternary_operator.stderr
@@ -0,0 +1,115 @@
+error: Rust has no ternary operator
+  --> $DIR/ternary_operator.rs:5:19
+   |
+LL |     let x = 5 > 2 ? true : false;
+   |                   ^^^^^^^^^^^^^^^
+   |
+   = help: use an `if-else` expression instead
+
+error: Rust has no ternary operator
+  --> $DIR/ternary_operator.rs:21:19
+   |
+LL |     let x = 5 > 2 ? { true } : { false };
+   |                   ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: use an `if-else` expression instead
+
+error: Rust has no ternary operator
+  --> $DIR/ternary_operator.rs:37:19
+   |
+LL |     let x = 5 > 2 ? f32::MAX : f32::MIN;
+   |                   ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: use an `if-else` expression instead
+
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `:`
+  --> $DIR/ternary_operator.rs:53:37
+   |
+LL |     let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
+   |                                     ^ expected one of `.`, `;`, `?`, `else`, or an operator
+   |
+   = note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+
+error: Rust has no ternary operator
+  --> $DIR/ternary_operator.rs:53:19
+   |
+LL |     let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
+   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: use an `if-else` expression instead
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/ternary_operator.rs:5:17
+   |
+LL |     let x = 5 > 2 ? true : false;
+   |                 ^^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
+  --> $DIR/ternary_operator.rs:5:19
+   |
+LL | fn a() {
+   | ------ this function should return `Result` or `Option` to accept `?`
+LL |     let x = 5 > 2 ? true : false;
+   |                   ^ cannot use the `?` operator in a function that returns `()`
+   |
+   = help: the trait `FromResidual<_>` is not implemented for `()`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/ternary_operator.rs:21:17
+   |
+LL |     let x = 5 > 2 ? { true } : { false };
+   |                 ^^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
+  --> $DIR/ternary_operator.rs:21:19
+   |
+LL | fn b() {
+   | ------ this function should return `Result` or `Option` to accept `?`
+LL |     let x = 5 > 2 ? { true } : { false };
+   |                   ^ cannot use the `?` operator in a function that returns `()`
+   |
+   = help: the trait `FromResidual<_>` is not implemented for `()`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/ternary_operator.rs:37:17
+   |
+LL |     let x = 5 > 2 ? f32::MAX : f32::MIN;
+   |                 ^^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
+  --> $DIR/ternary_operator.rs:37:19
+   |
+LL | fn c() {
+   | ------ this function should return `Result` or `Option` to accept `?`
+LL |     let x = 5 > 2 ? f32::MAX : f32::MIN;
+   |                   ^ cannot use the `?` operator in a function that returns `()`
+   |
+   = help: the trait `FromResidual<_>` is not implemented for `()`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/ternary_operator.rs:53:17
+   |
+LL |     let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
+   |                 ^^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
+  --> $DIR/ternary_operator.rs:53:19
+   |
+LL | fn main() {
+   | --------- this function should return `Result` or `Option` to accept `?`
+LL |     let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
+   |                   ^ cannot use the `?` operator in a function that returns `()`
+   |
+   = help: the trait `FromResidual<_>` is not implemented for `()`
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/privacy/issue-113860-1.rs b/tests/ui/privacy/issue-113860-1.rs
new file mode 100644
index 00000000000..86ccca41f37
--- /dev/null
+++ b/tests/ui/privacy/issue-113860-1.rs
@@ -0,0 +1,16 @@
+#![feature(staged_api)]
+//~^ ERROR module has missing stability attribute
+
+pub trait Trait {
+    //~^ ERROR trait has missing stability attribute
+    fn fun() {}
+    //~^ ERROR associated function has missing stability attribute
+}
+
+impl Trait for u8 {
+    //~^ ERROR implementation has missing stability attribute
+    pub(self) fn fun() {}
+    //~^ ERROR visibility qualifiers are not permitted here [E0449]
+}
+
+fn main() {}
diff --git a/tests/ui/privacy/issue-113860-1.stderr b/tests/ui/privacy/issue-113860-1.stderr
new file mode 100644
index 00000000000..c33ce26f0f6
--- /dev/null
+++ b/tests/ui/privacy/issue-113860-1.stderr
@@ -0,0 +1,49 @@
+error[E0449]: visibility qualifiers are not permitted here
+  --> $DIR/issue-113860-1.rs:12:5
+   |
+LL |     pub(self) fn fun() {}
+   |     ^^^^^^^^^
+   |
+   = note: trait items always share the visibility of their trait
+
+error: module has missing stability attribute
+  --> $DIR/issue-113860-1.rs:1:1
+   |
+LL | / #![feature(staged_api)]
+LL | |
+LL | |
+LL | | pub trait Trait {
+...  |
+LL | |
+LL | | fn main() {}
+   | |____________^
+
+error: trait has missing stability attribute
+  --> $DIR/issue-113860-1.rs:4:1
+   |
+LL | / pub trait Trait {
+LL | |
+LL | |     fn fun() {}
+LL | |
+LL | | }
+   | |_^
+
+error: implementation has missing stability attribute
+  --> $DIR/issue-113860-1.rs:10:1
+   |
+LL | / impl Trait for u8 {
+LL | |
+LL | |     pub(self) fn fun() {}
+LL | |
+LL | | }
+   | |_^
+
+error: associated function has missing stability attribute
+  --> $DIR/issue-113860-1.rs:6:5
+   |
+LL |     fn fun() {}
+   |     ^^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0449`.
diff --git a/tests/ui/privacy/issue-113860-2.rs b/tests/ui/privacy/issue-113860-2.rs
new file mode 100644
index 00000000000..59be19d88a0
--- /dev/null
+++ b/tests/ui/privacy/issue-113860-2.rs
@@ -0,0 +1,16 @@
+#![feature(staged_api)]
+//~^ ERROR module has missing stability attribute
+
+pub trait Trait {
+    //~^ ERROR trait has missing stability attribute
+    type X;
+    //~^ ERROR associated type has missing stability attribute
+}
+
+impl Trait for u8 {
+    //~^ ERROR implementation has missing stability attribute
+    pub(self) type X = Self;
+    //~^ ERROR visibility qualifiers are not permitted here [E0449]
+}
+
+fn main() {}
diff --git a/tests/ui/privacy/issue-113860-2.stderr b/tests/ui/privacy/issue-113860-2.stderr
new file mode 100644
index 00000000000..6748bc27668
--- /dev/null
+++ b/tests/ui/privacy/issue-113860-2.stderr
@@ -0,0 +1,49 @@
+error[E0449]: visibility qualifiers are not permitted here
+  --> $DIR/issue-113860-2.rs:12:5
+   |
+LL |     pub(self) type X = Self;
+   |     ^^^^^^^^^
+   |
+   = note: trait items always share the visibility of their trait
+
+error: module has missing stability attribute
+  --> $DIR/issue-113860-2.rs:1:1
+   |
+LL | / #![feature(staged_api)]
+LL | |
+LL | |
+LL | | pub trait Trait {
+...  |
+LL | |
+LL | | fn main() {}
+   | |____________^
+
+error: trait has missing stability attribute
+  --> $DIR/issue-113860-2.rs:4:1
+   |
+LL | / pub trait Trait {
+LL | |
+LL | |     type X;
+LL | |
+LL | | }
+   | |_^
+
+error: implementation has missing stability attribute
+  --> $DIR/issue-113860-2.rs:10:1
+   |
+LL | / impl Trait for u8 {
+LL | |
+LL | |     pub(self) type X = Self;
+LL | |
+LL | | }
+   | |_^
+
+error: associated type has missing stability attribute
+  --> $DIR/issue-113860-2.rs:6:5
+   |
+LL |     type X;
+   |     ^^^^^^^
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0449`.
diff --git a/tests/ui/privacy/issue-113860.rs b/tests/ui/privacy/issue-113860.rs
new file mode 100644
index 00000000000..b94c14fac4e
--- /dev/null
+++ b/tests/ui/privacy/issue-113860.rs
@@ -0,0 +1,16 @@
+#![feature(staged_api)]
+//~^ ERROR module has missing stability attribute
+
+pub trait Trait {
+    //~^ ERROR trait has missing stability attribute
+    const X: u32;
+    //~^ ERROR associated constant has missing stability attribute
+}
+
+impl Trait for u8 {
+    //~^ ERROR implementation has missing stability attribute
+    pub(self) const X: u32 = 3;
+    //~^ ERROR visibility qualifiers are not permitted here [E0449]
+}
+
+fn main() {}
diff --git a/tests/ui/privacy/issue-113860.stderr b/tests/ui/privacy/issue-113860.stderr
new file mode 100644
index 00000000000..3204f4ff916
--- /dev/null
+++ b/tests/ui/privacy/issue-113860.stderr
@@ -0,0 +1,49 @@
+error[E0449]: visibility qualifiers are not permitted here
+  --> $DIR/issue-113860.rs:12:5
+   |
+LL |     pub(self) const X: u32 = 3;
+   |     ^^^^^^^^^
+   |
+   = note: trait items always share the visibility of their trait
+
+error: module has missing stability attribute
+  --> $DIR/issue-113860.rs:1:1
+   |
+LL | / #![feature(staged_api)]
+LL | |
+LL | |
+LL | | pub trait Trait {
+...  |
+LL | |
+LL | | fn main() {}
+   | |____________^
+
+error: trait has missing stability attribute
+  --> $DIR/issue-113860.rs:4:1
+   |
+LL | / pub trait Trait {
+LL | |
+LL | |     const X: u32;
+LL | |
+LL | | }
+   | |_^
+
+error: implementation has missing stability attribute
+  --> $DIR/issue-113860.rs:10:1
+   |
+LL | / impl Trait for u8 {
+LL | |
+LL | |     pub(self) const X: u32 = 3;
+LL | |
+LL | | }
+   | |_^
+
+error: associated constant has missing stability attribute
+  --> $DIR/issue-113860.rs:6:5
+   |
+LL |     const X: u32;
+   |     ^^^^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0449`.
diff --git a/tests/ui/privacy/unnameable_types.rs b/tests/ui/privacy/unnameable_types.rs
index eae20dd9df3..46e24915259 100644
--- a/tests/ui/privacy/unnameable_types.rs
+++ b/tests/ui/privacy/unnameable_types.rs
@@ -11,12 +11,12 @@ mod m {
 
     pub trait PubTr { //~ ERROR trait `PubTr` is reachable but cannot be named
         const C : i32 = 0;
-        type Alias; //~ ERROR associated type `PubTr::Alias` is reachable but cannot be named
+        type Alias;
         fn f() {}
     }
 
     impl PubTr for PubStruct {
-        type Alias = i32; //~ ERROR associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
+        type Alias = i32;
         fn f() {}
     }
 }
diff --git a/tests/ui/privacy/unnameable_types.stderr b/tests/ui/privacy/unnameable_types.stderr
index 25eb5c9434a..90412752575 100644
--- a/tests/ui/privacy/unnameable_types.stderr
+++ b/tests/ui/privacy/unnameable_types.stderr
@@ -22,17 +22,5 @@ error: trait `PubTr` is reachable but cannot be named
 LL |     pub trait PubTr {
    |     ^^^^^^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
 
-error: associated type `PubTr::Alias` is reachable but cannot be named
-  --> $DIR/unnameable_types.rs:14:9
-   |
-LL |         type Alias;
-   |         ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
-
-error: associated type `<PubStruct as PubTr>::Alias` is reachable but cannot be named
-  --> $DIR/unnameable_types.rs:19:9
-   |
-LL |         type Alias = i32;
-   |         ^^^^^^^^^^ reachable at visibility `pub`, but can only be named at visibility `pub(crate)`
-
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/proc-macro/derive-helper-shadowed.rs b/tests/ui/proc-macro/derive-helper-shadowed.rs
index e299454e0fc..ac14ece6918 100644
--- a/tests/ui/proc-macro/derive-helper-shadowed.rs
+++ b/tests/ui/proc-macro/derive-helper-shadowed.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 // aux-build:derive-helper-shadowed-2.rs
 
diff --git a/tests/ui/proc-macro/derive-in-mod.rs b/tests/ui/proc-macro/derive-in-mod.rs
index 8b5d4e9d09c..96e9d93fe12 100644
--- a/tests/ui/proc-macro/derive-in-mod.rs
+++ b/tests/ui/proc-macro/derive-in-mod.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 
 extern crate test_macros;
diff --git a/tests/ui/proc-macro/edition-imports-2018.rs b/tests/ui/proc-macro/edition-imports-2018.rs
index 5a77cd4ef4f..76567353198 100644
--- a/tests/ui/proc-macro/edition-imports-2018.rs
+++ b/tests/ui/proc-macro/edition-imports-2018.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 // aux-build:edition-imports-2015.rs
 
diff --git a/tests/ui/proc-macro/extern-prelude-extern-crate-proc-macro.rs b/tests/ui/proc-macro/extern-prelude-extern-crate-proc-macro.rs
index a6e64e1b1b1..38f61c36c8c 100644
--- a/tests/ui/proc-macro/extern-prelude-extern-crate-proc-macro.rs
+++ b/tests/ui/proc-macro/extern-prelude-extern-crate-proc-macro.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 
 extern crate proc_macro;
diff --git a/tests/ui/proc-macro/helper-attr-blocked-by-import.rs b/tests/ui/proc-macro/helper-attr-blocked-by-import.rs
index 2e20a3de6bf..344323122dc 100644
--- a/tests/ui/proc-macro/helper-attr-blocked-by-import.rs
+++ b/tests/ui/proc-macro/helper-attr-blocked-by-import.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 
 #[macro_use(Empty)]
diff --git a/tests/ui/proc-macro/issue-53481.rs b/tests/ui/proc-macro/issue-53481.rs
index ae10a3baa3e..922e60a4c4f 100644
--- a/tests/ui/proc-macro/issue-53481.rs
+++ b/tests/ui/proc-macro/issue-53481.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 
 #[macro_use]
diff --git a/tests/ui/proc-macro/macro-use-attr.rs b/tests/ui/proc-macro/macro-use-attr.rs
index b101c09ed54..d275fb6a804 100644
--- a/tests/ui/proc-macro/macro-use-attr.rs
+++ b/tests/ui/proc-macro/macro-use-attr.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 
 #[macro_use]
diff --git a/tests/ui/proc-macro/macro-use-bang.rs b/tests/ui/proc-macro/macro-use-bang.rs
index 4a0bf0b2f63..e3174fd446a 100644
--- a/tests/ui/proc-macro/macro-use-bang.rs
+++ b/tests/ui/proc-macro/macro-use-bang.rs
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:test-macros.rs
 
 #[macro_use]
diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs
new file mode 100644
index 00000000000..47c590ce2f0
--- /dev/null
+++ b/tests/ui/process/println-with-broken-pipe.rs
@@ -0,0 +1,44 @@
+// run-pass
+// check-run-results
+// ignore-windows
+// ignore-emscripten
+// ignore-fuchsia
+// ignore-horizon
+// ignore-android
+// normalize-stderr-test ".rs:\d+:\d+" -> ".rs:LL:CC"
+
+// Test what the error message looks like when `println!()` panics because of
+// `std::io::ErrorKind::BrokenPipe`
+
+#![feature(unix_sigpipe)]
+
+use std::env;
+use std::process::{Command, Stdio};
+
+#[unix_sigpipe = "sig_ign"]
+fn main() {
+    let mut args = env::args();
+    let me = args.next().unwrap();
+
+    if let Some(arg) = args.next() {
+        // More than enough iterations to fill any pipe buffer. Normally this
+        // loop will end with a panic more or less immediately.
+        for _ in 0..65536 * 64 {
+            println!("{arg}");
+        }
+        unreachable!("should have panicked because of BrokenPipe");
+    }
+
+    // Set up a pipeline with a short-lived consumer and wait for it to finish.
+    // This will produce the `println!()` panic message on stderr.
+    let mut producer = Command::new(&me)
+        .arg("this line shall appear exactly once on stdout")
+        .env("RUST_BACKTRACE", "0")
+        .stdout(Stdio::piped())
+        .spawn()
+        .unwrap();
+    let mut consumer =
+        Command::new("head").arg("-n1").stdin(producer.stdout.take().unwrap()).spawn().unwrap();
+    consumer.wait().unwrap();
+    producer.wait().unwrap();
+}
diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr
new file mode 100644
index 00000000000..ebcd920d501
--- /dev/null
+++ b/tests/ui/process/println-with-broken-pipe.run.stderr
@@ -0,0 +1,2 @@
+thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:LL:CC
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/process/println-with-broken-pipe.run.stdout b/tests/ui/process/println-with-broken-pipe.run.stdout
new file mode 100644
index 00000000000..f55c39578b1
--- /dev/null
+++ b/tests/ui/process/println-with-broken-pipe.run.stdout
@@ -0,0 +1 @@
+this line shall appear exactly once on stdout
diff --git a/tests/ui/resolve/issue-112831.rs b/tests/ui/resolve/derive-macro-1.rs
index ffd83ea8bc1..90cbd903ad6 100644
--- a/tests/ui/resolve/issue-112831.rs
+++ b/tests/ui/resolve/derive-macro-1.rs
@@ -1,19 +1,17 @@
 // check-pass
 // aux-build:issue-112831-aux.rs
 
-mod zeroable {
+mod z {
     pub trait Zeroable {}
 }
 
-use zeroable::*;
+use z::*;
 
 mod pod {
     use super::*;
     pub trait Pod: Zeroable {}
 }
 
-use pod::*;
-
 extern crate issue_112831_aux;
 use issue_112831_aux::Zeroable;
 
diff --git a/tests/ui/resolve/derive-macro-2.rs b/tests/ui/resolve/derive-macro-2.rs
new file mode 100644
index 00000000000..7cecdd9e38e
--- /dev/null
+++ b/tests/ui/resolve/derive-macro-2.rs
@@ -0,0 +1,18 @@
+// check-pass
+// aux-build:issue-112831-aux.rs
+
+extern crate issue_112831_aux;
+use issue_112831_aux::Zeroable;
+
+mod z {
+    pub trait Zeroable {}
+}
+
+use z::*;
+
+mod pod {
+    use super::*;
+    pub trait Pod: Zeroable {}
+}
+
+fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
index dd993397420..646955fd867 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
@@ -23,7 +23,7 @@ pub const fn add_i32(a: i32, b: i32) -> i32 {
 
 pub const fn add_u32(a: u32, b: u32) -> u32 {
     a.plus(b)
-    //~^ ERROR the trait bound
+    //~^ ERROR cannot call
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
index 7350909ba8e..0ee1b1a5cb2 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
@@ -1,15 +1,11 @@
-error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
+error[E0015]: cannot call non-const fn `<u32 as Plus>::plus` in constant functions
   --> $DIR/call-const-trait-method-fail.rs:25:7
    |
 LL |     a.plus(b)
-   |       ^^^^ the trait `~const Plus` is not implemented for `u32`
+   |       ^^^^^^^
    |
-note: the trait `Plus` is implemented for `u32`, but that implementation is not `const`
-  --> $DIR/call-const-trait-method-fail.rs:25:7
-   |
-LL |     a.plus(b)
-   |       ^^^^
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
index 3963f64ad32..d50100d033e 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
@@ -1,15 +1,3 @@
-error[E0277]: can't compare `T` with `T` in const contexts
-  --> $DIR/call-generic-method-fail.rs:5:5
-   |
-LL |     *t == *t
-   |     ^^^^^^^^ no implementation for `T == T`
-   |
-note: the trait `PartialEq` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/call-generic-method-fail.rs:5:5
-   |
-LL |     *t == *t
-   |     ^^^^^^^^
-
 error[E0015]: cannot call non-const operator in constant functions
   --> $DIR/call-generic-method-fail.rs:5:5
    |
@@ -22,7 +10,6 @@ help: consider further restricting this bound
 LL | pub const fn equals_self<T: PartialEq + ~const std::cmp::PartialEq>(t: &T) -> bool {
    |                                       ++++++++++++++++++++++++++++
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
index 414a8c87d2c..eada4ceafe9 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
@@ -1,3 +1,6 @@
+// check-pass
+// known-bug: #110395
+
 #![feature(const_trait_impl)]
 
 struct S;
@@ -21,6 +24,6 @@ const fn equals_self<T: ~const Foo>(t: &T) -> bool {
 // it not using the impl.
 
 pub const EQ: bool = equals_self(&S);
-//~^ ERROR
+// FIXME(effects) ~^ ERROR
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
deleted file mode 100644
index a28d6ce05a7..00000000000
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `S: ~const Foo` is not satisfied
-  --> $DIR/call-generic-method-nonconst.rs:23:22
-   |
-LL | pub const EQ: bool = equals_self(&S);
-   |                      ^^^^^^^^^^^^^^^ the trait `~const Foo` is not implemented for `S`
-   |
-note: the trait `Foo` is implemented for `S`, but that implementation is not `const`
-  --> $DIR/call-generic-method-nonconst.rs:23:22
-   |
-LL | pub const EQ: bool = equals_self(&S);
-   |                      ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
index 112416a3543..c350e3e4061 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr
@@ -1,16 +1,21 @@
-error[E0277]: the trait bound `(): ~const Tr` is not satisfied in `fn(()) -> i32 {<() as Tr>::a}`
-  --> $DIR/const-closure-trait-method-fail.rs:18:23
+error[E0080]: evaluation of constant value failed
+  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
    |
-LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^ within `fn(()) -> i32 {<() as Tr>::a}`, the trait `~const Tr` is not implemented for `()`
+   = note: calling non-const function `<() as Tr>::a`
+   |
+note: inside `<fn(()) -> i32 {<() as Tr>::a} as FnOnce<((),)>>::call_once - shim(fn(()) -> i32 {<() as Tr>::a})`
+  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
+note: inside `need_const_closure::<fn(()) -> i32 {<() as Tr>::a}>`
+  --> $DIR/const-closure-trait-method-fail.rs:15:5
    |
-note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
+LL |     x(())
+   |     ^^^^^
+note: inside `_`
   --> $DIR/const-closure-trait-method-fail.rs:18:23
    |
 LL | const _: () = assert!(need_const_closure(Tr::a) == 42);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: required because it appears within the type `fn(()) -> i32 {<() as Tr>::a}`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs
index 140a06a73ac..3370f32061c 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs
@@ -22,7 +22,7 @@ impl const ConstDefaultFn for ConstImpl {
 
 const fn test() {
     NonConstImpl.a();
-    //~^ ERROR the trait bound
+    //~^ ERROR cannot call
     ConstImpl.a();
 }
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
index f9d0d1f7875..414688f71ed 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
@@ -1,15 +1,11 @@
-error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satisfied
+error[E0015]: cannot call non-const fn `<NonConstImpl as ConstDefaultFn>::a` in constant functions
   --> $DIR/const-default-method-bodies.rs:24:18
    |
 LL |     NonConstImpl.a();
-   |                  ^ the trait `~const ConstDefaultFn` is not implemented for `NonConstImpl`
+   |                  ^^^
    |
-note: the trait `ConstDefaultFn` is implemented for `NonConstImpl`, but that implementation is not `const`
-  --> $DIR/const-default-method-bodies.rs:24:5
-   |
-LL |     NonConstImpl.a();
-   |     ^^^^^^^^^^^^
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs
index 948f0efbcfc..7f89c12804b 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs
@@ -1,4 +1,5 @@
-// check-pass
+// known-bug: #110395
+// FIXME check-pass
 
 #![feature(const_trait_impl)]
 #![feature(const_precise_live_drops)]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr
new file mode 100644
index 00000000000..f5147dc74b8
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr
@@ -0,0 +1,9 @@
+error[E0493]: destructor of `E` cannot be evaluated at compile-time
+  --> $DIR/const-drop-bound.rs:12:13
+   |
+LL |         Err(_e) => None,
+   |             ^^ the destructor for this type cannot be evaluated in constant functions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
index 375f5d2c52d..ce27e42f8c2 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr
@@ -1,50 +1,11 @@
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
-  --> $DIR/const-drop-fail-2.rs:31:23
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop-fail-2.rs:29:36
    |
-LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
-   |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail-2.rs:31:23
-   |
-LL | const _: () = check::<ConstDropImplWithBounds<NonTrivialDrop>>(
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
-  --> $DIR/const-drop-fail-2.rs:21:35
-   |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
-   |                                   ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
-  --> $DIR/const-drop-fail-2.rs:32:5
-   |
-LL |     ConstDropImplWithBounds(PhantomData)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
-   |
-note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail-2.rs:32:5
-   |
-LL |     ConstDropImplWithBounds(PhantomData)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `ConstDropImplWithBounds`
-  --> $DIR/const-drop-fail-2.rs:21:35
-   |
-LL | struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
-   |                                   ^^^^^^^^ required by this bound in `ConstDropImplWithBounds`
-
-error[E0367]: `Drop` impl requires `T: ~const A` but the struct it is implemented for does not
-  --> $DIR/const-drop-fail-2.rs:37:9
-   |
-LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
-   |         ^^^^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/const-drop-fail-2.rs:35:1
-   |
-LL | struct ConstDropImplWithNonConstBounds<T: A>(PhantomData<T>);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                                    ^      - value is dropped here
+   |                                    |
+   |                                    the destructor for this type cannot be evaluated in constant functions
 
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0277, E0367.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
index e745cbd2442..dfa5ea8c4af 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
@@ -1,58 +1,9 @@
-error[E0277]: can't drop `NonTrivialDrop` in const contexts
-  --> $DIR/const-drop-fail.rs:28:23
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop-fail.rs:24:36
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   |
-note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: can't drop `NonTrivialDrop` in const contexts
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   |
-note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-note: required because it appears within the type `ConstImplWithDropGlue`
-  --> $DIR/const-drop-fail.rs:18:8
-   |
-LL | struct ConstImplWithDropGlue(NonTrivialDrop);
-   |        ^^^^^^^^^^^^^^^^^^^^^
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                                    ^ the destructor for this type cannot be evaluated in constant functions
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
index e745cbd2442..8af38b792e6 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
@@ -1,58 +1,11 @@
-error[E0277]: can't drop `NonTrivialDrop` in const contexts
-  --> $DIR/const-drop-fail.rs:28:23
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop-fail.rs:24:36
    |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   |
-note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0277]: can't drop `NonTrivialDrop` in const contexts
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-   |
-note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
-  --> $DIR/const-drop-fail.rs:28:23
-   |
-LL |           const _: () = check($exp);
-   |                         ^^^^^^^^^^^
-...
-LL | / check_all! {
-LL | |     NonTrivialDrop,
-LL | |     ConstImplWithDropGlue(NonTrivialDrop),
-LL | | }
-   | |_- in this macro invocation
-note: required because it appears within the type `ConstImplWithDropGlue`
-  --> $DIR/const-drop-fail.rs:18:8
-   |
-LL | struct ConstImplWithDropGlue(NonTrivialDrop);
-   |        ^^^^^^^^^^^^^^^^^^^^^
-   = note: this error originates in the macro `check_all` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | const fn check<T: ~const Destruct>(_: T) {}
+   |                                    ^      - value is dropped here
+   |                                    |
+   |                                    the destructor for this type cannot be evaluated in constant functions
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0493`.
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
new file mode 100644
index 00000000000..23e36887025
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
@@ -0,0 +1,19 @@
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:19:32
+   |
+LL | const fn a<T: ~const Destruct>(_: T) {}
+   |                                ^      - value is dropped here
+   |                                |
+   |                                the destructor for this type cannot be evaluated in constant functions
+
+error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:24:13
+   |
+LL |     let _ = S(&mut c);
+   |             ^^^^^^^^^- value is dropped here
+   |             |
+   |             the destructor for this type cannot be evaluated in constant functions
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
index b0fc3adf984..0a9cf638a2d 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs
@@ -1,9 +1,10 @@
-// run-pass
+// FIXME run-pass
+// known-bug: #110395
 // revisions: stock precise
 #![feature(const_trait_impl)]
 #![feature(const_mut_refs)]
 #![feature(never_type)]
-#![cfg_attr(precise, feature(const_precise_live_drops))]
+// #![cfg_attr(precise, feature(const_precise_live_drops))]
 
 use std::marker::Destruct;
 
@@ -16,10 +17,12 @@ impl<'a> const Drop for S<'a> {
 }
 
 const fn a<T: ~const Destruct>(_: T) {}
+//FIXME ~^ ERROR destructor of
 
 const fn b() -> u8 {
     let mut c = 0;
     let _ = S(&mut c);
+    //FIXME ~^ ERROR destructor of
     a(S(&mut c));
     c
 }
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
new file mode 100644
index 00000000000..23e36887025
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
@@ -0,0 +1,19 @@
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:19:32
+   |
+LL | const fn a<T: ~const Destruct>(_: T) {}
+   |                                ^      - value is dropped here
+   |                                |
+   |                                the destructor for this type cannot be evaluated in constant functions
+
+error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
+  --> $DIR/const-drop.rs:24:13
+   |
+LL |     let _ = S(&mut c);
+   |             ^^^^^^^^^- value is dropped here
+   |             |
+   |             the destructor for this type cannot be evaluated in constant functions
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
index 633b7cc255a..c936270de26 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
@@ -1,15 +1,11 @@
-error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrait` is not satisfied
+error[E0015]: cannot call non-const fn `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions
   --> $DIR/cross-crate.rs:17:14
    |
 LL |     NonConst.func();
-   |              ^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
+   |              ^^^^^^
    |
-note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
-  --> $DIR/cross-crate.rs:17:5
-   |
-LL |     NonConst.func();
-   |     ^^^^^^^^
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs
index 6df47022cc9..1f78af79418 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs
@@ -15,10 +15,11 @@ fn non_const_context() {
 const fn const_context() {
     #[cfg(any(stocknc, gatednc))]
     NonConst.func();
-    //[stocknc]~^ ERROR: the trait bound
-    //[gatednc]~^^ ERROR: the trait bound
+    //[stocknc]~^ ERROR: cannot call
+    //[gatednc]~^^ ERROR: cannot call
     Const.func();
     //[stock]~^ ERROR: cannot call
+    //[stocknc]~^^ ERROR: cannot call
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
index 9e97d3f1137..ebbe9aa2202 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
@@ -1,15 +1,21 @@
-error[E0277]: the trait bound `cross_crate::NonConst: cross_crate::MyTrait` is not satisfied
+error[E0015]: cannot call non-const fn `<cross_crate::NonConst as cross_crate::MyTrait>::func` in constant functions
   --> $DIR/cross-crate.rs:17:14
    |
 LL |     NonConst.func();
-   |              ^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
+   |              ^^^^^^
    |
-note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
-  --> $DIR/cross-crate.rs:17:5
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+   = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
+
+error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions
+  --> $DIR/cross-crate.rs:20:11
    |
-LL |     NonConst.func();
-   |     ^^^^^^^^
+LL |     Const.func();
+   |           ^^^^^^
+   |
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+   = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
index 96acdc300e0..6ffdfa13132 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
@@ -1,3 +1,6 @@
+// known-bug: #110395
+// check-pass
+
 #![feature(const_trait_impl)]
 
 #[const_trait]
@@ -10,7 +13,7 @@ const fn foo<T>() where T: ~const Tr {}
 pub trait Foo {
     fn foo() {
         foo::<()>();
-        //~^ ERROR the trait bound `(): ~const Tr` is not satisfied
+        //FIXME ~^ ERROR the trait bound `(): ~const Tr` is not satisfied
     }
 }
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
deleted file mode 100644
index 26644f72c4e..00000000000
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `(): ~const Tr` is not satisfied
-  --> $DIR/default-method-body-is-const-body-checking.rs:12:9
-   |
-LL |         foo::<()>();
-   |         ^^^^^^^^^^^ the trait `~const Tr` is not implemented for `()`
-   |
-note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
-  --> $DIR/default-method-body-is-const-body-checking.rs:12:9
-   |
-LL |         foo::<()>();
-   |         ^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
index f70ecbc3746..da27724007d 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs
@@ -1,4 +1,4 @@
-#![feature(const_trait_impl)]
+#![feature(const_trait_impl, effects)]
 
 #[const_trait]
 pub trait Tr {
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
index 21ecddaffbb..fe51c1f1ca3 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
@@ -4,11 +4,7 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied
 LL |         ().a()
    |            ^ the trait `~const Tr` is not implemented for `()`
    |
-note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
-  --> $DIR/default-method-body-is-const-same-trait-ck.rs:8:9
-   |
-LL |         ().a()
-   |         ^^
+   = help: the trait `Tr` is implemented for `()`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs
index 07d3f51edce..df242721bc3 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs
@@ -1,11 +1,12 @@
+// known-bug: #110395
 #![feature(const_trait_impl)]
 
 struct Bug {
     inner: [(); match || 1 {
         n => n(),
-        //~^ ERROR the trait bound
-        //~| ERROR the trait bound
-        //~| ERROR cannot call non-const closure in constants
+        //FIXME ~^ ERROR the trait bound
+        //FIXME ~| ERROR the trait bound
+        //FIXME ~| ERROR cannot call non-const closure in constants
     }],
 }
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr
index b98ccbe5d03..f0c61cf9dd9 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr
@@ -1,41 +1,11 @@
-error[E0277]: the trait bound `[closure@$DIR/issue-102985.rs:4:23: 4:25]: ~const Fn<()>` is not satisfied
-  --> $DIR/issue-102985.rs:5:14
-   |
-LL |         n => n(),
-   |              ^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-102985.rs:4:23: 4:25]`, but that implementation is not `const`
-  --> $DIR/issue-102985.rs:5:14
-   |
-LL |         n => n(),
-   |              ^^^
-   = note: wrap the `[closure@$DIR/issue-102985.rs:4:23: 4:25]` in a closure with no arguments: `|| { /* code */ }`
-
-error[E0277]: the trait bound `[closure@$DIR/issue-102985.rs:4:23: 4:25]: ~const Fn<()>` is not satisfied
-  --> $DIR/issue-102985.rs:5:14
-   |
-LL |         n => n(),
-   |              ^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
-   |
-   = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
-note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-102985.rs:4:23: 4:25]`, but that implementation is not `const`
-  --> $DIR/issue-102985.rs:5:14
-   |
-LL |         n => n(),
-   |              ^^^
-   = note: wrap the `[closure@$DIR/issue-102985.rs:4:23: 4:25]` in a closure with no arguments: `|| { /* code */ }`
-
 error[E0015]: cannot call non-const closure in constants
-  --> $DIR/issue-102985.rs:5:14
+  --> $DIR/issue-102985.rs:6:14
    |
 LL |         n => n(),
    |              ^^^
    |
-   = note: closures need an RFC before allowed to be called in constants
    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs
index b132c395ac7..5127ec069be 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs
@@ -1,3 +1,5 @@
+// known-bug: #110395
+
 #![feature(const_trait_impl)]
 
 pub trait A {
@@ -6,8 +8,8 @@ pub trait A {
 
 pub const fn foo<T: A>() -> bool {
     T::assoc()
-    //~^ ERROR the trait bound
-    //~| ERROR cannot call non-const fn
+    //FIXME ~^ ERROR the trait bound
+    //FIXME ~| ERROR cannot call non-const fn
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr
index 95592350520..d8cb10c6517 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr
@@ -1,24 +1,11 @@
-error[E0277]: the trait bound `T: ~const A` is not satisfied
-  --> $DIR/issue-88155.rs:8:5
-   |
-LL |     T::assoc()
-   |     ^^^^^^^^^^ the trait `~const A` is not implemented for `T`
-   |
-note: the trait `A` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/issue-88155.rs:8:5
-   |
-LL |     T::assoc()
-   |     ^^^^^^^^^^
-
 error[E0015]: cannot call non-const fn `<T as A>::assoc` in constant functions
-  --> $DIR/issue-88155.rs:8:5
+  --> $DIR/issue-88155.rs:10:5
    |
 LL |     T::assoc()
    |     ^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs
index 96a3e386e6e..fdb422201d2 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs
@@ -1,6 +1,7 @@
 // Regression test for #92111.
 //
-// check-pass
+// known-bug: #110395
+// FIXME check-pass
 
 #![feature(const_trait_impl)]
 
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr
new file mode 100644
index 00000000000..b27f94f99ed
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr
@@ -0,0 +1,11 @@
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
+  --> $DIR/issue-92111.rs:20:32
+   |
+LL | const fn a<T: ~const Destruct>(t: T) {}
+   |                                ^      - value is dropped here
+   |                                |
+   |                                the destructor for this type cannot be evaluated in constant functions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0493`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr
index bd0dd126c5e..4fe8a372e07 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr
@@ -1,26 +1,12 @@
-error[E0277]: can't compare `str` with `str` in const contexts
-  --> $DIR/match-non-const-eq.rs:6:9
-   |
-LL |         "a" => (),
-   |         ^^^ no implementation for `str == str`
-   |
-   = help: the trait `~const PartialEq` is not implemented for `str`
-note: the trait `PartialEq` is implemented for `str`, but that implementation is not `const`
-  --> $DIR/match-non-const-eq.rs:6:9
-   |
-LL |         "a" => (),
-   |         ^^^
-
 error[E0015]: cannot match on `str` in constant functions
-  --> $DIR/match-non-const-eq.rs:6:9
+  --> $DIR/match-non-const-eq.rs:7:9
    |
-LL |         "a" => (),
+LL |         "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in const contexts
    |         ^^^
    |
    = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs
index 0d04101a383..d06d0d6dd10 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.rs
@@ -1,10 +1,11 @@
+// known-bug: #110395
 // revisions: stock gated
 #![cfg_attr(gated, feature(const_trait_impl))]
 
 const fn foo(input: &'static str) {
     match input {
-        "a" => (), //[gated]~ ERROR can't compare `str` with `str` in const contexts
-        //~^ ERROR cannot match on `str` in constant functions
+        "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in const contexts
+        //FIXME ~^ ERROR cannot match on `str` in constant functions
         _ => (),
     }
 }
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr
index dcb9b49ea04..c36142dac92 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr
@@ -1,7 +1,7 @@
 error[E0015]: cannot match on `str` in constant functions
-  --> $DIR/match-non-const-eq.rs:6:9
+  --> $DIR/match-non-const-eq.rs:7:9
    |
-LL |         "a" => (),
+LL |         "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in const contexts
    |         ^^^
    |
    = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
index f31123f16f1..0701cf93a02 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs
@@ -1,5 +1,6 @@
 // Tests that trait bounds on specializing trait impls must be `~const` if the
 // same bound is present on the default impl and is `~const` there.
+// known-bug: #110395
 
 #![feature(const_trait_impl)]
 #![feature(rustc_attrs)]
@@ -29,7 +30,7 @@ where
 
 impl<T> Bar for T
 where
-    T: Foo, //~ ERROR missing `~const` qualifier
+    T: Foo, //FIXME ~ ERROR missing `~const` qualifier
     T: Specialize,
 {
     fn bar() {}
@@ -47,7 +48,7 @@ where
     default fn baz() {}
 }
 
-impl<T> const Baz for T //~ ERROR conflicting implementations of trait `Baz`
+impl<T> const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz`
 where
     T: Foo,
     T: Specialize,
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 057cf4aea8a..8f5ca2189da 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,18 +1,14 @@
 error: missing `~const` qualifier for specialization
-  --> $DIR/const-default-bound-non-const-specialized-bound.rs:32:8
+  --> $DIR/const-default-bound-non-const-specialized-bound.rs:33:8
    |
-LL |     T: Foo,
+LL |     T: Foo, //FIXME ~ ERROR missing `~const` qualifier
    |        ^^^
 
-error[E0119]: conflicting implementations of trait `Baz`
-  --> $DIR/const-default-bound-non-const-specialized-bound.rs:50:1
+error: missing `~const` qualifier for specialization
+  --> $DIR/const-default-bound-non-const-specialized-bound.rs:53:8
    |
-LL | impl<T> const Baz for T
-   | ----------------------- first implementation here
-...
-LL | impl<T> const Baz for T
-   | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
+LL |     T: Foo,
+   |        ^^^
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs
index 633543700d2..ada475909a3 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs
@@ -1,5 +1,5 @@
 #![feature(const_trait_impl, min_specialization, rustc_attrs)]
-
+// known-bug: #110395
 #[rustc_specialization_trait]
 #[const_trait]
 pub trait Sup {}
@@ -25,7 +25,7 @@ impl<T: Default + ~const Sup> const A for T {
 
 const fn generic<T: Default>() {
     <T as A>::a();
-    //~^ ERROR: the trait bound `T: ~const Sup` is not satisfied
+    //FIXME ~^ ERROR: the trait bound `T: ~const Sup` is not satisfied
 }
 
 fn main() {}
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 8923416f4c7..92bc9815e96 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,21 +1,11 @@
-error[E0277]: the trait bound `T: ~const Sup` is not satisfied
+error[E0015]: cannot call non-const fn `<T as A>::a` in constant functions
   --> $DIR/specializing-constness-2.rs:27:5
    |
 LL |     <T as A>::a();
-   |     ^^^^^^^^^^^^^ the trait `~const Sup` is not implemented for `T`
+   |     ^^^^^^^^^^^^^
    |
-note: required for `T` to implement `~const A`
-  --> $DIR/specializing-constness-2.rs:20:37
-   |
-LL | impl<T: Default + ~const Sup> const A for T {
-   |                   ----------        ^     ^
-   |                   |
-   |                   unsatisfied trait bound introduced here
-help: consider further restricting this bound
-   |
-LL | const fn generic<T: Default + ~const Sup>() {
-   |                             ++++++++++++
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs
index ecb06271cd9..93fd96f8f29 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs
@@ -1,5 +1,5 @@
 #![feature(const_trait_impl)]
-
+// known-bug: #110395
 // revisions: yy yn ny nn
 
 #[cfg_attr(any(yy, yn), const_trait)]
@@ -9,12 +9,12 @@ trait Foo {
 
 #[cfg_attr(any(yy, ny), const_trait)]
 trait Bar: ~const Foo {}
-//[ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
-//[ny,nn]~| ERROR: ~const can only be applied to `#[const_trait]`
+// FIXME [ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
+// FIXME [ny,nn]~| ERROR: ~const can only be applied to `#[const_trait]`
 
 const fn foo<T: Bar>(x: &T) {
     x.a();
-    //[yn,yy]~^ ERROR the trait bound
+    // FIXME [yn,yy]~^ ERROR the trait bound
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
index c9fa1955498..5d34156a519 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
@@ -1,19 +1,11 @@
-error[E0277]: the trait bound `T: ~const Foo` is not satisfied
+error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-2.rs:16:7
    |
 LL |     x.a();
-   |       ^ the trait `~const Foo` is not implemented for `T`
+   |       ^^^
    |
-note: the trait `Foo` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/super-traits-fail-2.rs:16:5
-   |
-LL |     x.a();
-   |     ^
-help: consider further restricting this bound
-   |
-LL | const fn foo<T: Bar + ~const Foo>(x: &T) {
-   |                     ++++++++++++
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
index c9fa1955498..5d34156a519 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
@@ -1,19 +1,11 @@
-error[E0277]: the trait bound `T: ~const Foo` is not satisfied
+error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
   --> $DIR/super-traits-fail-2.rs:16:7
    |
 LL |     x.a();
-   |       ^ the trait `~const Foo` is not implemented for `T`
+   |       ^^^
    |
-note: the trait `Foo` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/super-traits-fail-2.rs:16:5
-   |
-LL |     x.a();
-   |     ^
-help: consider further restricting this bound
-   |
-LL | const fn foo<T: Bar + ~const Foo>(x: &T) {
-   |                     ++++++++++++
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
index 3e2b81368a5..b3853def721 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
@@ -1,3 +1,6 @@
+// check-pass
+// known-bug: #110395
+
 #![feature(const_trait_impl)]
 
 #[const_trait]
@@ -13,6 +16,6 @@ impl Foo for S {
 }
 
 impl const Bar for S {}
-//~^ ERROR the trait bound
+//FIXME ~^ ERROR the trait bound
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
deleted file mode 100644
index bf12ef1ca77..00000000000
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0277]: the trait bound `S: ~const Foo` is not satisfied
-  --> $DIR/super-traits-fail.rs:15:20
-   |
-LL | impl const Bar for S {}
-   |                    ^ the trait `~const Foo` is not implemented for `S`
-   |
-note: the trait `Foo` is implemented for `S`, but that implementation is not `const`
-  --> $DIR/super-traits-fail.rs:15:20
-   |
-LL | impl const Bar for S {}
-   |                    ^
-note: required by a bound in `Bar`
-  --> $DIR/super-traits-fail.rs:8:12
-   |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^^^^^ required by this bound in `Bar`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs
index bfe98b98c74..90e9afd8e52 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs
@@ -2,6 +2,8 @@
 // Checking the validity of traits' where clauses happen at a later stage.
 // (`rustc_const_eval` instead of `rustc_hir_analysis`) Therefore one file as a
 // test is not enough.
+// known-bug: #110395
+// check-pass
 #![feature(const_trait_impl)]
 
 #[const_trait]
@@ -17,9 +19,9 @@ trait Foo {
 const fn test1<T: ~const Foo + Bar>() {
     T::a();
     T::b();
-    //~^ ERROR the trait bound
+    //FIXME ~^ ERROR the trait bound
     T::c::<T>();
-    //~^ ERROR the trait bound
+    //FIXME ~^ ERROR the trait bound
 }
 
 const fn test2<T: ~const Foo + ~const Bar>() {
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
deleted file mode 100644
index f2846b6a662..00000000000
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0277]: the trait bound `T: ~const Bar` is not satisfied
-  --> $DIR/trait-where-clause-const.rs:19:5
-   |
-LL |     T::b();
-   |     ^^^^^^ the trait `~const Bar` is not implemented for `T`
-   |
-note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/trait-where-clause-const.rs:19:5
-   |
-LL |     T::b();
-   |     ^^^^^^
-help: consider further restricting this bound
-   |
-LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
-   |                                    ++++++++++++
-
-error[E0277]: the trait bound `T: ~const Bar` is not satisfied
-  --> $DIR/trait-where-clause-const.rs:21:5
-   |
-LL |     T::c::<T>();
-   |     ^^^^^^^^^^^ the trait `~const Bar` is not implemented for `T`
-   |
-note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
-  --> $DIR/trait-where-clause-const.rs:21:5
-   |
-LL |     T::c::<T>();
-   |     ^^^^^^^^^^^
-help: consider further restricting this bound
-   |
-LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
-   |                                    ++++++++++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
index 3576eed71ab..62fb5238bbd 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
@@ -27,6 +27,10 @@ extern "platform-intrinsic" {
     fn simd_xor<T>(x: T, y: T) -> T;
 
     fn simd_neg<T>(x: T) -> T;
+    fn simd_bswap<T>(x: T) -> T;
+    fn simd_bitreverse<T>(x: T) -> T;
+    fn simd_ctlz<T>(x: T) -> T;
+    fn simd_cttz<T>(x: T) -> T;
 }
 
 fn main() {
@@ -64,6 +68,14 @@ fn main() {
 
         simd_neg(x);
         simd_neg(z);
+        simd_bswap(x);
+        simd_bswap(y);
+        simd_bitreverse(x);
+        simd_bitreverse(y);
+        simd_ctlz(x);
+        simd_ctlz(y);
+        simd_cttz(x);
+        simd_cttz(y);
 
 
         simd_add(0, 0);
@@ -87,6 +99,14 @@ fn main() {
 
         simd_neg(0);
         //~^ ERROR expected SIMD input type, found non-SIMD `i32`
+        simd_bswap(0);
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
+        simd_bitreverse(0);
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
+        simd_ctlz(0);
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
+        simd_cttz(0);
+        //~^ ERROR expected SIMD input type, found non-SIMD `i32`
 
 
         simd_shl(z, z);
@@ -99,5 +119,13 @@ fn main() {
 //~^ ERROR unsupported operation on `f32x4` with element `f32`
         simd_xor(z, z);
 //~^ ERROR unsupported operation on `f32x4` with element `f32`
+        simd_bswap(z);
+//~^ ERROR unsupported operation on `f32x4` with element `f32`
+        simd_bitreverse(z);
+//~^ ERROR unsupported operation on `f32x4` with element `f32`
+        simd_ctlz(z);
+//~^ ERROR unsupported operation on `f32x4` with element `f32`
+        simd_cttz(z);
+//~^ ERROR unsupported operation on `f32x4` with element `f32`
     }
 }
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
index 0f0a7ea6652..db26f3417c9 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
@@ -1,93 +1,141 @@
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:69:9
+  --> $DIR/generic-arithmetic-2.rs:81:9
    |
 LL |         simd_add(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_sub` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:71:9
+  --> $DIR/generic-arithmetic-2.rs:83:9
    |
 LL |         simd_sub(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_mul` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:73:9
+  --> $DIR/generic-arithmetic-2.rs:85:9
    |
 LL |         simd_mul(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_div` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:75:9
+  --> $DIR/generic-arithmetic-2.rs:87:9
    |
 LL |         simd_div(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:77:9
+  --> $DIR/generic-arithmetic-2.rs:89:9
    |
 LL |         simd_shl(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:79:9
+  --> $DIR/generic-arithmetic-2.rs:91:9
    |
 LL |         simd_shr(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:81:9
+  --> $DIR/generic-arithmetic-2.rs:93:9
    |
 LL |         simd_and(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:83:9
+  --> $DIR/generic-arithmetic-2.rs:95:9
    |
 LL |         simd_or(0, 0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:85:9
+  --> $DIR/generic-arithmetic-2.rs:97:9
    |
 LL |         simd_xor(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_neg` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:88:9
+  --> $DIR/generic-arithmetic-2.rs:100:9
    |
 LL |         simd_neg(0);
    |         ^^^^^^^^^^^
 
+error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: expected SIMD input type, found non-SIMD `i32`
+  --> $DIR/generic-arithmetic-2.rs:102:9
+   |
+LL |         simd_bswap(0);
+   |         ^^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: expected SIMD input type, found non-SIMD `i32`
+  --> $DIR/generic-arithmetic-2.rs:104:9
+   |
+LL |         simd_bitreverse(0);
+   |         ^^^^^^^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: expected SIMD input type, found non-SIMD `i32`
+  --> $DIR/generic-arithmetic-2.rs:106:9
+   |
+LL |         simd_ctlz(0);
+   |         ^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: expected SIMD input type, found non-SIMD `i32`
+  --> $DIR/generic-arithmetic-2.rs:108:9
+   |
+LL |         simd_cttz(0);
+   |         ^^^^^^^^^^^^
+
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:92:9
+  --> $DIR/generic-arithmetic-2.rs:112:9
    |
 LL |         simd_shl(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:94:9
+  --> $DIR/generic-arithmetic-2.rs:114:9
    |
 LL |         simd_shr(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:96:9
+  --> $DIR/generic-arithmetic-2.rs:116:9
    |
 LL |         simd_and(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:98:9
+  --> $DIR/generic-arithmetic-2.rs:118:9
    |
 LL |         simd_or(z, z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:100:9
+  --> $DIR/generic-arithmetic-2.rs:120:9
    |
 LL |         simd_xor(z, z);
    |         ^^^^^^^^^^^^^^
 
-error: aborting due to 15 previous errors
+error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: unsupported operation on `f32x4` with element `f32`
+  --> $DIR/generic-arithmetic-2.rs:122:9
+   |
+LL |         simd_bswap(z);
+   |         ^^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: unsupported operation on `f32x4` with element `f32`
+  --> $DIR/generic-arithmetic-2.rs:124:9
+   |
+LL |         simd_bitreverse(z);
+   |         ^^^^^^^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: unsupported operation on `f32x4` with element `f32`
+  --> $DIR/generic-arithmetic-2.rs:126:9
+   |
+LL |         simd_ctlz(z);
+   |         ^^^^^^^^^^^^
+
+error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: unsupported operation on `f32x4` with element `f32`
+  --> $DIR/generic-arithmetic-2.rs:128:9
+   |
+LL |         simd_cttz(z);
+   |         ^^^^^^^^^^^^
+
+error: aborting due to 23 previous errors
 
 For more information about this error, try `rustc --explain E0511`.
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
index c507b8d31ec..f021ee4710a 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-pass.rs
@@ -1,8 +1,6 @@
 // run-pass
 #![allow(non_camel_case_types)]
-
 // ignore-emscripten FIXME(#45351) hits an LLVM assert
-
 #![feature(repr_simd, platform_intrinsics)]
 
 #[repr(simd)]
@@ -22,7 +20,7 @@ macro_rules! all_eq {
         let a = $a;
         let b = $b;
         assert!(a.0 == b.0 && a.1 == b.1 && a.2 == b.2 && a.3 == b.3);
-    }}
+    }};
 }
 
 macro_rules! all_eq_ {
@@ -30,10 +28,9 @@ macro_rules! all_eq_ {
         let a = $a;
         let b = $b;
         assert!(a.0 == b.0);
-    }}
+    }};
 }
 
-
 extern "platform-intrinsic" {
     fn simd_add<T>(x: T, y: T) -> T;
     fn simd_sub<T>(x: T, y: T) -> T;
@@ -47,6 +44,10 @@ extern "platform-intrinsic" {
     fn simd_xor<T>(x: T, y: T) -> T;
 
     fn simd_neg<T>(x: T) -> T;
+    fn simd_bswap<T>(x: T) -> T;
+    fn simd_bitreverse<T>(x: T) -> T;
+    fn simd_ctlz<T>(x: T) -> T;
+    fn simd_cttz<T>(x: T) -> T;
 }
 
 fn main() {
@@ -84,8 +85,8 @@ fn main() {
         all_eq_!(simd_div(y1, y1), U32::<4>([1, 1, 1, 1]));
         all_eq_!(simd_div(U32::<4>([2, 4, 6, 8]), U32::<4>([2, 2, 2, 2])), y1);
         all_eq!(simd_div(z1, z1), f32x4(1.0, 1.0, 1.0, 1.0));
-        all_eq!(simd_div(z1, z2), f32x4(1.0/2.0, 2.0/3.0, 3.0/4.0, 4.0/5.0));
-        all_eq!(simd_div(z2, z1), f32x4(2.0/1.0, 3.0/2.0, 4.0/3.0, 5.0/4.0));
+        all_eq!(simd_div(z1, z2), f32x4(1.0 / 2.0, 2.0 / 3.0, 3.0 / 4.0, 4.0 / 5.0));
+        all_eq!(simd_div(z2, z1), f32x4(2.0 / 1.0, 3.0 / 2.0, 4.0 / 3.0, 5.0 / 4.0));
 
         all_eq!(simd_rem(x1, x1), i32x4(0, 0, 0, 0));
         all_eq!(simd_rem(x2, x1), i32x4(0, 1, 1, 1));
@@ -109,8 +110,10 @@ fn main() {
         // ensure we get logical vs. arithmetic shifts correct
         let (a, b, c, d) = (-12, -123, -1234, -12345);
         all_eq!(simd_shr(i32x4(a, b, c, d), x1), i32x4(a >> 1, b >> 2, c >> 3, d >> 4));
-        all_eq_!(simd_shr(U32::<4>([a as u32, b as u32, c as u32, d as u32]), y1),
-                U32::<4>([(a as u32) >> 1, (b as u32) >> 2, (c as u32) >> 3, (d as u32) >> 4]));
+        all_eq_!(
+            simd_shr(U32::<4>([a as u32, b as u32, c as u32, d as u32]), y1),
+            U32::<4>([(a as u32) >> 1, (b as u32) >> 2, (c as u32) >> 3, (d as u32) >> 4])
+        );
 
         all_eq!(simd_and(x1, x2), i32x4(0, 2, 0, 4));
         all_eq!(simd_and(x2, x1), i32x4(0, 2, 0, 4));
@@ -132,5 +135,19 @@ fn main() {
         all_eq!(simd_neg(z1), f32x4(-1.0, -2.0, -3.0, -4.0));
         all_eq!(simd_neg(z2), f32x4(-2.0, -3.0, -4.0, -5.0));
 
+        all_eq!(simd_bswap(x1), i32x4(0x01000000, 0x02000000, 0x03000000, 0x04000000));
+        all_eq_!(simd_bswap(y1), U32::<4>([0x01000000, 0x02000000, 0x03000000, 0x04000000]));
+
+        all_eq!(
+            simd_bitreverse(x1),
+            i32x4(0x80000000u32 as i32, 0x40000000, 0xc0000000u32 as i32, 0x20000000)
+        );
+        all_eq_!(simd_bitreverse(y1), U32::<4>([0x80000000, 0x40000000, 0xc0000000, 0x20000000]));
+
+        all_eq!(simd_ctlz(x1), i32x4(31, 30, 30, 29));
+        all_eq_!(simd_ctlz(y1), U32::<4>([31, 30, 30, 29]));
+
+        all_eq!(simd_cttz(x1), i32x4(0, 1, 0, 2));
+        all_eq_!(simd_cttz(y1), U32::<4>([0, 1, 0, 2]));
     }
 }
diff --git a/tests/ui/simd/intrinsic/generic-bswap-byte.rs b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
new file mode 100644
index 00000000000..13fc942c25a
--- /dev/null
+++ b/tests/ui/simd/intrinsic/generic-bswap-byte.rs
@@ -0,0 +1,22 @@
+// run-pass
+#![feature(repr_simd, platform_intrinsics)]
+#![allow(non_camel_case_types)]
+
+#[repr(simd)]
+#[derive(Copy, Clone)]
+struct i8x4([i8; 4]);
+
+#[repr(simd)]
+#[derive(Copy, Clone)]
+struct u8x4([u8; 4]);
+
+extern "platform-intrinsic" {
+    fn simd_bswap<T>(x: T) -> T;
+}
+
+fn main() {
+    unsafe {
+        assert_eq!(simd_bswap(i8x4([0, 1, 2, 3])).0, [0, 1, 2, 3]);
+        assert_eq!(simd_bswap(u8x4([0, 1, 2, 3])).0, [0, 1, 2, 3]);
+    }
+}
diff --git a/tests/ui/suggestions/copied-and-cloned.fixed b/tests/ui/suggestions/copied-and-cloned.fixed
index 13031f424cb..77159d5075a 100644
--- a/tests/ui/suggestions/copied-and-cloned.fixed
+++ b/tests/ui/suggestions/copied-and-cloned.fixed
@@ -26,6 +26,20 @@ fn main() {
     let y = Some(&s);
     println!("{}", x.as_ref() == y);
     //~^ ERROR mismatched types
-    //~| HELP use `Option::as_ref()` to convert `Option<String>` to `Option<&String>`
+    //~| HELP use `Option::as_ref` to convert `Option<String>` to `Option<&String>`
 
+
+    let mut s = ();
+    let x = Some(s);
+    let y = Some(&mut s);
+    println!("{}", x == y.copied());
+    //~^ ERROR mismatched types
+    //~| HELP use `Option::copied` to copy the value inside the `Option`
+
+    let mut s = String::new();
+    let x = Some(s.clone());
+    let y = Some(&mut s);
+    println!("{}", x == y.cloned());
+    //~^ ERROR mismatched types
+    //~| HELP use `Option::cloned` to clone the value inside the `Option`
 }
diff --git a/tests/ui/suggestions/copied-and-cloned.rs b/tests/ui/suggestions/copied-and-cloned.rs
index 2927d66dea9..c506494ee14 100644
--- a/tests/ui/suggestions/copied-and-cloned.rs
+++ b/tests/ui/suggestions/copied-and-cloned.rs
@@ -26,6 +26,20 @@ fn main() {
     let y = Some(&s);
     println!("{}", x == y);
     //~^ ERROR mismatched types
-    //~| HELP use `Option::as_ref()` to convert `Option<String>` to `Option<&String>`
+    //~| HELP use `Option::as_ref` to convert `Option<String>` to `Option<&String>`
 
+
+    let mut s = ();
+    let x = Some(s);
+    let y = Some(&mut s);
+    println!("{}", x == y);
+    //~^ ERROR mismatched types
+    //~| HELP use `Option::copied` to copy the value inside the `Option`
+
+    let mut s = String::new();
+    let x = Some(s.clone());
+    let y = Some(&mut s);
+    println!("{}", x == y);
+    //~^ ERROR mismatched types
+    //~| HELP use `Option::cloned` to clone the value inside the `Option`
 }
diff --git a/tests/ui/suggestions/copied-and-cloned.stderr b/tests/ui/suggestions/copied-and-cloned.stderr
index 19aaf6e00b1..f8712d0a39e 100644
--- a/tests/ui/suggestions/copied-and-cloned.stderr
+++ b/tests/ui/suggestions/copied-and-cloned.stderr
@@ -86,11 +86,37 @@ LL |     println!("{}", x == y);
    |
    = note: expected enum `Option<String>`
               found enum `Option<&String>`
-help: use `Option::as_ref()` to convert `Option<String>` to `Option<&String>`
+help: use `Option::as_ref` to convert `Option<String>` to `Option<&String>`
    |
 LL |     println!("{}", x.as_ref() == y);
    |                     +++++++++
 
-error: aborting due to 5 previous errors
+error[E0308]: mismatched types
+  --> $DIR/copied-and-cloned.rs:35:25
+   |
+LL |     println!("{}", x == y);
+   |                         ^ expected `Option<()>`, found `Option<&mut ()>`
+   |
+   = note: expected enum `Option<()>`
+              found enum `Option<&mut ()>`
+help: use `Option::copied` to copy the value inside the `Option`
+   |
+LL |     println!("{}", x == y.copied());
+   |                          +++++++++
+
+error[E0308]: mismatched types
+  --> $DIR/copied-and-cloned.rs:42:25
+   |
+LL |     println!("{}", x == y);
+   |                         ^ expected `Option<String>`, found `Option<&mut String>`
+   |
+   = note: expected enum `Option<String>`
+              found enum `Option<&mut String>`
+help: use `Option::cloned` to clone the value inside the `Option`
+   |
+LL |     println!("{}", x == y.cloned());
+   |                          +++++++++
+
+error: aborting due to 7 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.default.stderr
index 233f1bc5a86..24e2e0a0f7a 100644
--- a/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr
+++ b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.default.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/missing-lifetime-in-assoc-const-type.rs:2:14
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14
    |
 LL |     const A: &str = "";
    |              ^ expected named lifetime parameter
@@ -11,7 +11,7 @@ LL ~     const A: &'a str = "";
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/missing-lifetime-in-assoc-const-type.rs:3:14
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14
    |
 LL |     const B: S = S { s: &() };
    |              ^ expected named lifetime parameter
@@ -24,7 +24,7 @@ LL ~     const B: S<'a> = S { s: &() };
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/missing-lifetime-in-assoc-const-type.rs:4:15
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15
    |
 LL |     const C: &'_ str = "";
    |               ^^ expected named lifetime parameter
@@ -38,7 +38,7 @@ LL ~     const C: &'a str = "";
    |
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/missing-lifetime-in-assoc-const-type.rs:5:14
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14
    |
 LL |     const D: T = T { a: &(), b: &() };
    |              ^ expected 2 lifetime parameters
diff --git a/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.generic_const_items.stderr b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.generic_const_items.stderr
new file mode 100644
index 00000000000..a97ffe7da79
--- /dev/null
+++ b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.generic_const_items.stderr
@@ -0,0 +1,47 @@
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:6:14
+   |
+LL |     const A: &str = "";
+   |              ^ expected named lifetime parameter
+   |
+help: consider introducing a named lifetime parameter
+   |
+LL |     const A<'a>: &'a str = "";
+   |            ++++   ++
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:7:14
+   |
+LL |     const B: S = S { s: &() };
+   |              ^ expected named lifetime parameter
+   |
+help: consider introducing a named lifetime parameter
+   |
+LL |     const B<'a>: S<'a> = S { s: &() };
+   |            ++++   ++++
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:8:15
+   |
+LL |     const C: &'_ str = "";
+   |               ^^ expected named lifetime parameter
+   |
+help: consider introducing a named lifetime parameter
+   |
+LL |     const C<'a>: &'a str = "";
+   |            ++++   ~~
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-in-assoc-const-type.rs:9:14
+   |
+LL |     const D: T = T { a: &(), b: &() };
+   |              ^ expected 2 lifetime parameters
+   |
+help: consider introducing a named lifetime parameter
+   |
+LL |     const D<'a>: T<'a, 'a> = T { a: &(), b: &() };
+   |            ++++   ++++++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs
index 38332627f4c..2a8b4c3c044 100644
--- a/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs
+++ b/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs
@@ -1,3 +1,7 @@
+// revisions: default generic_const_items
+
+#![cfg_attr(generic_const_items, feature(generic_const_items), allow(incomplete_features))]
+
 trait ZstAssert: Sized {
     const A: &str = ""; //~ ERROR missing lifetime specifier
     const B: S = S { s: &() }; //~ ERROR missing lifetime specifier
diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs
index 8d1765eb8e9..3ebd2dbceaa 100644
--- a/tests/ui/target-feature/gate.rs
+++ b/tests/ui/target-feature/gate.rs
@@ -1,16 +1,5 @@
-// ignore-arm
-// ignore-aarch64
-// ignore-wasm
-// ignore-emscripten
-// ignore-mips
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-riscv64
-// ignore-sparc
-// ignore-sparc64
-// ignore-s390x
-// ignore-loongarch64
+// only-x86_64
+//
 // gate-test-sse4a_target_feature
 // gate-test-powerpc_target_feature
 // gate-test-avx512_target_feature
diff --git a/tests/ui/target-feature/gate.stderr b/tests/ui/target-feature/gate.stderr
index ee542b60a26..896212e42fc 100644
--- a/tests/ui/target-feature/gate.stderr
+++ b/tests/ui/target-feature/gate.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the target feature `avx512bw` is currently unstable
-  --> $DIR/gate.rs:32:18
+  --> $DIR/gate.rs:21:18
    |
 LL | #[target_feature(enable = "avx512bw")]
    |                  ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs
index 77fd8b85f3f..d1b3cf71c15 100644
--- a/tests/ui/target-feature/invalid-attribute.rs
+++ b/tests/ui/target-feature/invalid-attribute.rs
@@ -1,16 +1,4 @@
-// ignore-arm
-// ignore-aarch64
-// ignore-wasm
-// ignore-emscripten
-// ignore-mips
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-riscv64
-// ignore-s390x
-// ignore-sparc
-// ignore-sparc64
-// ignore-loongarch64
+// only-x86_64
 
 #![warn(unused_attributes)]
 
diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr
index 6d37d0917bc..29c73921c53 100644
--- a/tests/ui/target-feature/invalid-attribute.stderr
+++ b/tests/ui/target-feature/invalid-attribute.stderr
@@ -1,11 +1,11 @@
 error: malformed `target_feature` attribute input
-  --> $DIR/invalid-attribute.rs:32:1
+  --> $DIR/invalid-attribute.rs:20:1
    |
 LL | #[target_feature = "+sse2"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[target_feature(enable = "name")]`
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:17:1
+  --> $DIR/invalid-attribute.rs:5:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL | extern crate alloc;
    | ------------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:22:1
+  --> $DIR/invalid-attribute.rs:10:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | use alloc::alloc::alloc;
    | ------------------------ not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:27:1
+  --> $DIR/invalid-attribute.rs:15:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL | extern "Rust" {}
    | ---------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:49:1
+  --> $DIR/invalid-attribute.rs:37:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@ LL | mod another {}
    | -------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:54:1
+  --> $DIR/invalid-attribute.rs:42:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL | const FOO: usize = 7;
    | --------------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:59:1
+  --> $DIR/invalid-attribute.rs:47:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL | struct Foo;
    | ----------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:64:1
+  --> $DIR/invalid-attribute.rs:52:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -68,7 +68,7 @@ LL | enum Bar {}
    | ----------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:69:1
+  --> $DIR/invalid-attribute.rs:57:1
    |
 LL |   #[target_feature(enable = "sse2")]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -81,7 +81,7 @@ LL | | }
    | |_- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:77:1
+  --> $DIR/invalid-attribute.rs:65:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL | type Uwu = ();
    | -------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:82:1
+  --> $DIR/invalid-attribute.rs:70:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL | trait Baz {}
    | ------------ not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:92:1
+  --> $DIR/invalid-attribute.rs:80:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -108,7 +108,7 @@ LL | static A: () = ();
    | ------------------ not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:97:1
+  --> $DIR/invalid-attribute.rs:85:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -117,7 +117,7 @@ LL | impl Quux for u8 {}
    | ------------------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:102:1
+  --> $DIR/invalid-attribute.rs:90:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -126,7 +126,7 @@ LL | impl Foo {}
    | ----------- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:120:5
+  --> $DIR/invalid-attribute.rs:108:5
    |
 LL |       #[target_feature(enable = "sse2")]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -138,7 +138,7 @@ LL | |     }
    | |_____- not a function definition
 
 error: attribute should be applied to a function definition
-  --> $DIR/invalid-attribute.rs:128:5
+  --> $DIR/invalid-attribute.rs:116:5
    |
 LL |     #[target_feature(enable = "sse2")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -147,25 +147,25 @@ LL |     || {};
    |     ----- not a function definition
 
 error: the feature named `foo` is not valid for this target
-  --> $DIR/invalid-attribute.rs:34:18
+  --> $DIR/invalid-attribute.rs:22:18
    |
 LL | #[target_feature(enable = "foo")]
    |                  ^^^^^^^^^^^^^^ `foo` is not valid for this target
 
 error: malformed `target_feature` attribute input
-  --> $DIR/invalid-attribute.rs:37:18
+  --> $DIR/invalid-attribute.rs:25:18
    |
 LL | #[target_feature(bar)]
    |                  ^^^ help: must be of the form: `enable = ".."`
 
 error: malformed `target_feature` attribute input
-  --> $DIR/invalid-attribute.rs:39:18
+  --> $DIR/invalid-attribute.rs:27:18
    |
 LL | #[target_feature(disable = "baz")]
    |                  ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."`
 
 error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
-  --> $DIR/invalid-attribute.rs:43:1
+  --> $DIR/invalid-attribute.rs:31:1
    |
 LL | #[target_feature(enable = "sse2")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -177,13 +177,13 @@ LL | fn bar() {}
    = help: add `#![feature(target_feature_11)]` to the crate attributes to enable
 
 error: cannot use `#[inline(always)]` with `#[target_feature]`
-  --> $DIR/invalid-attribute.rs:87:1
+  --> $DIR/invalid-attribute.rs:75:1
    |
 LL | #[inline(always)]
    | ^^^^^^^^^^^^^^^^^
 
 error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions
-  --> $DIR/invalid-attribute.rs:112:5
+  --> $DIR/invalid-attribute.rs:100:5
    |
 LL |     #[target_feature(enable = "sse2")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/traits/new-solver/dont-loop-fulfill-on-region-constraints.rs b/tests/ui/traits/new-solver/dont-loop-fulfill-on-region-constraints.rs
new file mode 100644
index 00000000000..b241e3bf865
--- /dev/null
+++ b/tests/ui/traits/new-solver/dont-loop-fulfill-on-region-constraints.rs
@@ -0,0 +1,32 @@
+// compile-flags: -Ztrait-solver=next
+// check-pass
+
+trait Eq<'a, 'b, T> {}
+
+trait Ambig {}
+impl Ambig for () {}
+
+impl<'a, T> Eq<'a, 'a, T> for () where T: Ambig {}
+
+fn eq<'a, 'b, T>(t: T)
+where
+    (): Eq<'a, 'b, T>,
+{
+}
+
+fn test<'r>() {
+    let mut x = Default::default();
+
+    // When we evaluate `(): Eq<'r, 'r, ?0>` we uniquify the regions.
+    // That leads us to evaluate `(): Eq<'?0, '?1, ?0>`. The response of this
+    // will be ambiguous (because `?0: Ambig` is ambig) and also not an "identity"
+    // response, since the region constraints will contain `'?0 == '?1` (so
+    // `is_changed` will return true). Since it's both ambig and changed,
+    // fulfillment will both re-register the goal AND loop again. This hits the
+    // overflow limit. This should neither be considered overflow, nor ICE.
+    eq::<'r, 'r, _>(x);
+
+    x = ();
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/broken_mir.rs b/tests/ui/type-alias-impl-trait/broken_mir.rs
new file mode 100644
index 00000000000..b68e798fb7c
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/broken_mir.rs
@@ -0,0 +1,16 @@
+//! ICE: https://github.com/rust-lang/rust/issues/114121
+//! This test checks that MIR validation never constrains
+//! new hidden types that *differ* from the actual hidden types.
+//! This test used to ICE because oli-obk assumed mir validation
+//! was only ever run after opaque types were revealed in MIR.
+
+// compile-flags: -Zvalidate-mir
+// check-pass
+
+fn main() {
+    let _ = Some(()).into_iter().flat_map(|_| Some(()).into_iter().flat_map(func));
+}
+
+fn func(_: ()) -> impl Iterator<Item = ()> {
+    Some(()).into_iter().flat_map(|_| vec![])
+}
diff --git a/tests/ui/underscore-imports/cycle.rs b/tests/ui/underscore-imports/cycle.rs
index bacf9b2d5a9..c8a29368787 100644
--- a/tests/ui/underscore-imports/cycle.rs
+++ b/tests/ui/underscore-imports/cycle.rs
@@ -2,6 +2,8 @@
 
 // check-pass
 
+#![allow(noop_method_call)]
+
 mod x {
     pub use crate::y::*;
     pub use std::ops::Deref as _;
diff --git a/tests/ui/underscore-imports/hygiene.rs b/tests/ui/underscore-imports/hygiene.rs
index c4db6524538..7795ccb7971 100644
--- a/tests/ui/underscore-imports/hygiene.rs
+++ b/tests/ui/underscore-imports/hygiene.rs
@@ -3,6 +3,7 @@
 // check-pass
 
 #![feature(decl_macro)]
+#![allow(noop_method_call)]
 
 mod x {
     pub use std::ops::Deref as _;
diff --git a/triagebot.toml b/triagebot.toml
index cc26c3b3e7b..a180577a834 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -318,14 +318,6 @@ changelog-branch = "master"
 
 [shortcut]
 
-
-[mentions."compiler/rustc_apfloat"]
-message = """
-Changes rustc_apfloat. rustc_apfloat is currently in limbo and you almost \
-certainly don't want to change it (see #55993).
-"""
-cc = ["@eddyb"]
-
 [mentions."compiler/rustc_codegen_cranelift"]
 cc = ["@bjorn3"]
 
@@ -498,6 +490,7 @@ cc = ["@nnethercote"]
 [assign]
 warn_non_default_branch = true
 contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
+users_on_vacation = ["jyn514"]
 
 [assign.adhoc_groups]
 compiler-team = [
@@ -609,7 +602,6 @@ style-team = [
 "/Cargo.lock" =                              ["@Mark-Simulacrum"]
 "/Cargo.toml" =                              ["@Mark-Simulacrum"]
 "/compiler" =                                ["compiler"]
-"/compiler/rustc_apfloat" =                  ["@eddyb"]
 "/compiler/rustc_ast" =                      ["compiler", "parser"]
 "/compiler/rustc_ast_lowering" =             ["compiler", "ast_lowering"]
 "/compiler/rustc_hir_analysis" =             ["compiler", "types"]