about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2025-07-15 05:07:09 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2025-07-15 05:07:09 +0000
commitf7da0212af0b00b77b43e2e8c62607df43946dcf (patch)
treedc3ad3a58d9b6d278b9270804c50f9da6c11acff
parenta9a5b33c2d7d5d1ada0efd23f97cc1f3b774dbda (diff)
parent7f2065a4bae1faed5bab928c670964eafbf43b55 (diff)
downloadrust-f7da0212af0b00b77b43e2e8c62607df43946dcf.tar.gz
rust-f7da0212af0b00b77b43e2e8c62607df43946dcf.zip
Merge from rustc
-rw-r--r--.gitmodules2
-rw-r--r--Cargo.lock220
-rw-r--r--Cargo.toml1
-rw-r--r--bootstrap.example.toml3
-rw-r--r--compiler/rustc/Cargo.toml8
-rw-r--r--compiler/rustc_ast/src/attr/mod.rs5
-rw-r--r--compiler/rustc_attr_data_structures/src/attributes.rs9
-rw-r--r--compiler/rustc_attr_data_structures/src/encode_cross_crate.rs3
-rw-r--r--compiler/rustc_attr_parsing/messages.ftl3
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs8
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/link_attrs.rs39
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs7
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs34
-rw-r--r--compiler/rustc_attr_parsing/src/context.rs46
-rw-r--r--compiler/rustc_attr_parsing/src/session_diagnostics.rs9
-rw-r--r--compiler/rustc_borrowck/src/type_check/constraint_conversion.rs3
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs5
-rw-r--r--compiler/rustc_codegen_ssa/messages.ftl6
-rw-r--r--compiler/rustc_codegen_ssa/src/codegen_attrs.rs49
-rw-r--r--compiler/rustc_codegen_ssa/src/errors.rs16
-rw-r--r--compiler/rustc_driver_impl/Cargo.toml2
-rw-r--r--compiler/rustc_driver_impl/src/pretty.rs2
-rw-r--r--compiler/rustc_feature/src/unstable.rs2
-rw-r--r--compiler/rustc_hir/src/hir.rs6
-rw-r--r--compiler/rustc_infer/src/infer/canonical/query_response.rs22
-rw-r--r--compiler/rustc_infer/src/infer/outlives/obligations.rs1
-rw-r--r--compiler/rustc_infer/src/infer/snapshot/undo_log.rs4
-rw-r--r--compiler/rustc_lint/src/default_could_be_derived.rs3
-rw-r--r--compiler/rustc_lint/src/levels.rs2
-rw-r--r--compiler/rustc_metadata/src/native_libs.rs10
-rw-r--r--compiler/rustc_middle/src/ty/mod.rs4
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs6
-rw-r--r--compiler/rustc_parse/src/validate_attr.rs3
-rw-r--r--compiler/rustc_passes/messages.ftl6
-rw-r--r--compiler/rustc_passes/src/check_attr.rs56
-rw-r--r--compiler/rustc_passes/src/errors.rs8
-rw-r--r--compiler/rustc_passes/src/liveness.rs4
-rw-r--r--compiler/rustc_public/Cargo.toml (renamed from compiler/stable_mir/Cargo.toml)4
-rw-r--r--compiler/rustc_public/README.md (renamed from compiler/stable_mir/README.md)0
-rw-r--r--compiler/rustc_public/rust-toolchain.toml (renamed from compiler/stable_mir/rust-toolchain.toml)0
-rw-r--r--compiler/rustc_public/src/abi.rs (renamed from compiler/stable_mir/src/abi.rs)0
-rw-r--r--compiler/rustc_public/src/alloc.rs (renamed from compiler/stable_mir/src/alloc.rs)10
-rw-r--r--compiler/rustc_public/src/compiler_interface.rs (renamed from compiler/stable_mir/src/compiler_interface.rs)8
-rw-r--r--compiler/rustc_public/src/crate_def.rs (renamed from compiler/stable_mir/src/crate_def.rs)0
-rw-r--r--compiler/rustc_public/src/error.rs (renamed from compiler/stable_mir/src/error.rs)2
-rw-r--r--compiler/rustc_public/src/lib.rs (renamed from compiler/stable_mir/src/lib.rs)16
-rw-r--r--compiler/rustc_public/src/mir.rs (renamed from compiler/stable_mir/src/mir.rs)0
-rw-r--r--compiler/rustc_public/src/mir/alloc.rs (renamed from compiler/stable_mir/src/mir/alloc.rs)0
-rw-r--r--compiler/rustc_public/src/mir/body.rs (renamed from compiler/stable_mir/src/mir/body.rs)2
-rw-r--r--compiler/rustc_public/src/mir/mono.rs (renamed from compiler/stable_mir/src/mir/mono.rs)2
-rw-r--r--compiler/rustc_public/src/mir/pretty.rs (renamed from compiler/stable_mir/src/mir/pretty.rs)0
-rw-r--r--compiler/rustc_public/src/mir/visit.rs (renamed from compiler/stable_mir/src/mir/visit.rs)0
-rw-r--r--compiler/rustc_public/src/rustc_internal/mod.rs (renamed from compiler/stable_mir/src/rustc_internal/mod.rs)16
-rw-r--r--compiler/rustc_public/src/rustc_internal/pretty.rs (renamed from compiler/stable_mir/src/rustc_internal/pretty.rs)0
-rw-r--r--compiler/rustc_public/src/target.rs (renamed from compiler/stable_mir/src/target.rs)0
-rw-r--r--compiler/rustc_public/src/ty.rs (renamed from compiler/stable_mir/src/ty.rs)2
-rw-r--r--compiler/rustc_public/src/unstable/convert/internal.rs (renamed from compiler/stable_mir/src/unstable/convert/internal.rs)4
-rw-r--r--compiler/rustc_public/src/unstable/convert/mod.rs (renamed from compiler/stable_mir/src/unstable/convert/mod.rs)8
-rw-r--r--compiler/rustc_public/src/unstable/convert/stable/abi.rs (renamed from compiler/stable_mir/src/unstable/convert/stable/abi.rs)4
-rw-r--r--compiler/rustc_public/src/unstable/convert/stable/mir.rs (renamed from compiler/stable_mir/src/unstable/convert/stable/mir.rs)8
-rw-r--r--compiler/rustc_public/src/unstable/convert/stable/mod.rs (renamed from compiler/stable_mir/src/unstable/convert/stable/mod.rs)4
-rw-r--r--compiler/rustc_public/src/unstable/convert/stable/ty.rs (renamed from compiler/stable_mir/src/unstable/convert/stable/ty.rs)4
-rw-r--r--compiler/rustc_public/src/unstable/internal_cx/mod.rs (renamed from compiler/stable_mir/src/unstable/internal_cx/mod.rs)0
-rw-r--r--compiler/rustc_public/src/unstable/internal_cx/traits.rs (renamed from compiler/stable_mir/src/unstable/internal_cx/traits.rs)0
-rw-r--r--compiler/rustc_public/src/unstable/mod.rs (renamed from compiler/stable_mir/src/unstable/mod.rs)6
-rw-r--r--compiler/rustc_public/src/visitor.rs (renamed from compiler/stable_mir/src/visitor.rs)0
-rw-r--r--compiler/rustc_public_bridge/.gitignore (renamed from compiler/rustc_smir/.gitignore)0
-rw-r--r--compiler/rustc_public_bridge/Cargo.toml (renamed from compiler/rustc_smir/Cargo.toml)2
-rw-r--r--compiler/rustc_public_bridge/src/alloc.rs (renamed from compiler/rustc_smir/src/alloc.rs)2
-rw-r--r--compiler/rustc_public_bridge/src/bridge.rs (renamed from compiler/rustc_smir/src/bridge.rs)4
-rw-r--r--compiler/rustc_public_bridge/src/builder.rs (renamed from compiler/rustc_smir/src/builder.rs)0
-rw-r--r--compiler/rustc_public_bridge/src/context/impls.rs (renamed from compiler/rustc_smir/src/context/impls.rs)0
-rw-r--r--compiler/rustc_public_bridge/src/context/mod.rs (renamed from compiler/rustc_smir/src/context/mod.rs)0
-rw-r--r--compiler/rustc_public_bridge/src/context/traits.rs (renamed from compiler/rustc_smir/src/context/traits.rs)0
-rw-r--r--compiler/rustc_public_bridge/src/lib.rs (renamed from compiler/rustc_smir/src/lib.rs)6
-rw-r--r--compiler/rustc_trait_selection/src/solve/delegate.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs5
-rw-r--r--library/alloc/src/string.rs2
-rw-r--r--library/alloc/src/vec/mod.rs2
-rw-r--r--library/core/src/cell.rs8
-rw-r--r--library/core/src/default.rs4
-rw-r--r--library/core/src/intrinsics/mod.rs2
-rw-r--r--library/core/src/io/borrowed_buf.rs51
-rw-r--r--library/core/src/iter/sources/empty.rs2
-rw-r--r--library/core/src/marker.rs2
-rw-r--r--library/core/src/ops/function.rs16
-rw-r--r--library/core/src/option.rs2
-rw-r--r--library/core/src/primitive_docs.rs2
-rw-r--r--library/core/src/ptr/alignment.rs2
-rw-r--r--library/core/src/ptr/docs/add.md2
-rw-r--r--library/core/src/ptr/docs/offset.md2
-rw-r--r--library/core/src/random.rs52
-rw-r--r--library/core/src/slice/mod.rs4
-rw-r--r--library/core/src/str/mod.rs4
-rw-r--r--library/core/src/tuple.rs11
-rw-r--r--library/coretests/tests/io/borrowed_buf.rs36
-rw-r--r--library/std/src/random.rs24
-rw-r--r--library/std/src/sys/net/connection/socket/windows.rs36
-rw-r--r--library/std/src/sys/pal/sgx/abi/usercalls/mod.rs4
-rw-r--r--library/std/src/sys/sync/once/futex.rs10
-rw-r--r--library/std/src/sys/sync/once/queue.rs11
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs6
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs41
-rw-r--r--src/bootstrap/src/core/builder/mod.rs3
-rw-r--r--src/bootstrap/src/utils/change_tracker.rs5
-rw-r--r--src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md3
-rwxr-xr-xsrc/etc/htmldocck.py55
-rw-r--r--src/librustdoc/clean/types.rs3
-rw-r--r--src/librustdoc/html/render/mod.rs4
m---------src/llvm-project0
-rw-r--r--src/tools/clippy/clippy_lints/src/format_args.rs3
-rw-r--r--src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs2
-rw-r--r--src/tools/clippy/clippy_test_deps/Cargo.lock505
-rw-r--r--src/tools/clippy/clippy_test_deps/Cargo.toml3
-rw-r--r--src/tools/clippy/clippy_utils/src/lib.rs4
-rw-r--r--src/tools/compiletest/src/common.rs41
-rw-r--r--src/tools/compiletest/src/directive-list.rs260
-rw-r--r--src/tools/compiletest/src/directives.rs304
-rw-r--r--src/tools/compiletest/src/directives/tests.rs2
-rw-r--r--src/tools/compiletest/src/lib.rs2
-rw-r--r--src/tools/compiletest/src/runtest.rs11
-rw-r--r--src/tools/compiletest/src/runtest/coverage.rs4
-rw-r--r--src/tools/compiletest/src/runtest/rustdoc.rs2
-rw-r--r--src/tools/compiletest/src/runtest/rustdoc_json.rs2
-rw-r--r--src/tools/jsondocck/src/directive.rs15
-rw-r--r--src/tools/jsondocck/src/main.rs16
-rw-r--r--src/tools/miri/test_dependencies/Cargo.toml1
-rw-r--r--src/tools/miri/tests/pass/shims/random.rs2
-rw-r--r--src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs4
-rw-r--r--src/tools/tidy/Cargo.toml2
-rw-r--r--src/tools/tidy/src/alphabetical.rs2
-rw-r--r--src/tools/tidy/src/bins.rs11
-rw-r--r--src/tools/tidy/src/deps.rs2
-rw-r--r--src/tools/tidy/src/error_codes.rs20
-rw-r--r--src/tools/tidy/src/ext_tool_checks.rs16
-rw-r--r--src/tools/tidy/src/extdeps.rs2
-rw-r--r--src/tools/tidy/src/features.rs21
-rw-r--r--src/tools/tidy/src/features/version.rs2
-rw-r--r--src/tools/tidy/src/features/version/tests.rs4
-rw-r--r--src/tools/tidy/src/fluent_alphabetical.rs8
-rw-r--r--src/tools/tidy/src/fluent_period.rs4
-rw-r--r--src/tools/tidy/src/fluent_used.rs4
-rw-r--r--src/tools/tidy/src/gcc_submodule.rs7
-rw-r--r--src/tools/tidy/src/main.rs9
-rw-r--r--src/tools/tidy/src/mir_opt_tests.rs2
-rw-r--r--src/tools/tidy/src/pal.rs2
-rw-r--r--src/tools/tidy/src/rustdoc_gui_tests.rs2
-rw-r--r--src/tools/tidy/src/rustdoc_js.rs2
-rw-r--r--src/tools/tidy/src/rustdoc_json.rs2
-rw-r--r--src/tools/tidy/src/rustdoc_templates.rs4
-rw-r--r--src/tools/tidy/src/style.rs15
-rw-r--r--src/tools/tidy/src/target_specific_tests.rs11
-rw-r--r--src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs12
-rw-r--r--src/tools/tidy/src/ui_tests.rs15
-rw-r--r--src/tools/tidy/src/unstable_book.rs4
-rw-r--r--src/tools/tidy/src/walk.rs4
-rw-r--r--src/tools/tidy/src/x_version.rs10
-rw-r--r--src/tools/tier-check/Cargo.toml2
-rw-r--r--src/tools/tier-check/src/main.rs14
-rw-r--r--tests/mir-opt/pre-codegen/README.md2
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr4
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr4
-rw-r--r--tests/ui-fulldeps/stable-mir/check_abi.rs22
-rw-r--r--tests/ui-fulldeps/stable-mir/check_allocation.rs20
-rw-r--r--tests/ui-fulldeps/stable-mir/check_assoc_items.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_attribute.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_binop.rs12
-rw-r--r--tests/ui-fulldeps/stable-mir/check_coroutine_body.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_crate_defs.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_def_ty.rs10
-rw-r--r--tests/ui-fulldeps/stable-mir/check_defs.rs10
-rw-r--r--tests/ui-fulldeps/stable-mir/check_foreign.rs4
-rw-r--r--tests/ui-fulldeps/stable-mir/check_instance.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_intrinsics.rs12
-rw-r--r--tests/ui-fulldeps/stable-mir/check_item_kind.rs6
-rw-r--r--tests/ui-fulldeps/stable-mir/check_normalization.rs6
-rw-r--r--tests/ui-fulldeps/stable-mir/check_trait_queries.rs10
-rw-r--r--tests/ui-fulldeps/stable-mir/check_transform.rs16
-rw-r--r--tests/ui-fulldeps/stable-mir/check_ty_fold.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/check_variant.rs12
-rw-r--r--tests/ui-fulldeps/stable-mir/closure-generic-body.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/closure_body.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/compilation-result.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/crate-info.rs68
-rw-r--r--tests/ui-fulldeps/stable-mir/projections.rs32
-rw-r--r--tests/ui-fulldeps/stable-mir/smir_internal.rs6
-rw-r--r--tests/ui-fulldeps/stable-mir/smir_serde.rs8
-rw-r--r--tests/ui-fulldeps/stable-mir/smir_visitor.rs12
-rw-r--r--tests/ui/SUMMARY.md2
-rw-r--r--tests/ui/attributes/malformed-attrs.stderr45
-rw-r--r--tests/ui/consts/issue-90870.stderr6
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr30
-rw-r--r--tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr2
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs4
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr19
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs6
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr21
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs6
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr21
-rw-r--r--tests/ui/lint/unused/unused-attr-duplicate.stderr24
-rw-r--r--tests/ui/traits/const-traits/cross-crate.stock.stderr2
-rw-r--r--tests/ui/traits/const-traits/cross-crate.stocknc.stderr2
-rw-r--r--tests/ui/traits/const-traits/feature-gate.stock.stderr12
-rw-r--r--tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.stderr2
-rw-r--r--tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr4
-rw-r--r--tests/ui/traits/const-traits/staged-api-user-crate.stderr2
-rw-r--r--tests/ui/traits/const-traits/staged-api.stderr4
-rw-r--r--tests/ui/traits/const-traits/std-impl-gate.stock.stderr2
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr4
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr4
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr10
-rw-r--r--tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr10
-rw-r--r--triagebot.toml8
213 files changed, 1815 insertions, 1338 deletions
diff --git a/.gitmodules b/.gitmodules
index 3426b1bc8db..439fde6d766 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -25,7 +25,7 @@
 [submodule "src/llvm-project"]
 	path = src/llvm-project
 	url = https://github.com/rust-lang/llvm-project.git
-	branch = rustc/20.1-2025-02-13
+	branch = rustc/20.1-2025-07-13
 	shallow = true
 [submodule "src/doc/embedded-book"]
 	path = src/doc/embedded-book
diff --git a/Cargo.lock b/Cargo.lock
index c767c90f1ec..51fd06972f2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -352,12 +352,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e"
 
 [[package]]
-name = "bytes"
-version = "1.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
-
-[[package]]
 name = "camino"
 version = "1.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -637,21 +631,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "clippy_test_deps"
-version = "0.1.0"
-dependencies = [
- "futures",
- "if_chain",
- "itertools",
- "parking_lot",
- "quote",
- "regex",
- "serde",
- "syn 2.0.104",
- "tokio",
-]
-
-[[package]]
 name = "clippy_utils"
 version = "0.1.90"
 dependencies = [
@@ -1332,95 +1311,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "futures"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-executor",
- "futures-io",
- "futures-sink",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-channel"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
-dependencies = [
- "futures-core",
- "futures-sink",
-]
-
-[[package]]
-name = "futures-core"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
-
-[[package]]
-name = "futures-executor"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
-dependencies = [
- "futures-core",
- "futures-task",
- "futures-util",
-]
-
-[[package]]
-name = "futures-io"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
-
-[[package]]
-name = "futures-macro"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.104",
-]
-
-[[package]]
-name = "futures-sink"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
-
-[[package]]
-name = "futures-task"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
-
-[[package]]
-name = "futures-util"
-version = "0.3.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
-dependencies = [
- "futures-channel",
- "futures-core",
- "futures-io",
- "futures-macro",
- "futures-sink",
- "futures-task",
- "memchr",
- "pin-project-lite",
- "pin-utils",
- "slab",
-]
-
-[[package]]
 name = "generate-copyright"
 version = "0.1.0"
 dependencies = [
@@ -1858,12 +1748,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "if_chain"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
-
-[[package]]
 name = "ignore"
 version = "0.4.23"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1957,17 +1841,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "io-uring"
-version = "0.7.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
-dependencies = [
- "bitflags",
- "cfg-if",
- "libc",
-]
-
-[[package]]
 name = "ipc-channel"
 version = "0.19.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2878,12 +2751,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
 
 [[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
-[[package]]
 name = "pkg-config"
 version = "0.3.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3280,8 +3147,8 @@ dependencies = [
  "rustc_codegen_ssa",
  "rustc_driver",
  "rustc_driver_impl",
- "rustc_smir",
- "stable_mir",
+ "rustc_public",
+ "rustc_public_bridge",
  "tikv-jemalloc-sys",
 ]
 
@@ -3718,6 +3585,7 @@ dependencies = [
  "rustc_passes",
  "rustc_pattern_analysis",
  "rustc_privacy",
+ "rustc_public",
  "rustc_query_system",
  "rustc_resolve",
  "rustc_session",
@@ -3727,7 +3595,6 @@ dependencies = [
  "rustc_ty_utils",
  "serde_json",
  "shlex",
- "stable_mir",
  "tracing",
  "windows 0.61.3",
 ]
@@ -4425,6 +4292,36 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustc_public"
+version = "0.1.0-preview"
+dependencies = [
+ "rustc_abi",
+ "rustc_hir",
+ "rustc_middle",
+ "rustc_public_bridge",
+ "rustc_session",
+ "rustc_span",
+ "rustc_target",
+ "scoped-tls",
+ "serde",
+ "tracing",
+]
+
+[[package]]
+name = "rustc_public_bridge"
+version = "0.0.0"
+dependencies = [
+ "rustc_abi",
+ "rustc_data_structures",
+ "rustc_hir",
+ "rustc_hir_pretty",
+ "rustc_middle",
+ "rustc_session",
+ "rustc_span",
+ "rustc_target",
+]
+
+[[package]]
 name = "rustc_query_impl"
 version = "0.0.0"
 dependencies = [
@@ -4552,20 +4449,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "rustc_smir"
-version = "0.0.0"
-dependencies = [
- "rustc_abi",
- "rustc_data_structures",
- "rustc_hir",
- "rustc_hir_pretty",
- "rustc_middle",
- "rustc_session",
- "rustc_span",
- "rustc_target",
-]
-
-[[package]]
 name = "rustc_span"
 version = "0.0.0"
 dependencies = [
@@ -5046,12 +4929,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
 
 [[package]]
-name = "slab"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
-
-[[package]]
 name = "smallvec"
 version = "1.15.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5124,22 +5001,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
 
 [[package]]
-name = "stable_mir"
-version = "0.1.0-preview"
-dependencies = [
- "rustc_abi",
- "rustc_hir",
- "rustc_middle",
- "rustc_session",
- "rustc_smir",
- "rustc_span",
- "rustc_target",
- "scoped-tls",
- "serde",
- "tracing",
-]
-
-[[package]]
 name = "stacker"
 version = "0.1.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5492,21 +5353,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
 
 [[package]]
-name = "tokio"
-version = "1.46.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
-dependencies = [
- "backtrace",
- "bytes",
- "io-uring",
- "libc",
- "mio",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
 name = "toml"
 version = "0.5.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 9890027d098..6d3425f4115 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,6 @@ members = [
   "src/tools/cargotest",
   "src/tools/clippy",
   "src/tools/clippy/clippy_dev",
-  "src/tools/clippy/clippy_test_deps",
   "src/tools/collect-license-metadata",
   "src/tools/compiletest",
   "src/tools/coverage-dump",
diff --git a/bootstrap.example.toml b/bootstrap.example.toml
index b59f112bdfb..73e93ccbe42 100644
--- a/bootstrap.example.toml
+++ b/bootstrap.example.toml
@@ -392,7 +392,8 @@
 # For example, to build Miri with tracing support, use `tool.miri.features = ["tracing"]`
 #
 # The default value for the `features` array is `[]`. However, please note that other flags in
-# `bootstrap.toml` might influence the features enabled for some tools.
+# `bootstrap.toml` might influence the features enabled for some tools. Also, enabling features
+# in tools which are not part of the internal "extra-features" preset might not always work.
 #build.tool.TOOL_NAME.features = [FEATURE1, FEATURE2]
 
 # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation
diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml
index 99414d6264e..3ca75235446 100644
--- a/compiler/rustc/Cargo.toml
+++ b/compiler/rustc/Cargo.toml
@@ -13,11 +13,11 @@ rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
 rustc_driver = { path = "../rustc_driver" }
 rustc_driver_impl = { path = "../rustc_driver_impl" }
 
-# Make sure rustc_smir ends up in the sysroot, because this
-# crate is intended to be used by stable MIR consumers, which are not in-tree.
-rustc_smir = { path = "../rustc_smir" }
+rustc_public = { path = "../rustc_public" }
 
-stable_mir = { path = "../stable_mir" }
+# Make sure rustc_public_bridge ends up in the sysroot, because this
+# crate is intended to be used by stable MIR consumers, which are not in-tree.
+rustc_public_bridge = { path = "../rustc_public_bridge" }
 # tidy-alphabetical-end
 
 [dependencies.tikv-jemalloc-sys]
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs
index 44865c493b3..4348a4bb120 100644
--- a/compiler/rustc_ast/src/attr/mod.rs
+++ b/compiler/rustc_ast/src/attr/mod.rs
@@ -217,6 +217,10 @@ impl AttributeExt for Attribute {
             _ => None,
         }
     }
+
+    fn is_automatically_derived_attr(&self) -> bool {
+        self.has_name(sym::automatically_derived)
+    }
 }
 
 impl Attribute {
@@ -810,6 +814,7 @@ pub trait AttributeExt: Debug {
             .iter()
             .any(|kind| self.has_name(*kind))
     }
+    fn is_automatically_derived_attr(&self) -> bool;
 
     /// Returns the documentation and its kind if this is a doc comment or a sugared doc comment.
     /// * `///doc` returns `Some(("doc", CommentKind::Line))`.
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs
index f61efcf2388..9b14ed88978 100644
--- a/compiler/rustc_attr_data_structures/src/attributes.rs
+++ b/compiler/rustc_attr_data_structures/src/attributes.rs
@@ -207,6 +207,9 @@ pub enum AttributeKind {
     /// Represents `#[rustc_as_ptr]` (used by the `dangling_pointers_from_temporaries` lint).
     AsPtr(Span),
 
+    /// Represents `#[automatically_derived]`
+    AutomaticallyDerived(Span),
+
     /// Represents `#[rustc_default_body_unstable]`.
     BodyStability {
         stability: DefaultBodyStability,
@@ -294,6 +297,9 @@ pub enum AttributeKind {
     /// Represents `#[link_name]`.
     LinkName { name: Symbol, span: Span },
 
+    /// Represents `#[link_ordinal]`.
+    LinkOrdinal { ordinal: u16, span: Span },
+
     /// Represents [`#[link_section]`](https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute)
     LinkSection { name: Symbol, span: Span },
 
@@ -328,6 +334,9 @@ pub enum AttributeKind {
     /// Represents `#[non_exhaustive]`
     NonExhaustive(Span),
 
+    /// Represents `#[omit_gdb_pretty_printer_section]`
+    OmitGdbPrettyPrinterSection,
+
     /// Represents `#[optimize(size|speed)]`
     Optimize(OptimizeAttr, Span),
 
diff --git a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs
index ad587523e03..494b570c86c 100644
--- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs
+++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs
@@ -18,6 +18,7 @@ impl AttributeKind {
             AllowIncoherentImpl(..) => No,
             AllowInternalUnstable(..) => Yes,
             AsPtr(..) => Yes,
+            AutomaticallyDerived(..) => Yes,
             BodyStability { .. } => No,
             CoherenceIsCore => No,
             Coinductive(..) => No,
@@ -40,6 +41,7 @@ impl AttributeKind {
             Ignore { .. } => No,
             Inline(..) => No,
             LinkName { .. } => Yes,
+            LinkOrdinal { .. } => No,
             LinkSection { .. } => No,
             LoopMatch(..) => No,
             MacroTransparency(..) => Yes,
@@ -50,6 +52,7 @@ impl AttributeKind {
             NoImplicitPrelude(..) => No,
             NoMangle(..) => No,
             NonExhaustive(..) => Yes,
+            OmitGdbPrettyPrinterSection => No,
             Optimize(..) => No,
             ParenSugar(..) => No,
             PassByValue(..) => Yes,
diff --git a/compiler/rustc_attr_parsing/messages.ftl b/compiler/rustc_attr_parsing/messages.ftl
index bec3a1e8a59..8d0ead63a8d 100644
--- a/compiler/rustc_attr_parsing/messages.ftl
+++ b/compiler/rustc_attr_parsing/messages.ftl
@@ -78,6 +78,9 @@ attr_parsing_invalid_repr_hint_no_value =
 attr_parsing_invalid_since =
     'since' must be a Rust version number, such as "1.31.0"
 
+attr_parsing_link_ordinal_out_of_range = ordinal value in `link_ordinal` is too large: `{$ordinal}`
+    .note = the value may not exceed `u16::MAX`
+
 attr_parsing_missing_feature =
     missing 'feature'
 
diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
index fdec09edaa1..34d9b048348 100644
--- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
@@ -334,3 +334,11 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
         features
     }
 }
+
+pub(crate) struct OmitGdbPrettyPrinterSectionParser;
+
+impl<S: Stage> NoArgsAttributeParser<S> for OmitGdbPrettyPrinterSectionParser {
+    const PATH: &[Symbol] = &[sym::omit_gdb_pretty_printer_section];
+    const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
+    const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::OmitGdbPrettyPrinterSection;
+}
diff --git a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
index 23a8e96482d..960cebd8925 100644
--- a/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
@@ -1,14 +1,14 @@
 use rustc_attr_data_structures::AttributeKind;
-use rustc_attr_data_structures::AttributeKind::{LinkName, LinkSection};
+use rustc_attr_data_structures::AttributeKind::{LinkName, LinkOrdinal, LinkSection};
 use rustc_feature::{AttributeTemplate, template};
 use rustc_span::{Span, Symbol, sym};
 
 use crate::attributes::{
     AttributeOrder, NoArgsAttributeParser, OnDuplicate, SingleAttributeParser,
 };
-use crate::context::{AcceptContext, Stage};
+use crate::context::{AcceptContext, Stage, parse_single_integer};
 use crate::parser::ArgParser;
-use crate::session_diagnostics::NullOnLinkSection;
+use crate::session_diagnostics::{LinkOrdinalOutOfRange, NullOnLinkSection};
 
 pub(crate) struct LinkNameParser;
 
@@ -87,3 +87,36 @@ impl<S: Stage> NoArgsAttributeParser<S> for StdInternalSymbolParser {
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
     const CREATE: fn(Span) -> AttributeKind = AttributeKind::StdInternalSymbol;
 }
+
+pub(crate) struct LinkOrdinalParser;
+
+impl<S: Stage> SingleAttributeParser<S> for LinkOrdinalParser {
+    const PATH: &[Symbol] = &[sym::link_ordinal];
+    const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
+    const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
+    const TEMPLATE: AttributeTemplate = template!(List: "ordinal");
+
+    fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
+        let ordinal = parse_single_integer(cx, args)?;
+
+        // According to the table at
+        // https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-header, the
+        // ordinal must fit into 16 bits. Similarly, the Ordinal field in COFFShortExport (defined
+        // in llvm/include/llvm/Object/COFFImportFile.h), which we use to communicate import
+        // information to LLVM for `#[link(kind = "raw-dylib"_])`, is also defined to be uint16_t.
+        //
+        // FIXME: should we allow an ordinal of 0?  The MSVC toolchain has inconsistent support for
+        // this: both LINK.EXE and LIB.EXE signal errors and abort when given a .DEF file that
+        // specifies a zero ordinal. However, llvm-dlltool is perfectly happy to generate an import
+        // library for such a .DEF file, and MSVC's LINK.EXE is also perfectly happy to consume an
+        // import library produced by LLVM with an ordinal of 0, and it generates an .EXE.  (I
+        // don't know yet if the resulting EXE runs, as I haven't yet built the necessary DLL --
+        // see earlier comment about LINK.EXE failing.)
+        let Ok(ordinal) = ordinal.try_into() else {
+            cx.emit_err(LinkOrdinalOutOfRange { span: cx.attr_span, ordinal });
+            return None;
+        };
+
+        Some(LinkOrdinal { ordinal, span: cx.attr_span })
+    }
+}
diff --git a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
index 8ad98c8d1d4..0eceff53e8b 100644
--- a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
@@ -24,3 +24,10 @@ impl<S: Stage> NoArgsAttributeParser<S> for PassByValueParser {
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
     const CREATE: fn(Span) -> AttributeKind = AttributeKind::PassByValue;
 }
+
+pub(crate) struct AutomaticallyDerivedParser;
+impl<S: Stage> NoArgsAttributeParser<S> for AutomaticallyDerivedParser {
+    const PATH: &[Symbol] = &[sym::automatically_derived];
+    const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
+    const CREATE: fn(Span) -> AttributeKind = AttributeKind::AutomaticallyDerived;
+}
diff --git a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
index ec821cb11ce..7ca951dc0bb 100644
--- a/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
@@ -1,10 +1,9 @@
-use rustc_ast::LitKind;
 use rustc_attr_data_structures::AttributeKind;
 use rustc_feature::{AttributeTemplate, template};
 use rustc_span::{Symbol, sym};
 
 use crate::attributes::{AttributeOrder, OnDuplicate, SingleAttributeParser};
-use crate::context::{AcceptContext, Stage};
+use crate::context::{AcceptContext, Stage, parse_single_integer};
 use crate::parser::ArgParser;
 
 pub(crate) struct RustcLayoutScalarValidRangeStart;
@@ -16,8 +15,8 @@ impl<S: Stage> SingleAttributeParser<S> for RustcLayoutScalarValidRangeStart {
     const TEMPLATE: AttributeTemplate = template!(List: "start");
 
     fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
-        parse_rustc_layout_scalar_valid_range(cx, args)
-            .map(|n| AttributeKind::RustcLayoutScalarValidRangeStart(n, cx.attr_span))
+        parse_single_integer(cx, args)
+            .map(|n| AttributeKind::RustcLayoutScalarValidRangeStart(Box::new(n), cx.attr_span))
     }
 }
 
@@ -30,34 +29,11 @@ impl<S: Stage> SingleAttributeParser<S> for RustcLayoutScalarValidRangeEnd {
     const TEMPLATE: AttributeTemplate = template!(List: "end");
 
     fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
-        parse_rustc_layout_scalar_valid_range(cx, args)
-            .map(|n| AttributeKind::RustcLayoutScalarValidRangeEnd(n, cx.attr_span))
+        parse_single_integer(cx, args)
+            .map(|n| AttributeKind::RustcLayoutScalarValidRangeEnd(Box::new(n), cx.attr_span))
     }
 }
 
-fn parse_rustc_layout_scalar_valid_range<S: Stage>(
-    cx: &mut AcceptContext<'_, '_, S>,
-    args: &ArgParser<'_>,
-) -> Option<Box<u128>> {
-    let Some(list) = args.list() else {
-        cx.expected_list(cx.attr_span);
-        return None;
-    };
-    let Some(single) = list.single() else {
-        cx.expected_single_argument(list.span);
-        return None;
-    };
-    let Some(lit) = single.lit() else {
-        cx.expected_integer_literal(single.span());
-        return None;
-    };
-    let LitKind::Int(num, _ty) = lit.kind else {
-        cx.expected_integer_literal(single.span());
-        return None;
-    };
-    Some(Box::new(num.0))
-}
-
 pub(crate) struct RustcObjectLifetimeDefaultParser;
 
 impl<S: Stage> SingleAttributeParser<S> for RustcObjectLifetimeDefaultParser {
diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs
index ad48eb1498e..6c70f2ee4ee 100644
--- a/compiler/rustc_attr_parsing/src/context.rs
+++ b/compiler/rustc_attr_parsing/src/context.rs
@@ -5,7 +5,7 @@ use std::ops::{Deref, DerefMut};
 use std::sync::LazyLock;
 
 use private::Sealed;
-use rustc_ast::{self as ast, MetaItemLit, NodeId};
+use rustc_ast::{self as ast, LitKind, MetaItemLit, NodeId};
 use rustc_attr_data_structures::AttributeKind;
 use rustc_attr_data_structures::lints::{AttributeLint, AttributeLintKind};
 use rustc_errors::{DiagCtxtHandle, Diagnostic};
@@ -16,18 +16,20 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
 
 use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInternalUnstableParser};
 use crate::attributes::codegen_attrs::{
-    ColdParser, ExportNameParser, NakedParser, NoMangleParser, OptimizeParser, TargetFeatureParser,
-    TrackCallerParser, UsedParser,
+    ColdParser, ExportNameParser, NakedParser, NoMangleParser, OmitGdbPrettyPrinterSectionParser,
+    OptimizeParser, TargetFeatureParser, TrackCallerParser, UsedParser,
 };
 use crate::attributes::confusables::ConfusablesParser;
 use crate::attributes::deprecation::DeprecationParser;
 use crate::attributes::dummy::DummyParser;
 use crate::attributes::inline::{InlineParser, RustcForceInlineParser};
 use crate::attributes::link_attrs::{
-    ExportStableParser, FfiConstParser, FfiPureParser, LinkNameParser, LinkSectionParser,
-    StdInternalSymbolParser,
+    ExportStableParser, FfiConstParser, FfiPureParser, LinkNameParser, LinkOrdinalParser,
+    LinkSectionParser, StdInternalSymbolParser,
+};
+use crate::attributes::lint_helpers::{
+    AsPtrParser, AutomaticallyDerivedParser, PassByValueParser, PubTransparentParser,
 };
-use crate::attributes::lint_helpers::{AsPtrParser, PassByValueParser, PubTransparentParser};
 use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser};
 use crate::attributes::must_use::MustUseParser;
 use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser;
@@ -141,6 +143,7 @@ attribute_parsers!(
         Single<IgnoreParser>,
         Single<InlineParser>,
         Single<LinkNameParser>,
+        Single<LinkOrdinalParser>,
         Single<LinkSectionParser>,
         Single<MustUseParser>,
         Single<OptimizeParser>,
@@ -153,6 +156,7 @@ attribute_parsers!(
         Single<TransparencyParser>,
         Single<WithoutArgs<AllowIncoherentImplParser>>,
         Single<WithoutArgs<AsPtrParser>>,
+        Single<WithoutArgs<AutomaticallyDerivedParser>>,
         Single<WithoutArgs<CoherenceIsCoreParser>>,
         Single<WithoutArgs<CoinductiveParser>>,
         Single<WithoutArgs<ColdParser>>,
@@ -171,6 +175,7 @@ attribute_parsers!(
         Single<WithoutArgs<NoImplicitPreludeParser>>,
         Single<WithoutArgs<NoMangleParser>>,
         Single<WithoutArgs<NonExhaustiveParser>>,
+        Single<WithoutArgs<OmitGdbPrettyPrinterSectionParser>>,
         Single<WithoutArgs<ParenSugarParser>>,
         Single<WithoutArgs<PassByValueParser>>,
         Single<WithoutArgs<PubTransparentParser>>,
@@ -772,3 +777,32 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
         }
     }
 }
+
+/// Parse a single integer.
+///
+/// Used by attributes that take a single integer as argument, such as
+/// `#[link_ordinal]` and `#[rustc_layout_scalar_valid_range_start]`.
+/// `cx` is the context given to the attribute.
+/// `args` is the parser for the attribute arguments.
+pub(crate) fn parse_single_integer<S: Stage>(
+    cx: &mut AcceptContext<'_, '_, S>,
+    args: &ArgParser<'_>,
+) -> Option<u128> {
+    let Some(list) = args.list() else {
+        cx.expected_list(cx.attr_span);
+        return None;
+    };
+    let Some(single) = list.single() else {
+        cx.expected_single_argument(list.span);
+        return None;
+    };
+    let Some(lit) = single.lit() else {
+        cx.expected_integer_literal(single.span());
+        return None;
+    };
+    let LitKind::Int(num, _ty) = lit.kind else {
+        cx.expected_integer_literal(single.span());
+        return None;
+    };
+    Some(num.0)
+}
diff --git a/compiler/rustc_attr_parsing/src/session_diagnostics.rs b/compiler/rustc_attr_parsing/src/session_diagnostics.rs
index 28f6786f37f..8a240639d75 100644
--- a/compiler/rustc_attr_parsing/src/session_diagnostics.rs
+++ b/compiler/rustc_attr_parsing/src/session_diagnostics.rs
@@ -514,6 +514,15 @@ pub(crate) struct NakedFunctionIncompatibleAttribute {
     pub attr: String,
 }
 
+#[derive(Diagnostic)]
+#[diag(attr_parsing_link_ordinal_out_of_range)]
+#[note]
+pub(crate) struct LinkOrdinalOutOfRange {
+    #[primary_span]
+    pub span: Span,
+    pub ordinal: u128,
+}
+
 pub(crate) enum AttributeParseErrorReason {
     ExpectedNoArgs,
     ExpectedStringLiteral { byte_string: Option<Span> },
diff --git a/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs b/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs
index 8ed552cfa4f..ca636a8c999 100644
--- a/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs
+++ b/compiler/rustc_borrowck/src/type_check/constraint_conversion.rs
@@ -159,6 +159,9 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
                     }
 
                     GenericArgKind::Type(mut t1) => {
+                        // Scraped constraints may have had inference vars.
+                        t1 = self.infcx.resolve_vars_if_possible(t1);
+
                         // Normalize the type we receive from a `TypeOutlives` obligation
                         // in the new trait solver.
                         if infcx.next_trait_solver() {
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
index 8f0948b8183..49ee96a41d6 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs
@@ -1,13 +1,12 @@
 // .debug_gdb_scripts binary section.
 
-use rustc_ast::attr;
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_codegen_ssa::base::collect_debugger_visualizers_transitive;
 use rustc_codegen_ssa::traits::*;
 use rustc_hir::def_id::LOCAL_CRATE;
 use rustc_middle::bug;
 use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerType;
 use rustc_session::config::{CrateType, DebugInfo};
-use rustc_span::sym;
 
 use crate::builder::Builder;
 use crate::common::CodegenCx;
@@ -87,7 +86,7 @@ pub(crate) fn get_or_insert_gdb_debug_scripts_section_global<'ll>(
 
 pub(crate) fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
     let omit_gdb_pretty_printer_section =
-        attr::contains_name(cx.tcx.hir_krate_attrs(), sym::omit_gdb_pretty_printer_section);
+        find_attr!(cx.tcx.hir_krate_attrs(), AttributeKind::OmitGdbPrettyPrinterSection);
 
     // To ensure the section `__rustc_debug_gdb_scripts_section__` will not create
     // ODR violations at link time, this section will not be emitted for rlibs since
diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl
index 63e9005da45..c7bd6ffd1f2 100644
--- a/compiler/rustc_codegen_ssa/messages.ftl
+++ b/compiler/rustc_codegen_ssa/messages.ftl
@@ -80,9 +80,6 @@ codegen_ssa_ignoring_emit_path = ignoring emit path because multiple .{$extensio
 
 codegen_ssa_ignoring_output = ignoring -o because multiple .{$extension} files were produced
 
-codegen_ssa_illegal_link_ordinal_format = illegal ordinal format in `link_ordinal`
-    .note = an unsuffixed integer value, e.g., `1`, is expected
-
 codegen_ssa_incorrect_cgu_reuse_type =
     CGU-reuse for `{$cgu_user_name}` is `{$actual_reuse}` but should be {$at_least ->
     [one] {"at least "}
@@ -93,9 +90,6 @@ codegen_ssa_insufficient_vs_code_product = VS Code is a different product, and i
 
 codegen_ssa_invalid_instruction_set = invalid instruction set specified
 
-codegen_ssa_invalid_link_ordinal_nargs = incorrect number of arguments to `#[link_ordinal]`
-    .note = the attribute requires exactly one argument
-
 codegen_ssa_invalid_literal_value = invalid literal value
     .label = value must be an integer between `0` and `255`
 
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index 85d01d4f938..dd49db26689 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -116,6 +116,10 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
                 AttributeKind::Naked(_) => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NAKED,
                 AttributeKind::Align { align, .. } => codegen_fn_attrs.alignment = Some(*align),
                 AttributeKind::LinkName { name, .. } => codegen_fn_attrs.link_name = Some(*name),
+                AttributeKind::LinkOrdinal { ordinal, span } => {
+                    codegen_fn_attrs.link_ordinal = Some(*ordinal);
+                    link_ordinal_span = Some(*span);
+                }
                 AttributeKind::LinkSection { name, .. } => {
                     codegen_fn_attrs.link_section = Some(*name)
                 }
@@ -250,12 +254,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
                     }
                 }
             }
-            sym::link_ordinal => {
-                link_ordinal_span = Some(attr.span());
-                if let ordinal @ Some(_) = check_link_ordinal(tcx, attr) {
-                    codegen_fn_attrs.link_ordinal = ordinal;
-                }
-            }
             sym::no_sanitize => {
                 no_sanitize_span = Some(attr.span());
                 if let Some(list) = attr.meta_item_list() {
@@ -568,45 +566,6 @@ fn inherited_align<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<Align> {
     tcx.codegen_fn_attrs(opt_trait_item(tcx, def_id)?).alignment
 }
 
-fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &hir::Attribute) -> Option<u16> {
-    use rustc_ast::{LitIntType, LitKind, MetaItemLit};
-    let meta_item_list = attr.meta_item_list()?;
-    let [sole_meta_list] = &meta_item_list[..] else {
-        tcx.dcx().emit_err(errors::InvalidLinkOrdinalNargs { span: attr.span() });
-        return None;
-    };
-    if let Some(MetaItemLit { kind: LitKind::Int(ordinal, LitIntType::Unsuffixed), .. }) =
-        sole_meta_list.lit()
-    {
-        // According to the table at
-        // https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-header, the
-        // ordinal must fit into 16 bits. Similarly, the Ordinal field in COFFShortExport (defined
-        // in llvm/include/llvm/Object/COFFImportFile.h), which we use to communicate import
-        // information to LLVM for `#[link(kind = "raw-dylib"_])`, is also defined to be uint16_t.
-        //
-        // FIXME: should we allow an ordinal of 0?  The MSVC toolchain has inconsistent support for
-        // this: both LINK.EXE and LIB.EXE signal errors and abort when given a .DEF file that
-        // specifies a zero ordinal. However, llvm-dlltool is perfectly happy to generate an import
-        // library for such a .DEF file, and MSVC's LINK.EXE is also perfectly happy to consume an
-        // import library produced by LLVM with an ordinal of 0, and it generates an .EXE.  (I
-        // don't know yet if the resulting EXE runs, as I haven't yet built the necessary DLL --
-        // see earlier comment about LINK.EXE failing.)
-        if *ordinal <= u16::MAX as u128 {
-            Some(ordinal.get() as u16)
-        } else {
-            let msg = format!("ordinal value in `link_ordinal` is too large: `{ordinal}`");
-            tcx.dcx()
-                .struct_span_err(attr.span(), msg)
-                .with_note("the value may not exceed `u16::MAX`")
-                .emit();
-            None
-        }
-    } else {
-        tcx.dcx().emit_err(errors::InvalidLinkOrdinalFormat { span: attr.span() });
-        None
-    }
-}
-
 fn check_link_name_xor_ordinal(
     tcx: TyCtxt<'_>,
     codegen_fn_attrs: &CodegenFnAttrs,
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs
index e042fe1f819..9040915b6af 100644
--- a/compiler/rustc_codegen_ssa/src/errors.rs
+++ b/compiler/rustc_codegen_ssa/src/errors.rs
@@ -1109,22 +1109,6 @@ pub(crate) struct InvalidNoSanitize {
 }
 
 #[derive(Diagnostic)]
-#[diag(codegen_ssa_invalid_link_ordinal_nargs)]
-#[note]
-pub(crate) struct InvalidLinkOrdinalNargs {
-    #[primary_span]
-    pub span: Span,
-}
-
-#[derive(Diagnostic)]
-#[diag(codegen_ssa_illegal_link_ordinal_format)]
-#[note]
-pub(crate) struct InvalidLinkOrdinalFormat {
-    #[primary_span]
-    pub span: Span,
-}
-
-#[derive(Diagnostic)]
 #[diag(codegen_ssa_target_feature_safe_trait)]
 pub(crate) struct TargetFeatureSafeTrait {
     #[primary_span]
diff --git a/compiler/rustc_driver_impl/Cargo.toml b/compiler/rustc_driver_impl/Cargo.toml
index ce26aa449d9..0d6b49607eb 100644
--- a/compiler/rustc_driver_impl/Cargo.toml
+++ b/compiler/rustc_driver_impl/Cargo.toml
@@ -41,6 +41,7 @@ rustc_parse = { path = "../rustc_parse" }
 rustc_passes = { path = "../rustc_passes" }
 rustc_pattern_analysis = { path = "../rustc_pattern_analysis" }
 rustc_privacy = { path = "../rustc_privacy" }
+rustc_public = { path = "../rustc_public", features = ["rustc_internal"] }
 rustc_query_system = { path = "../rustc_query_system" }
 rustc_resolve = { path = "../rustc_resolve" }
 rustc_session = { path = "../rustc_session" }
@@ -50,7 +51,6 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
 rustc_ty_utils = { path = "../rustc_ty_utils" }
 serde_json = "1.0.59"
 shlex = "1.0"
-stable_mir = { path = "../stable_mir", features = ["rustc_internal"] }
 tracing = { version = "0.1.35" }
 # tidy-alphabetical-end
 
diff --git a/compiler/rustc_driver_impl/src/pretty.rs b/compiler/rustc_driver_impl/src/pretty.rs
index 688307a941f..1604b704033 100644
--- a/compiler/rustc_driver_impl/src/pretty.rs
+++ b/compiler/rustc_driver_impl/src/pretty.rs
@@ -8,10 +8,10 @@ use rustc_middle::bug;
 use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty};
 use rustc_middle::ty::{self, TyCtxt};
 use rustc_mir_build::thir::print::{thir_flat, thir_tree};
+use rustc_public::rustc_internal::pretty::write_smir_pretty;
 use rustc_session::Session;
 use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode};
 use rustc_span::{FileName, Ident};
-use stable_mir::rustc_internal::pretty::write_smir_pretty;
 use tracing::debug;
 use {rustc_ast as ast, rustc_hir_pretty as pprust_hir};
 
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index efd8bde71d7..e985e04ba33 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -444,7 +444,7 @@ declare_features! (
     /// Be more precise when looking for live drops in a const context.
     (unstable, const_precise_live_drops, "1.46.0", Some(73255)),
     /// Allows `impl const Trait for T` syntax.
-    (unstable, const_trait_impl, "1.42.0", Some(67792)),
+    (unstable, const_trait_impl, "1.42.0", Some(143874)),
     /// Allows the `?` operator in const contexts.
     (unstable, const_try, "1.56.0", Some(74935)),
     /// Allows use of contracts attributes.
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 80e07af8a46..159518a8d87 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -1304,6 +1304,7 @@ impl AttributeExt for Attribute {
             Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span,
             Attribute::Parsed(AttributeKind::MayDangle(span)) => *span,
             Attribute::Parsed(AttributeKind::Ignore { span, .. }) => *span,
+            Attribute::Parsed(AttributeKind::AutomaticallyDerived(span)) => *span,
             a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"),
         }
     }
@@ -1334,6 +1335,11 @@ impl AttributeExt for Attribute {
             _ => None,
         }
     }
+
+    fn is_automatically_derived_attr(&self) -> bool {
+        matches!(self, Attribute::Parsed(AttributeKind::AutomaticallyDerived(..)))
+    }
+
     #[inline]
     fn doc_str_and_comment_kind(&self) -> Option<(Symbol, CommentKind)> {
         match &self {
diff --git a/compiler/rustc_infer/src/infer/canonical/query_response.rs b/compiler/rustc_infer/src/infer/canonical/query_response.rs
index 008ef690008..d5d49e3188a 100644
--- a/compiler/rustc_infer/src/infer/canonical/query_response.rs
+++ b/compiler/rustc_infer/src/infer/canonical/query_response.rs
@@ -13,7 +13,6 @@ use std::iter;
 use rustc_index::{Idx, IndexVec};
 use rustc_middle::arena::ArenaAllocatable;
 use rustc_middle::bug;
-use rustc_middle::mir::ConstraintCategory;
 use rustc_middle::ty::{self, BoundVar, GenericArg, GenericArgKind, Ty, TyCtxt, TypeFoldable};
 use tracing::{debug, instrument};
 
@@ -23,7 +22,9 @@ use crate::infer::canonical::{
     QueryRegionConstraints, QueryResponse,
 };
 use crate::infer::region_constraints::{Constraint, RegionConstraintData};
-use crate::infer::{DefineOpaqueTypes, InferCtxt, InferOk, InferResult, SubregionOrigin};
+use crate::infer::{
+    DefineOpaqueTypes, InferCtxt, InferOk, InferResult, SubregionOrigin, TypeOutlivesConstraint,
+};
 use crate::traits::query::NoSolution;
 use crate::traits::{ObligationCause, PredicateObligations, ScrubbedTraitError, TraitEngine};
 
@@ -117,13 +118,7 @@ impl<'tcx> InferCtxt<'tcx> {
         let region_obligations = self.take_registered_region_obligations();
         debug!(?region_obligations);
         let region_constraints = self.with_region_constraints(|region_constraints| {
-            make_query_region_constraints(
-                tcx,
-                region_obligations
-                    .iter()
-                    .map(|r_o| (r_o.sup_type, r_o.sub_region, r_o.origin.to_constraint_category())),
-                region_constraints,
-            )
+            make_query_region_constraints(tcx, region_obligations, region_constraints)
         });
         debug!(?region_constraints);
 
@@ -570,7 +565,7 @@ impl<'tcx> InferCtxt<'tcx> {
 /// creates query region constraints.
 pub fn make_query_region_constraints<'tcx>(
     tcx: TyCtxt<'tcx>,
-    outlives_obligations: impl Iterator<Item = (Ty<'tcx>, ty::Region<'tcx>, ConstraintCategory<'tcx>)>,
+    outlives_obligations: Vec<TypeOutlivesConstraint<'tcx>>,
     region_constraints: &RegionConstraintData<'tcx>,
 ) -> QueryRegionConstraints<'tcx> {
     let RegionConstraintData { constraints, verifys } = region_constraints;
@@ -599,8 +594,11 @@ pub fn make_query_region_constraints<'tcx>(
             };
             (constraint, origin.to_constraint_category())
         })
-        .chain(outlives_obligations.map(|(ty, r, constraint_category)| {
-            (ty::OutlivesPredicate(ty.into(), r), constraint_category)
+        .chain(outlives_obligations.into_iter().map(|obl| {
+            (
+                ty::OutlivesPredicate(obl.sup_type.into(), obl.sub_region),
+                obl.origin.to_constraint_category(),
+            )
         }))
         .collect();
 
diff --git a/compiler/rustc_infer/src/infer/outlives/obligations.rs b/compiler/rustc_infer/src/infer/outlives/obligations.rs
index f272052aaa5..43504bd77c1 100644
--- a/compiler/rustc_infer/src/infer/outlives/obligations.rs
+++ b/compiler/rustc_infer/src/infer/outlives/obligations.rs
@@ -166,6 +166,7 @@ impl<'tcx> InferCtxt<'tcx> {
 
     /// Trait queries just want to pass back type obligations "as is"
     pub fn take_registered_region_obligations(&self) -> Vec<TypeOutlivesConstraint<'tcx>> {
+        assert!(!self.in_snapshot(), "cannot take registered region obligations in a snapshot");
         std::mem::take(&mut self.inner.borrow_mut().region_obligations)
     }
 
diff --git a/compiler/rustc_infer/src/infer/snapshot/undo_log.rs b/compiler/rustc_infer/src/infer/snapshot/undo_log.rs
index 6193f35f3eb..34e649afedc 100644
--- a/compiler/rustc_infer/src/infer/snapshot/undo_log.rs
+++ b/compiler/rustc_infer/src/infer/snapshot/undo_log.rs
@@ -1,3 +1,4 @@
+use std::assert_matches::assert_matches;
 use std::marker::PhantomData;
 
 use rustc_data_structures::undo_log::{Rollback, UndoLogs};
@@ -73,7 +74,8 @@ impl<'tcx> Rollback<UndoLog<'tcx>> for InferCtxtInner<'tcx> {
             }
             UndoLog::ProjectionCache(undo) => self.projection_cache.reverse(undo),
             UndoLog::PushTypeOutlivesConstraint => {
-                self.region_obligations.pop();
+                let popped = self.region_obligations.pop();
+                assert_matches!(popped, Some(_), "pushed region constraint but could not pop it");
             }
         }
     }
diff --git a/compiler/rustc_lint/src/default_could_be_derived.rs b/compiler/rustc_lint/src/default_could_be_derived.rs
index 0bc772d081f..b5fc083a095 100644
--- a/compiler/rustc_lint/src/default_could_be_derived.rs
+++ b/compiler/rustc_lint/src/default_could_be_derived.rs
@@ -1,3 +1,4 @@
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_data_structures::fx::FxHashMap;
 use rustc_errors::{Applicability, Diag};
 use rustc_hir as hir;
@@ -62,7 +63,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived {
         let hir::ImplItemKind::Fn(_sig, body_id) = impl_item.kind else { return };
         let assoc = cx.tcx.associated_item(impl_item.owner_id);
         let parent = assoc.container_id(cx.tcx);
-        if cx.tcx.has_attr(parent, sym::automatically_derived) {
+        if find_attr!(cx.tcx.get_all_attrs(parent), AttributeKind::AutomaticallyDerived(..)) {
             // We don't care about what `#[derive(Default)]` produces in this lint.
             return;
         }
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs
index c72f8571153..16eeb89207b 100644
--- a/compiler/rustc_lint/src/levels.rs
+++ b/compiler/rustc_lint/src/levels.rs
@@ -644,7 +644,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
     ) {
         let sess = self.sess;
         for (attr_index, attr) in attrs.iter().enumerate() {
-            if attr.has_name(sym::automatically_derived) {
+            if attr.is_automatically_derived_attr() {
                 self.insert(
                     LintId::of(SINGLE_USE_LIFETIMES),
                     LevelAndSource {
diff --git a/compiler/rustc_metadata/src/native_libs.rs b/compiler/rustc_metadata/src/native_libs.rs
index f10d71f4c65..4d276f814ef 100644
--- a/compiler/rustc_metadata/src/native_libs.rs
+++ b/compiler/rustc_metadata/src/native_libs.rs
@@ -3,6 +3,7 @@ use std::path::{Path, PathBuf};
 
 use rustc_abi::ExternAbi;
 use rustc_ast::CRATE_NODE_ID;
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_attr_parsing as attr;
 use rustc_data_structures::fx::FxHashSet;
 use rustc_middle::query::LocalCrate;
@@ -496,14 +497,9 @@ impl<'tcx> Collector<'tcx> {
                 }
                 _ => {
                     for &child_item in foreign_items {
-                        if self.tcx.def_kind(child_item).has_codegen_attrs()
-                            && self.tcx.codegen_fn_attrs(child_item).link_ordinal.is_some()
+                        if let Some(span) = find_attr!(self.tcx.get_all_attrs(child_item), AttributeKind::LinkOrdinal {span, ..} => *span)
                         {
-                            let link_ordinal_attr =
-                                self.tcx.get_attr(child_item, sym::link_ordinal).unwrap();
-                            sess.dcx().emit_err(errors::LinkOrdinalRawDylib {
-                                span: link_ordinal_attr.span(),
-                            });
+                            sess.dcx().emit_err(errors::LinkOrdinalRawDylib { span });
                         }
                     }
 
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs
index 9df44bbc15e..a352ab3fd08 100644
--- a/compiler/rustc_middle/src/ty/mod.rs
+++ b/compiler/rustc_middle/src/ty/mod.rs
@@ -28,7 +28,7 @@ use rustc_abi::{Align, FieldIdx, Integer, IntegerType, ReprFlags, ReprOptions, V
 use rustc_ast::expand::StrippedCfgItem;
 use rustc_ast::node_id::NodeMap;
 pub use rustc_ast_ir::{Movability, Mutability, try_visit};
-use rustc_attr_data_structures::AttributeKind;
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
 use rustc_data_structures::intern::Interned;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@@ -2035,7 +2035,7 @@ impl<'tcx> TyCtxt<'tcx> {
 
     /// Check if the given `DefId` is `#\[automatically_derived\]`.
     pub fn is_automatically_derived(self, def_id: DefId) -> bool {
-        self.has_attr(def_id, sym::automatically_derived)
+        find_attr!(self.get_all_attrs(def_id), AttributeKind::AutomaticallyDerived(..))
     }
 
     /// Looks up the span of `impl_did` if the impl is local; otherwise returns `Err`
diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
index 6d617d43c2a..91fcbb9390f 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs
@@ -2,6 +2,7 @@ use core::ops::ControlFlow;
 
 use rustc_abi::{FieldIdx, VariantIdx};
 use rustc_apfloat::Float;
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 use rustc_data_structures::fx::FxHashSet;
 use rustc_errors::Diag;
 use rustc_hir as hir;
@@ -15,7 +16,7 @@ use rustc_middle::ty::{
 };
 use rustc_middle::{mir, span_bug};
 use rustc_span::def_id::DefId;
-use rustc_span::{DUMMY_SP, Span, sym};
+use rustc_span::{DUMMY_SP, Span};
 use rustc_trait_selection::traits::ObligationCause;
 use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
 use tracing::{debug, instrument, trace};
@@ -495,7 +496,8 @@ fn type_has_partial_eq_impl<'tcx>(
     let mut structural_peq = false;
     let mut impl_def_id = None;
     for def_id in tcx.non_blanket_impls_for_ty(partial_eq_trait_id, ty) {
-        automatically_derived = tcx.has_attr(def_id, sym::automatically_derived);
+        automatically_derived =
+            find_attr!(tcx.get_all_attrs(def_id), AttributeKind::AutomaticallyDerived(..));
         impl_def_id = Some(def_id);
     }
     for _ in tcx.non_blanket_impls_for_ty(structural_partial_eq_trait_id, ty) {
diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs
index bb5c1e0e653..5c748e956a0 100644
--- a/compiler/rustc_parse/src/validate_attr.rs
+++ b/compiler/rustc_parse/src/validate_attr.rs
@@ -305,17 +305,20 @@ pub fn check_builtin_meta_item(
                 | sym::naked
                 | sym::no_mangle
                 | sym::non_exhaustive
+                | sym::omit_gdb_pretty_printer_section
                 | sym::path
                 | sym::ignore
                 | sym::must_use
                 | sym::track_caller
                 | sym::link_name
+                | sym::link_ordinal
                 | sym::export_name
                 | sym::rustc_macro_transparency
                 | sym::link_section
                 | sym::rustc_layout_scalar_valid_range_start
                 | sym::rustc_layout_scalar_valid_range_end
                 | sym::no_implicit_prelude
+                | sym::automatically_derived
         ) {
             return;
         }
diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl
index 46c21dcf67b..3418d997b83 100644
--- a/compiler/rustc_passes/messages.ftl
+++ b/compiler/rustc_passes/messages.ftl
@@ -17,6 +17,10 @@ passes_align_attr_application =
     `#[align(...)]` should be applied to a function item
     .label = not a function item
 
+passes_align_on_fields =
+    attribute should be applied to a function or method
+    .warn = {-passes_previously_accepted}
+
 passes_align_should_be_repr_align =
     `#[align(...)]` is not supported on {$item} items
     .suggestion = use `#[repr(align(...))]` instead
@@ -700,7 +704,7 @@ passes_trait_impl_const_stability_mismatch_trait_unstable = ...but the trait is
 
 passes_trait_impl_const_stable =
     trait implementations cannot be const stable yet
-    .note = see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+    .note = see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 passes_transparent_incompatible =
     transparent {$target} cannot have other repr hints
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index e7af615a715..820255afe27 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -45,6 +45,7 @@ use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs};
 use rustc_trait_selection::traits::ObligationCtxt;
 use tracing::debug;
 
+use crate::errors::AlignOnFields;
 use crate::{errors, fluent_generated as fluent};
 
 #[derive(LintDiagnostic)]
@@ -154,6 +155,14 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                 Attribute::Parsed(AttributeKind::Confusables { first_span, .. }) => {
                     self.check_confusables(*first_span, target);
                 }
+                Attribute::Parsed(AttributeKind::AutomaticallyDerived(attr_span)) => self
+                    .check_generic_attr(
+                        hir_id,
+                        sym::automatically_derived,
+                        *attr_span,
+                        target,
+                        Target::Impl,
+                    ),
                 Attribute::Parsed(
                     AttributeKind::Stability { span, .. }
                     | AttributeKind::ConstStability { span, .. },
@@ -199,8 +208,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                 Attribute::Parsed(AttributeKind::ExportName { span: attr_span, .. }) => {
                     self.check_export_name(hir_id, *attr_span, span, target)
                 }
-                Attribute::Parsed(AttributeKind::Align { align, span: repr_span }) => {
-                    self.check_align(span, target, *align, *repr_span)
+                Attribute::Parsed(AttributeKind::Align { align, span: attr_span }) => {
+                    self.check_align(span, hir_id, target, *align, *attr_span)
                 }
                 Attribute::Parsed(AttributeKind::LinkSection { span: attr_span, .. }) => {
                     self.check_link_section(hir_id, *attr_span, span, target)
@@ -242,7 +251,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                     AttributeKind::BodyStability { .. }
                     | AttributeKind::ConstStabilityIndirect
                     | AttributeKind::MacroTransparency(_)
-                    | AttributeKind::Dummy,
+                    | AttributeKind::Dummy
+                    | AttributeKind::OmitGdbPrettyPrinterSection,
                 ) => { /* do nothing  */ }
                 Attribute::Parsed(AttributeKind::AsPtr(attr_span)) => {
                     self.check_applied_to_fn_or_method(hir_id, *attr_span, span, target)
@@ -250,6 +260,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                 Attribute::Parsed(AttributeKind::LinkName { span: attr_span, name }) => {
                     self.check_link_name(hir_id, *attr_span, *name, span, target)
                 }
+                Attribute::Parsed(AttributeKind::LinkOrdinal { span: attr_span, .. }) => {
+                    self.check_link_ordinal(*attr_span, span, target)
+                }
                 Attribute::Parsed(AttributeKind::MayDangle(attr_span)) => {
                     self.check_may_dangle(hir_id, *attr_span)
                 }
@@ -327,7 +340,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                         [sym::rustc_has_incoherent_inherent_impls, ..] => {
                             self.check_has_incoherent_inherent_impls(attr, span, target)
                         }
-                        [sym::link_ordinal, ..] => self.check_link_ordinal(attr, span, target),
+                        [sym::ffi_pure, ..] => self.check_ffi_pure(attr.span(), attrs, target),
+                        [sym::ffi_const, ..] => self.check_ffi_const(attr.span(), target),
                         [sym::link, ..] => self.check_link(hir_id, attr, span, target),
                         [sym::macro_use, ..] | [sym::macro_escape, ..] => {
                             self.check_macro_use(hir_id, attr, target)
@@ -337,9 +351,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                         [sym::should_panic, ..] => {
                             self.check_generic_attr_unparsed(hir_id, attr, target, Target::Fn)
                         }
-                        [sym::automatically_derived, ..] => {
-                            self.check_generic_attr_unparsed(hir_id, attr, target, Target::Impl)
-                        }
                         [sym::proc_macro, ..] => {
                             self.check_proc_macro(hir_id, target, ProcMacroKind::FunctionLike)
                         }
@@ -371,7 +382,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                             // need to be fixed
                             | sym::cfi_encoding // FIXME(cfi_encoding)
                             | sym::pointee // FIXME(derive_coerce_pointee)
-                            | sym::omit_gdb_pretty_printer_section // FIXME(omit_gdb_pretty_printer_section)
                             | sym::instruction_set // broken on stable!!!
                             | sym::windows_subsystem // broken on stable!!!
                             | sym::patchable_function_entry // FIXME(patchable_function_entry)
@@ -1944,22 +1954,37 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
     }
 
     /// Checks if the `#[align]` attributes on `item` are valid.
-    fn check_align(&self, span: Span, target: Target, align: Align, repr_span: Span) {
+    fn check_align(
+        &self,
+        span: Span,
+        hir_id: HirId,
+        target: Target,
+        align: Align,
+        attr_span: Span,
+    ) {
         match target {
             Target::Fn | Target::Method(_) | Target::ForeignFn => {}
+            Target::Field => {
+                self.tcx.emit_node_span_lint(
+                    UNUSED_ATTRIBUTES,
+                    hir_id,
+                    attr_span,
+                    AlignOnFields { span },
+                );
+            }
             Target::Struct | Target::Union | Target::Enum => {
                 self.dcx().emit_err(errors::AlignShouldBeReprAlign {
-                    span: repr_span,
+                    span: attr_span,
                     item: target.name(),
                     align_bytes: align.bytes(),
                 });
             }
             _ => {
-                self.dcx().emit_err(errors::AlignAttrApplication { hint_span: repr_span, span });
+                self.dcx().emit_err(errors::AlignAttrApplication { hint_span: attr_span, span });
             }
         }
 
-        self.check_align_value(align, repr_span);
+        self.check_align_value(align, attr_span);
     }
 
     /// Checks if the `#[repr]` attributes on `item` are valid.
@@ -2260,11 +2285,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
         }
     }
 
-    fn check_link_ordinal(&self, attr: &Attribute, _span: Span, target: Target) {
+    fn check_link_ordinal(&self, attr_span: Span, _span: Span, target: Target) {
         match target {
             Target::ForeignFn | Target::ForeignStatic => {}
             _ => {
-                self.dcx().emit_err(errors::LinkOrdinal { attr_span: attr.span() });
+                self.dcx().emit_err(errors::LinkOrdinal { attr_span });
             }
         }
     }
@@ -2826,7 +2851,6 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) {
     // resolution for the attribute macro error.
     const ATTRS_TO_CHECK: &[Symbol] = &[
         sym::macro_export,
-        sym::automatically_derived,
         sym::rustc_main,
         sym::derive,
         sym::test,
@@ -2849,6 +2873,8 @@ fn check_invalid_crate_level_attr(tcx: TyCtxt<'_>, attrs: &[Attribute]) {
             (*first_attr_span, sym::repr)
         } else if let Attribute::Parsed(AttributeKind::Path(.., span)) = attr {
             (*span, sym::path)
+        } else if let Attribute::Parsed(AttributeKind::AutomaticallyDerived(span)) = attr {
+            (*span, sym::automatically_derived)
         } else {
             continue;
         };
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs
index 4ad615a2abf..093a2b38804 100644
--- a/compiler/rustc_passes/src/errors.rs
+++ b/compiler/rustc_passes/src/errors.rs
@@ -604,6 +604,14 @@ pub(crate) struct NoMangle {
     pub span: Span,
 }
 
+#[derive(LintDiagnostic)]
+#[diag(passes_align_on_fields)]
+#[warning]
+pub(crate) struct AlignOnFields {
+    #[label]
+    pub span: Span,
+}
+
 #[derive(Diagnostic)]
 #[diag(passes_repr_conflicting, code = E0566)]
 pub(crate) struct ReprConflicting {
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs
index 3088e189c20..7350c6a5a82 100644
--- a/compiler/rustc_passes/src/liveness.rs
+++ b/compiler/rustc_passes/src/liveness.rs
@@ -97,7 +97,7 @@ use rustc_middle::query::Providers;
 use rustc_middle::span_bug;
 use rustc_middle::ty::{self, RootVariableMinCaptureList, Ty, TyCtxt};
 use rustc_session::lint;
-use rustc_span::{BytePos, Span, Symbol, sym};
+use rustc_span::{BytePos, Span, Symbol};
 use tracing::{debug, instrument};
 
 use self::LiveNodeKind::*;
@@ -140,7 +140,7 @@ fn check_liveness(tcx: TyCtxt<'_>, def_id: LocalDefId) {
     // Don't run unused pass for #[derive()]
     let parent = tcx.local_parent(def_id);
     if let DefKind::Impl { .. } = tcx.def_kind(parent)
-        && tcx.has_attr(parent, sym::automatically_derived)
+        && find_attr!(tcx.get_all_attrs(parent), AttributeKind::AutomaticallyDerived(..))
     {
         return;
     }
diff --git a/compiler/stable_mir/Cargo.toml b/compiler/rustc_public/Cargo.toml
index 6777abce01d..fa782166e4f 100644
--- a/compiler/stable_mir/Cargo.toml
+++ b/compiler/rustc_public/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "stable_mir"
+name = "rustc_public"
 version = "0.1.0-preview"
 edition = "2024"
 
@@ -8,8 +8,8 @@ edition = "2024"
 rustc_abi = { path = "../rustc_abi" }
 rustc_hir = { path = "../rustc_hir" }
 rustc_middle = { path = "../rustc_middle" }
+rustc_public_bridge = { path = "../rustc_public_bridge" }
 rustc_session = { path = "../rustc_session" }
-rustc_smir = { path = "../rustc_smir" }
 rustc_span = { path = "../rustc_span" }
 rustc_target = { path = "../rustc_target" }
 scoped-tls = "1.0"
diff --git a/compiler/stable_mir/README.md b/compiler/rustc_public/README.md
index ab2546e377a..ab2546e377a 100644
--- a/compiler/stable_mir/README.md
+++ b/compiler/rustc_public/README.md
diff --git a/compiler/stable_mir/rust-toolchain.toml b/compiler/rustc_public/rust-toolchain.toml
index d75e8e33b1c..d75e8e33b1c 100644
--- a/compiler/stable_mir/rust-toolchain.toml
+++ b/compiler/rustc_public/rust-toolchain.toml
diff --git a/compiler/stable_mir/src/abi.rs b/compiler/rustc_public/src/abi.rs
index 7b0882caf1b..7b0882caf1b 100644
--- a/compiler/stable_mir/src/abi.rs
+++ b/compiler/rustc_public/src/abi.rs
diff --git a/compiler/stable_mir/src/alloc.rs b/compiler/rustc_public/src/alloc.rs
index 349b83231e3..d2db6c08bbc 100644
--- a/compiler/stable_mir/src/alloc.rs
+++ b/compiler/rustc_public/src/alloc.rs
@@ -2,14 +2,14 @@
 //!
 //! This module is responsible for constructing stable components.
 //! All operations requiring rustc queries must be delegated
-//! to `rustc_smir::alloc` to maintain stability guarantees.
+//! to `rustc_public_bridge::alloc` to maintain stability guarantees.
 
 use rustc_abi::Align;
 use rustc_middle::mir::ConstValue;
 use rustc_middle::mir::interpret::AllocRange;
-use rustc_smir::bridge::SmirError;
-use rustc_smir::context::SmirCtxt;
-use rustc_smir::{Tables, alloc};
+use rustc_public_bridge::bridge::SmirError;
+use rustc_public_bridge::context::SmirCtxt;
+use rustc_public_bridge::{Tables, alloc};
 
 use super::Error;
 use super::compiler_interface::BridgeTys;
@@ -59,7 +59,7 @@ pub(crate) fn try_new_allocation<'tcx>(
         }
         ConstValue::Indirect { alloc_id, offset } => {
             let alloc = alloc::try_new_indirect(alloc_id, cx);
-            use rustc_smir::context::SmirAllocRange;
+            use rustc_public_bridge::context::SmirAllocRange;
             Ok(allocation_filter(&alloc.0, cx.alloc_range(offset, layout.size), tables, cx))
         }
     }
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs
index 50c2f02e6ad..d15438c2b80 100644
--- a/compiler/stable_mir/src/compiler_interface.rs
+++ b/compiler/rustc_public/src/compiler_interface.rs
@@ -6,8 +6,8 @@
 use std::cell::Cell;
 
 use rustc_hir::def::DefKind;
-use rustc_smir::context::SmirCtxt;
-use rustc_smir::{Bridge, SmirContainer};
+use rustc_public_bridge::context::SmirCtxt;
+use rustc_public_bridge::{Bridge, SmirContainer};
 use tracing::debug;
 
 use crate::abi::{FnAbi, Layout, LayoutShape, ReprOptions};
@@ -68,7 +68,7 @@ impl Bridge for BridgeTys {
 
 /// Stable public API for querying compiler information.
 ///
-/// All queries are delegated to [`rustc_smir::context::SmirCtxt`] that provides
+/// All queries are delegated to [`rustc_public_bridge::context::SmirCtxt`] that provides
 /// similar APIs but based on internal rustc constructs.
 ///
 /// Do not use this directly. This is currently used in the macro expansion.
@@ -567,7 +567,7 @@ impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> {
             DefKind::Fn => ForeignItemKind::Fn(tables.fn_def(def_id)),
             DefKind::Static { .. } => ForeignItemKind::Static(tables.static_def(def_id)),
             DefKind::ForeignTy => {
-                use rustc_smir::context::SmirTy;
+                use rustc_public_bridge::context::SmirTy;
                 ForeignItemKind::Type(tables.intern_ty(cx.new_foreign(def_id)))
             }
             def_kind => unreachable!("Unexpected kind for a foreign item: {:?}", def_kind),
diff --git a/compiler/stable_mir/src/crate_def.rs b/compiler/rustc_public/src/crate_def.rs
index 75228135e4c..75228135e4c 100644
--- a/compiler/stable_mir/src/crate_def.rs
+++ b/compiler/rustc_public/src/crate_def.rs
diff --git a/compiler/stable_mir/src/error.rs b/compiler/rustc_public/src/error.rs
index 702134b0c4c..bc2124d1716 100644
--- a/compiler/stable_mir/src/error.rs
+++ b/compiler/rustc_public/src/error.rs
@@ -7,7 +7,7 @@
 use std::fmt::{Debug, Display, Formatter};
 use std::{fmt, io};
 
-use rustc_smir::bridge::SmirError;
+use rustc_public_bridge::bridge::SmirError;
 
 macro_rules! error {
      ($fmt: literal $(,)?) => { Error(format!($fmt)) };
diff --git a/compiler/stable_mir/src/lib.rs b/compiler/rustc_public/src/lib.rs
index 0a2e4e71afc..e320c4eca71 100644
--- a/compiler/stable_mir/src/lib.rs
+++ b/compiler/rustc_public/src/lib.rs
@@ -1,4 +1,4 @@
-//! The WIP stable interface to rustc internals.
+//! The WIP public interface to rustc internals.
 //!
 //! For more information see <https://github.com/rust-lang/project-stable-mir>
 //!
@@ -22,9 +22,9 @@
 use std::fmt::Debug;
 use std::{fmt, io};
 
-pub(crate) use rustc_smir::IndexedVal;
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+pub(crate) use rustc_public_bridge::IndexedVal;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 /// Export the rustc_internal APIs. Note that this module has no stability
 /// guarantees and it is not taken into account for semver.
 #[cfg(feature = "rustc_internal")]
@@ -244,7 +244,7 @@ pub fn opaque<T: Debug>(value: &T) -> Opaque {
 
 macro_rules! bridge_impl {
     ($name: ident, $ty: ty) => {
-        impl rustc_smir::bridge::$name<compiler_interface::BridgeTys> for $ty {
+        impl rustc_public_bridge::bridge::$name<compiler_interface::BridgeTys> for $ty {
             fn new(def: crate::DefId) -> Self {
                 Self(def)
             }
@@ -273,13 +273,15 @@ bridge_impl!(AssocDef, crate::ty::AssocDef);
 bridge_impl!(OpaqueDef, crate::ty::OpaqueDef);
 bridge_impl!(StaticDef, crate::mir::mono::StaticDef);
 
-impl rustc_smir::bridge::Prov<compiler_interface::BridgeTys> for crate::ty::Prov {
+impl rustc_public_bridge::bridge::Prov<compiler_interface::BridgeTys> for crate::ty::Prov {
     fn new(aid: crate::mir::alloc::AllocId) -> Self {
         Self(aid)
     }
 }
 
-impl rustc_smir::bridge::Allocation<compiler_interface::BridgeTys> for crate::ty::Allocation {
+impl rustc_public_bridge::bridge::Allocation<compiler_interface::BridgeTys>
+    for crate::ty::Allocation
+{
     fn new<'tcx>(
         bytes: Vec<Option<u8>>,
         ptrs: Vec<(usize, rustc_middle::mir::interpret::AllocId)>,
diff --git a/compiler/stable_mir/src/mir.rs b/compiler/rustc_public/src/mir.rs
index 413b5152bb3..413b5152bb3 100644
--- a/compiler/stable_mir/src/mir.rs
+++ b/compiler/rustc_public/src/mir.rs
diff --git a/compiler/stable_mir/src/mir/alloc.rs b/compiler/rustc_public/src/mir/alloc.rs
index 9a94551f3ec..9a94551f3ec 100644
--- a/compiler/stable_mir/src/mir/alloc.rs
+++ b/compiler/rustc_public/src/mir/alloc.rs
diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/rustc_public/src/mir/body.rs
index a9fe3607232..28a7aa6e758 100644
--- a/compiler/stable_mir/src/mir/body.rs
+++ b/compiler/rustc_public/src/mir/body.rs
@@ -674,7 +674,7 @@ pub enum AggregateKind {
     Tuple,
     Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
     Closure(ClosureDef, GenericArgs),
-    // FIXME(stable_mir): Movability here is redundant
+    // FIXME(rustc_public): Movability here is redundant
     Coroutine(CoroutineDef, GenericArgs, Movability),
     CoroutineClosure(CoroutineClosureDef, GenericArgs),
     RawPtr(Ty, Mutability),
diff --git a/compiler/stable_mir/src/mir/mono.rs b/compiler/rustc_public/src/mir/mono.rs
index c54fcecac9f..c85f0fa36f7 100644
--- a/compiler/stable_mir/src/mir/mono.rs
+++ b/compiler/rustc_public/src/mir/mono.rs
@@ -1,7 +1,7 @@
 use std::fmt::{Debug, Formatter};
 use std::io;
 
-use rustc_smir::bridge::SmirError;
+use rustc_public_bridge::bridge::SmirError;
 use serde::Serialize;
 
 use crate::abi::FnAbi;
diff --git a/compiler/stable_mir/src/mir/pretty.rs b/compiler/rustc_public/src/mir/pretty.rs
index f496d80053e..f496d80053e 100644
--- a/compiler/stable_mir/src/mir/pretty.rs
+++ b/compiler/rustc_public/src/mir/pretty.rs
diff --git a/compiler/stable_mir/src/mir/visit.rs b/compiler/rustc_public/src/mir/visit.rs
index 7dc99d1d1e1..7dc99d1d1e1 100644
--- a/compiler/stable_mir/src/mir/visit.rs
+++ b/compiler/rustc_public/src/mir/visit.rs
diff --git a/compiler/stable_mir/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs
index c1ed03ade75..5d7c8256d5b 100644
--- a/compiler/stable_mir/src/rustc_internal/mod.rs
+++ b/compiler/rustc_public/src/rustc_internal/mod.rs
@@ -6,8 +6,8 @@
 use std::cell::{Cell, RefCell};
 
 use rustc_middle::ty::TyCtxt;
-use rustc_smir::context::SmirCtxt;
-use rustc_smir::{Bridge, SmirContainer, Tables};
+use rustc_public_bridge::context::SmirCtxt;
+use rustc_public_bridge::{Bridge, SmirContainer, Tables};
 use rustc_span::def_id::CrateNum;
 use scoped_tls::scoped_thread_local;
 
@@ -105,11 +105,11 @@ where
 /// # extern crate rustc_interface;
 /// # extern crate rustc_middle;
 /// # #[macro_use]
-/// # extern crate stable_mir;
+/// # extern crate rustc_public;
 /// #
 /// # fn main() {
 /// #   use std::ops::ControlFlow;
-/// #   use stable_mir::CompilerError;
+/// #   use rustc_public::CompilerError;
 ///     fn analyze_code() -> ControlFlow<(), ()> {
 ///         // Your code goes in here.
 /// #       ControlFlow::Continue(())
@@ -125,11 +125,11 @@ where
 /// # extern crate rustc_interface;
 /// # extern crate rustc_middle;
 /// # #[macro_use]
-/// # extern crate stable_mir;
+/// # extern crate rustc_public;
 /// #
 /// # fn main() {
 /// #   use std::ops::ControlFlow;
-/// #   use stable_mir::CompilerError;
+/// #   use rustc_public::CompilerError;
 ///     fn analyze_code(extra_args: Vec<String>) -> ControlFlow<(), ()> {
 /// #       let _ = extra_args;
 ///         // Your code goes in here.
@@ -187,8 +187,8 @@ macro_rules! run_driver {
         use rustc_driver::{Callbacks, Compilation, run_compiler};
         use rustc_middle::ty::TyCtxt;
         use rustc_interface::interface;
-        use stable_mir::rustc_internal;
-        use stable_mir::CompilerError;
+        use rustc_public::rustc_internal;
+        use rustc_public::CompilerError;
         use std::ops::ControlFlow;
 
         pub struct StableMir<B = (), C = (), F = fn($(optional!($with_tcx TyCtxt))?) -> ControlFlow<B, C>>
diff --git a/compiler/stable_mir/src/rustc_internal/pretty.rs b/compiler/rustc_public/src/rustc_internal/pretty.rs
index 28c5280fe04..28c5280fe04 100644
--- a/compiler/stable_mir/src/rustc_internal/pretty.rs
+++ b/compiler/rustc_public/src/rustc_internal/pretty.rs
diff --git a/compiler/stable_mir/src/target.rs b/compiler/rustc_public/src/target.rs
index 32c3a2a9122..32c3a2a9122 100644
--- a/compiler/stable_mir/src/target.rs
+++ b/compiler/rustc_public/src/target.rs
diff --git a/compiler/stable_mir/src/ty.rs b/compiler/rustc_public/src/ty.rs
index 87d31cf9713..bc67a2f987d 100644
--- a/compiler/stable_mir/src/ty.rs
+++ b/compiler/rustc_public/src/ty.rs
@@ -560,7 +560,7 @@ pub enum RigidTy {
     FnDef(FnDef, GenericArgs),
     FnPtr(PolyFnSig),
     Closure(ClosureDef, GenericArgs),
-    // FIXME(stable_mir): Movability here is redundant
+    // FIXME(rustc_public): Movability here is redundant
     Coroutine(CoroutineDef, GenericArgs, Movability),
     CoroutineClosure(CoroutineClosureDef, GenericArgs),
     Dynamic(Vec<Binder<ExistentialPredicate>>, Region, DynKind),
diff --git a/compiler/stable_mir/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs
index 04b2e572621..8a6238413b0 100644
--- a/compiler/stable_mir/src/unstable/convert/internal.rs
+++ b/compiler/rustc_public/src/unstable/convert/internal.rs
@@ -3,10 +3,10 @@
 //! This module will only include a few constructs to allow users to invoke internal rustc APIs
 //! due to incomplete stable coverage.
 
-// Prefer importing stable_mir over internal rustc constructs to make this file more readable.
+// Prefer importing rustc_public over internal rustc constructs to make this file more readable.
 
 use rustc_middle::ty::{self as rustc_ty, Const as InternalConst, Ty as InternalTy};
-use rustc_smir::Tables;
+use rustc_public_bridge::Tables;
 
 use crate::abi::Layout;
 use crate::compiler_interface::BridgeTys;
diff --git a/compiler/stable_mir/src/unstable/convert/mod.rs b/compiler/rustc_public/src/unstable/convert/mod.rs
index aad92325861..85a71e09c3e 100644
--- a/compiler/stable_mir/src/unstable/convert/mod.rs
+++ b/compiler/rustc_public/src/unstable/convert/mod.rs
@@ -1,15 +1,15 @@
 //! This module holds the logic to convert rustc internal ADTs into stable mir ADTs.
 //!
 //! The conversion from stable to internal is not meant to be complete,
-//! and it should be added as when needed to be passed as input to rustc_smir functions.
+//! and it should be added as when needed to be passed as input to rustc_public_bridge functions.
 //!
 //! For contributors, please make sure to avoid calling rustc's internal functions and queries.
-//! These should be done via `rustc_smir` APIs, but it's possible to access ADT fields directly.
+//! These should be done via `rustc_public_bridge` APIs, but it's possible to access ADT fields directly.
 
 use std::ops::RangeInclusive;
 
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 
 use super::Stable;
 use crate::compiler_interface::BridgeTys;
diff --git a/compiler/stable_mir/src/unstable/convert/stable/abi.rs b/compiler/rustc_public/src/unstable/convert/stable/abi.rs
index 8fdaa69c305..40a8bf614e1 100644
--- a/compiler/stable_mir/src/unstable/convert/stable/abi.rs
+++ b/compiler/rustc_public/src/unstable/convert/stable/abi.rs
@@ -4,8 +4,8 @@
 
 use rustc_abi::{ArmCall, CanonAbi, InterruptKind, X86Call};
 use rustc_middle::ty;
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 use rustc_target::callconv;
 
 use crate::abi::{
diff --git a/compiler/stable_mir/src/unstable/convert/stable/mir.rs b/compiler/rustc_public/src/unstable/convert/stable/mir.rs
index ad39fc37600..bd7d4807152 100644
--- a/compiler/stable_mir/src/unstable/convert/stable/mir.rs
+++ b/compiler/rustc_public/src/unstable/convert/stable/mir.rs
@@ -2,9 +2,9 @@
 
 use rustc_middle::mir::mono::MonoItem;
 use rustc_middle::{bug, mir};
-use rustc_smir::Tables;
-use rustc_smir::bridge::SmirError;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::bridge::SmirError;
+use rustc_public_bridge::context::SmirCtxt;
 
 use crate::compiler_interface::BridgeTys;
 use crate::mir::alloc::GlobalAlloc;
@@ -821,7 +821,7 @@ impl<'tcx> Stable<'tcx> for mir::interpret::Allocation {
         tables: &mut Tables<'cx, BridgeTys>,
         cx: &SmirCtxt<'cx, BridgeTys>,
     ) -> Self::T {
-        use rustc_smir::context::SmirAllocRange;
+        use rustc_public_bridge::context::SmirAllocRange;
         alloc::allocation_filter(
             self,
             cx.alloc_range(rustc_abi::Size::ZERO, self.size()),
diff --git a/compiler/stable_mir/src/unstable/convert/stable/mod.rs b/compiler/rustc_public/src/unstable/convert/stable/mod.rs
index e7f14bbdfc8..ea78ca50eb3 100644
--- a/compiler/stable_mir/src/unstable/convert/stable/mod.rs
+++ b/compiler/rustc_public/src/unstable/convert/stable/mod.rs
@@ -1,8 +1,8 @@
 //! Conversion of internal Rust compiler items to stable ones.
 
 use rustc_abi::FieldIdx;
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 
 use super::Stable;
 use crate::compiler_interface::BridgeTys;
diff --git a/compiler/stable_mir/src/unstable/convert/stable/ty.rs b/compiler/rustc_public/src/unstable/convert/stable/ty.rs
index 366f7ea01d4..75c29788787 100644
--- a/compiler/stable_mir/src/unstable/convert/stable/ty.rs
+++ b/compiler/rustc_public/src/unstable/convert/stable/ty.rs
@@ -2,8 +2,8 @@
 
 use rustc_middle::ty::Ty;
 use rustc_middle::{bug, mir, ty};
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 
 use crate::alloc;
 use crate::compiler_interface::BridgeTys;
diff --git a/compiler/stable_mir/src/unstable/internal_cx/mod.rs b/compiler/rustc_public/src/unstable/internal_cx/mod.rs
index 6b0a06e304c..6b0a06e304c 100644
--- a/compiler/stable_mir/src/unstable/internal_cx/mod.rs
+++ b/compiler/rustc_public/src/unstable/internal_cx/mod.rs
diff --git a/compiler/stable_mir/src/unstable/internal_cx/traits.rs b/compiler/rustc_public/src/unstable/internal_cx/traits.rs
index da443cd78f1..da443cd78f1 100644
--- a/compiler/stable_mir/src/unstable/internal_cx/traits.rs
+++ b/compiler/rustc_public/src/unstable/internal_cx/traits.rs
diff --git a/compiler/stable_mir/src/unstable/mod.rs b/compiler/rustc_public/src/unstable/mod.rs
index 51c31e212f5..ce7c41a64fa 100644
--- a/compiler/stable_mir/src/unstable/mod.rs
+++ b/compiler/rustc_public/src/unstable/mod.rs
@@ -9,8 +9,8 @@ use std::marker::PointeeSized;
 use rustc_hir::def::DefKind;
 use rustc_middle::ty::{List, Ty, TyCtxt};
 use rustc_middle::{mir, ty};
-use rustc_smir::Tables;
-use rustc_smir::context::SmirCtxt;
+use rustc_public_bridge::Tables;
+use rustc_public_bridge::context::SmirCtxt;
 
 use super::compiler_interface::BridgeTys;
 use crate::{CtorKind, ItemKind};
@@ -21,7 +21,7 @@ mod internal_cx;
 /// Trait that defines the methods that are fine to call from [`RustcInternal`].
 ///
 /// This trait is only for [`RustcInternal`]. Any other other access to rustc's internals
-/// should go through [`rustc_smir::context::SmirCtxt`].
+/// should go through [`rustc_public_bridge::context::SmirCtxt`].
 pub trait InternalCx<'tcx>: Copy + Clone {
     fn tcx(self) -> TyCtxt<'tcx>;
 
diff --git a/compiler/stable_mir/src/visitor.rs b/compiler/rustc_public/src/visitor.rs
index 45e2a815470..45e2a815470 100644
--- a/compiler/stable_mir/src/visitor.rs
+++ b/compiler/rustc_public/src/visitor.rs
diff --git a/compiler/rustc_smir/.gitignore b/compiler/rustc_public_bridge/.gitignore
index eb5a316cbd1..eb5a316cbd1 100644
--- a/compiler/rustc_smir/.gitignore
+++ b/compiler/rustc_public_bridge/.gitignore
diff --git a/compiler/rustc_smir/Cargo.toml b/compiler/rustc_public_bridge/Cargo.toml
index b7ea478f731..918de4a393c 100644
--- a/compiler/rustc_smir/Cargo.toml
+++ b/compiler/rustc_public_bridge/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "rustc_smir"
+name = "rustc_public_bridge"
 version = "0.0.0"
 edition = "2024"
 
diff --git a/compiler/rustc_smir/src/alloc.rs b/compiler/rustc_public_bridge/src/alloc.rs
index fd3cf24edb5..23bbaddce06 100644
--- a/compiler/rustc_smir/src/alloc.rs
+++ b/compiler/rustc_public_bridge/src/alloc.rs
@@ -1,7 +1,7 @@
 //! Internal memory allocator implementation for StableMIR.
 //!
 //! This module handles all direct interactions with rustc queries and performs
-//! the actual memory allocations. The stable interface in `stable_mir::alloc`
+//! the actual memory allocations. The stable interface in `rustc_public::alloc`
 //! delegates all query-related operations to this implementation.
 
 use rustc_abi::{Size, TyAndLayout};
diff --git a/compiler/rustc_smir/src/bridge.rs b/compiler/rustc_public_bridge/src/bridge.rs
index a31eb93d0e8..379a8da5df9 100644
--- a/compiler/rustc_smir/src/bridge.rs
+++ b/compiler/rustc_public_bridge/src/bridge.rs
@@ -1,8 +1,8 @@
 //! Defines a set of traits that is used for abstracting
-//! stable_mir's components that are needed in rustc_smir.
+//! rustc_public's components that are needed in rustc_public_bridge.
 //!
 //! These traits are really useful when programming
-//! in stable_mir-agnostic settings.
+//! in rustc_public-agnostic settings.
 
 use std::fmt::Debug;
 
diff --git a/compiler/rustc_smir/src/builder.rs b/compiler/rustc_public_bridge/src/builder.rs
index 2141053d09a..2141053d09a 100644
--- a/compiler/rustc_smir/src/builder.rs
+++ b/compiler/rustc_public_bridge/src/builder.rs
diff --git a/compiler/rustc_smir/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs
index fdefad2821b..fdefad2821b 100644
--- a/compiler/rustc_smir/src/context/impls.rs
+++ b/compiler/rustc_public_bridge/src/context/impls.rs
diff --git a/compiler/rustc_smir/src/context/mod.rs b/compiler/rustc_public_bridge/src/context/mod.rs
index da20be2a4b3..da20be2a4b3 100644
--- a/compiler/rustc_smir/src/context/mod.rs
+++ b/compiler/rustc_public_bridge/src/context/mod.rs
diff --git a/compiler/rustc_smir/src/context/traits.rs b/compiler/rustc_public_bridge/src/context/traits.rs
index 8483bee4aad..8483bee4aad 100644
--- a/compiler/rustc_smir/src/context/traits.rs
+++ b/compiler/rustc_public_bridge/src/context/traits.rs
diff --git a/compiler/rustc_smir/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs
index fbebf98df7d..652a8093a87 100644
--- a/compiler/rustc_smir/src/lib.rs
+++ b/compiler/rustc_public_bridge/src/lib.rs
@@ -3,7 +3,7 @@
 //! This crate is responsible for building Stable MIR components from internal components.
 //!
 //! This crate is not intended to be invoked directly by users.
-//! This crate is the public API of rustc that will be invoked by the `stable_mir` crate.
+//! This crate is the public API of rustc that will be invoked by the `rustc_public` crate.
 //!
 //! For more information see <https://github.com/rust-lang/project-stable-mir>
 //!
@@ -42,7 +42,7 @@ pub mod bridge;
 mod builder;
 pub mod context;
 
-#[deprecated(note = "please use `stable_mir::rustc_internal` instead")]
+#[deprecated(note = "please use `rustc_public::rustc_internal` instead")]
 pub mod rustc_internal {}
 
 /// A container which is used for TLS.
@@ -211,7 +211,7 @@ impl<'tcx, B: Bridge> Tables<'tcx, B> {
 }
 
 /// A trait defining types that are used to emulate StableMIR components, which is really
-/// useful when programming in stable_mir-agnostic settings.
+/// useful when programming in rustc_public-agnostic settings.
 pub trait Bridge: Sized {
     type DefId: Copy + Debug + PartialEq + IndexedVal;
     type AllocId: Copy + Debug + PartialEq + IndexedVal;
diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs
index d22529d56a4..1a24254d57f 100644
--- a/compiler/rustc_trait_selection/src/solve/delegate.rs
+++ b/compiler/rustc_trait_selection/src/solve/delegate.rs
@@ -213,13 +213,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate<
         // inside of a `probe` whenever we have multiple choices inside of the solver.
         let region_obligations = self.0.inner.borrow().region_obligations().to_owned();
         let region_constraints = self.0.with_region_constraints(|region_constraints| {
-            make_query_region_constraints(
-                self.tcx,
-                region_obligations
-                    .iter()
-                    .map(|r_o| (r_o.sup_type, r_o.sub_region, r_o.origin.to_constraint_category())),
-                region_constraints,
-            )
+            make_query_region_constraints(self.tcx, region_obligations, region_constraints)
         });
 
         let mut seen = FxHashSet::default();
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 18010603286..3b549244431 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
@@ -103,10 +103,7 @@ where
     let region_constraint_data = infcx.take_and_reset_region_constraints();
     let region_constraints = query_response::make_query_region_constraints(
         infcx.tcx,
-        region_obligations
-            .iter()
-            .map(|r_o| (r_o.sup_type, r_o.sub_region, r_o.origin.to_constraint_category()))
-            .map(|(ty, r, cc)| (infcx.resolve_vars_if_possible(ty), r, cc)),
+        region_obligations,
         &region_constraint_data,
     );
 
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 58baa07bc17..a189c00a6b6 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -2611,7 +2611,7 @@ impl_eq! { Cow<'a, str>, &'b str }
 impl_eq! { Cow<'a, str>, String }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl const Default for String {
     /// Creates an empty `String`.
     #[inline]
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 9dac58bac4f..1df6ab672ea 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -3895,7 +3895,7 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec<T, A> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T> const Default for Vec<T> {
     /// Creates an empty `Vec<T>`.
     ///
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index c53a2b2beb4..d6d1bf2effa 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -333,7 +333,7 @@ impl<T: Copy> Clone for Cell<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T: ~const Default> const Default for Cell<T> {
     /// Creates a `Cell<T>`, with the `Default` value for T.
     #[inline]
@@ -1324,7 +1324,7 @@ impl<T: Clone> Clone for RefCell<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T: ~const Default> const Default for RefCell<T> {
     /// Creates a `RefCell<T>`, with the `Default` value for T.
     #[inline]
@@ -2332,7 +2332,7 @@ impl<T: ?Sized> UnsafeCell<T> {
 }
 
 #[stable(feature = "unsafe_cell_default", since = "1.10.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T: ~const Default> const Default for UnsafeCell<T> {
     /// Creates an `UnsafeCell`, with the `Default` value for T.
     fn default() -> UnsafeCell<T> {
@@ -2437,7 +2437,7 @@ impl<T: ?Sized> SyncUnsafeCell<T> {
 }
 
 #[unstable(feature = "sync_unsafe_cell", issue = "95439")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T: ~const Default> const Default for SyncUnsafeCell<T> {
     /// Creates an `SyncUnsafeCell`, with the `Default` value for T.
     fn default() -> SyncUnsafeCell<T> {
diff --git a/library/core/src/default.rs b/library/core/src/default.rs
index 4d108b0c18e..897267968aa 100644
--- a/library/core/src/default.rs
+++ b/library/core/src/default.rs
@@ -104,7 +104,7 @@ use crate::ascii::Char as AsciiChar;
 #[rustc_diagnostic_item = "Default"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[const_trait]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 pub trait Default: Sized {
     /// Returns the "default value" for a type.
     ///
@@ -151,7 +151,7 @@ pub macro Default($item:item) {
 macro_rules! default_impl {
     ($t:ty, $v:expr, $doc:tt) => {
         #[stable(feature = "rust1", since = "1.0.0")]
-        #[rustc_const_unstable(feature = "const_default", issue = "67792")]
+        #[rustc_const_unstable(feature = "const_default", issue = "143894")]
         impl const Default for $t {
             #[inline(always)]
             #[doc = $doc]
diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs
index c2e4b751c65..1ece3d9bd5e 100644
--- a/library/core/src/intrinsics/mod.rs
+++ b/library/core/src/intrinsics/mod.rs
@@ -910,7 +910,7 @@ pub const unsafe fn arith_offset<T>(dst: *const T, offset: isize) -> *const T;
 /// # Safety
 ///
 /// - `index < PtrMetadata(slice_ptr)`, so the indexing is in-bounds for the slice
-/// - the resulting offsetting is in-bounds of the allocated object, which is
+/// - the resulting offsetting is in-bounds of the allocation, which is
 ///   always the case for references, but needs to be upheld manually for pointers
 #[rustc_nounwind]
 #[rustc_intrinsic]
diff --git a/library/core/src/io/borrowed_buf.rs b/library/core/src/io/borrowed_buf.rs
index 854e03cf182..b5dfe6dbd71 100644
--- a/library/core/src/io/borrowed_buf.rs
+++ b/library/core/src/io/borrowed_buf.rs
@@ -69,6 +69,23 @@ impl<'data> From<&'data mut [MaybeUninit<u8>]> for BorrowedBuf<'data> {
     }
 }
 
+/// Creates a new `BorrowedBuf` from a cursor.
+///
+/// Use `BorrowedCursor::with_unfilled_buf` instead for a safer alternative.
+impl<'data> From<BorrowedCursor<'data>> for BorrowedBuf<'data> {
+    #[inline]
+    fn from(mut buf: BorrowedCursor<'data>) -> BorrowedBuf<'data> {
+        let init = buf.init_mut().len();
+        BorrowedBuf {
+            // SAFETY: no initialized byte is ever uninitialized as per
+            // `BorrowedBuf`'s invariant
+            buf: unsafe { buf.buf.buf.get_unchecked_mut(buf.buf.filled..) },
+            filled: 0,
+            init,
+        }
+    }
+}
+
 impl<'data> BorrowedBuf<'data> {
     /// Returns the total capacity of the buffer.
     #[inline]
@@ -353,4 +370,38 @@ impl<'a> BorrowedCursor<'a> {
         }
         self.buf.filled += buf.len();
     }
+
+    /// Runs the given closure with a `BorrowedBuf` containing the unfilled part
+    /// of the cursor.
+    ///
+    /// This enables inspecting what was written to the cursor.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the `BorrowedBuf` given to the closure is replaced by another
+    /// one.
+    pub fn with_unfilled_buf<T>(&mut self, f: impl FnOnce(&mut BorrowedBuf<'_>) -> T) -> T {
+        let mut buf = BorrowedBuf::from(self.reborrow());
+        let prev_ptr = buf.buf as *const _;
+        let res = f(&mut buf);
+
+        // Check that the caller didn't replace the `BorrowedBuf`.
+        // This is necessary for the safety of the code below: if the check wasn't
+        // there, one could mark some bytes as initialized even though there aren't.
+        assert!(core::ptr::addr_eq(prev_ptr, buf.buf));
+
+        let filled = buf.filled;
+        let init = buf.init;
+
+        // Update `init` and `filled` fields with what was written to the buffer.
+        // `self.buf.filled` was the starting length of the `BorrowedBuf`.
+        //
+        // SAFETY: These amounts of bytes were initialized/filled in the `BorrowedBuf`,
+        // and therefore they are initialized/filled in the cursor too, because the
+        // buffer wasn't replaced.
+        self.buf.init = self.buf.filled + init;
+        self.buf.filled += filled;
+
+        res
+    }
 }
diff --git a/library/core/src/iter/sources/empty.rs b/library/core/src/iter/sources/empty.rs
index 309962ab70c..1844c76e5df 100644
--- a/library/core/src/iter/sources/empty.rs
+++ b/library/core/src/iter/sources/empty.rs
@@ -81,7 +81,7 @@ impl<T> Clone for Empty<T> {
 // not #[derive] because that adds a Default bound on T,
 // which isn't necessary.
 #[stable(feature = "iter_empty", since = "1.2.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T> const Default for Empty<T> {
     fn default() -> Empty<T> {
         Empty(marker::PhantomData)
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index 6531d3ec766..45277a1c82d 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -863,7 +863,7 @@ impl<T: PointeeSized> Clone for PhantomData<T> {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T: PointeeSized> const Default for PhantomData<T> {
     fn default() -> Self {
         Self
diff --git a/library/core/src/ops/function.rs b/library/core/src/ops/function.rs
index 763b60d88e5..efc751a094d 100644
--- a/library/core/src/ops/function.rs
+++ b/library/core/src/ops/function.rs
@@ -73,7 +73,7 @@ use crate::marker::Tuple;
 #[fundamental] // so that regex can rely that `&str: !FnMut`
 #[must_use = "closures are lazy and do nothing unless called"]
 #[const_trait]
-#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+#[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
 pub trait Fn<Args: Tuple>: FnMut<Args> {
     /// Performs the call operation.
     #[unstable(feature = "fn_traits", issue = "29625")]
@@ -161,7 +161,7 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
 #[fundamental] // so that regex can rely that `&str: !FnMut`
 #[must_use = "closures are lazy and do nothing unless called"]
 #[const_trait]
-#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+#[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
 pub trait FnMut<Args: Tuple>: FnOnce<Args> {
     /// Performs the call operation.
     #[unstable(feature = "fn_traits", issue = "29625")]
@@ -241,7 +241,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
 #[fundamental] // so that regex can rely that `&str: !FnMut`
 #[must_use = "closures are lazy and do nothing unless called"]
 #[const_trait]
-#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+#[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
 pub trait FnOnce<Args: Tuple> {
     /// The returned type after the call operator is used.
     #[lang = "fn_once_output"]
@@ -257,7 +257,7 @@ mod impls {
     use crate::marker::Tuple;
 
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+    #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
     impl<A: Tuple, F: ?Sized> const Fn<A> for &F
     where
         F: ~const Fn<A>,
@@ -268,7 +268,7 @@ mod impls {
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+    #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
     impl<A: Tuple, F: ?Sized> const FnMut<A> for &F
     where
         F: ~const Fn<A>,
@@ -279,7 +279,7 @@ mod impls {
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+    #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
     impl<A: Tuple, F: ?Sized> const FnOnce<A> for &F
     where
         F: ~const Fn<A>,
@@ -292,7 +292,7 @@ mod impls {
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+    #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
     impl<A: Tuple, F: ?Sized> const FnMut<A> for &mut F
     where
         F: ~const FnMut<A>,
@@ -303,7 +303,7 @@ mod impls {
     }
 
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
+    #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")]
     impl<A: Tuple, F: ?Sized> const FnOnce<A> for &mut F
     where
         F: ~const FnMut<A>,
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 4ede273feda..9f432758a66 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -2112,7 +2112,7 @@ where
 impl<T> crate::clone::UseCloned for Option<T> where T: crate::clone::UseCloned {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T> const Default for Option<T> {
     /// Returns [`None`][Option::None].
     ///
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs
index 2c77c55745b..5bd80149a1d 100644
--- a/library/core/src/primitive_docs.rs
+++ b/library/core/src/primitive_docs.rs
@@ -1081,13 +1081,11 @@ mod prim_str {}
 /// * [`Debug`]
 /// * [`Default`]
 /// * [`Hash`]
-/// * [`Random`]
 /// * [`From<[T; N]>`][from]
 ///
 /// [from]: convert::From
 /// [`Debug`]: fmt::Debug
 /// [`Hash`]: hash::Hash
-/// [`Random`]: random::Random
 ///
 /// The following traits are implemented for tuples of any length. These traits have
 /// implementations that are automatically generated by the compiler, so are not limited by
diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs
index 304cde05af9..6d473a4bd56 100644
--- a/library/core/src/ptr/alignment.rs
+++ b/library/core/src/ptr/alignment.rs
@@ -230,7 +230,7 @@ impl hash::Hash for Alignment {
 
 /// Returns [`Alignment::MIN`], which is valid for any type.
 #[unstable(feature = "ptr_alignment_type", issue = "102070")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl const Default for Alignment {
     fn default() -> Alignment {
         Alignment::MIN
diff --git a/library/core/src/ptr/docs/add.md b/library/core/src/ptr/docs/add.md
index ae7c7785684..6e2e87f5f81 100644
--- a/library/core/src/ptr/docs/add.md
+++ b/library/core/src/ptr/docs/add.md
@@ -19,7 +19,7 @@ If any of the following conditions are violated, the result is Undefined Behavio
 bounds of that allocation. In particular, this range must not "wrap around" the edge
 of the address space.
 
-Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
+Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
 stays in bounds of the allocation, it is guaranteed to satisfy the first requirement.
 This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
 safe.
diff --git a/library/core/src/ptr/docs/offset.md b/library/core/src/ptr/docs/offset.md
index f2e335a79a5..f04f5606ab2 100644
--- a/library/core/src/ptr/docs/offset.md
+++ b/library/core/src/ptr/docs/offset.md
@@ -16,7 +16,7 @@ bounds of that allocation. In particular, this range must not "wrap around" the
 of the address space. Note that "range" here refers to a half-open range as usual in Rust,
 i.e., `self..result` for non-negative offsets and `result..self` for negative offsets.
 
-Allocated objects can never be larger than `isize::MAX` bytes, so if the computed offset
+Allocations can never be larger than `isize::MAX` bytes, so if the computed offset
 stays in bounds of the allocation, it is guaranteed to satisfy the first requirement.
 This implies, for instance, that `vec.as_ptr().add(vec.len())` (for `vec: Vec<T>`) is always
 safe.
diff --git a/library/core/src/random.rs b/library/core/src/random.rs
index 051fe260863..8a51fb289d8 100644
--- a/library/core/src/random.rs
+++ b/library/core/src/random.rs
@@ -1,48 +1,46 @@
 //! Random value generation.
-//!
-//! The [`Random`] trait allows generating a random value for a type using a
-//! given [`RandomSource`].
+
+use crate::range::RangeFull;
 
 /// A source of randomness.
 #[unstable(feature = "random", issue = "130703")]
 pub trait RandomSource {
     /// Fills `bytes` with random bytes.
+    ///
+    /// Note that calling `fill_bytes` multiple times is not equivalent to calling `fill_bytes` once
+    /// with a larger buffer. A `RandomSource` is allowed to return different bytes for those two
+    /// cases. For instance, this allows a `RandomSource` to generate a word at a time and throw
+    /// part of it away if not needed.
     fn fill_bytes(&mut self, bytes: &mut [u8]);
 }
 
-/// A trait for getting a random value for a type.
-///
-/// **Warning:** Be careful when manipulating random values! The
-/// [`random`](Random::random) method on integers samples them with a uniform
-/// distribution, so a value of 1 is just as likely as [`i32::MAX`]. By using
-/// modulo operations, some of the resulting values can become more likely than
-/// others. Use audited crates when in doubt.
+/// A trait representing a distribution of random values for a type.
 #[unstable(feature = "random", issue = "130703")]
-pub trait Random: Sized {
-    /// Generates a random value.
-    fn random(source: &mut (impl RandomSource + ?Sized)) -> Self;
+pub trait Distribution<T> {
+    /// Samples a random value from the distribution, using the specified random source.
+    fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> T;
+}
+
+impl<T, DT: Distribution<T>> Distribution<T> for &DT {
+    fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> T {
+        (*self).sample(source)
+    }
 }
 
-impl Random for bool {
-    fn random(source: &mut (impl RandomSource + ?Sized)) -> Self {
-        u8::random(source) & 1 == 1
+impl Distribution<bool> for RangeFull {
+    fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> bool {
+        let byte: u8 = RangeFull.sample(source);
+        byte & 1 == 1
     }
 }
 
 macro_rules! impl_primitive {
     ($t:ty) => {
-        impl Random for $t {
-            /// Generates a random value.
-            ///
-            /// **Warning:** Be careful when manipulating the resulting value! This
-            /// method samples according to a uniform distribution, so a value of 1 is
-            /// just as likely as [`MAX`](Self::MAX). By using modulo operations, some
-            /// values can become more likely than others. Use audited crates when in
-            /// doubt.
-            fn random(source: &mut (impl RandomSource + ?Sized)) -> Self {
-                let mut bytes = (0 as Self).to_ne_bytes();
+        impl Distribution<$t> for RangeFull {
+            fn sample(&self, source: &mut (impl RandomSource + ?Sized)) -> $t {
+                let mut bytes = (0 as $t).to_ne_bytes();
                 source.fill_bytes(&mut bytes);
-                Self::from_ne_bytes(bytes)
+                <$t>::from_ne_bytes(bytes)
             }
         }
     };
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 58b7e9a9fdf..abcba5a621e 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -5192,7 +5192,7 @@ where
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T> const Default for &[T] {
     /// Creates an empty slice.
     fn default() -> Self {
@@ -5201,7 +5201,7 @@ impl<T> const Default for &[T] {
 }
 
 #[stable(feature = "mut_slice_default", since = "1.5.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl<T> const Default for &mut [T] {
     /// Creates a mutable empty slice.
     fn default() -> Self {
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs
index 32a22988175..fba3436496e 100644
--- a/library/core/src/str/mod.rs
+++ b/library/core/src/str/mod.rs
@@ -3072,7 +3072,7 @@ impl AsRef<[u8]> for str {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl const Default for &str {
     /// Creates an empty str
     #[inline]
@@ -3082,7 +3082,7 @@ impl const Default for &str {
 }
 
 #[stable(feature = "default_mut_str", since = "1.28.0")]
-#[rustc_const_unstable(feature = "const_default", issue = "67792")]
+#[rustc_const_unstable(feature = "const_default", issue = "143894")]
 impl const Default for &mut str {
     /// Creates an empty mutable str
     #[inline]
diff --git a/library/core/src/tuple.rs b/library/core/src/tuple.rs
index 9cf08e74ff6..23a0a6877df 100644
--- a/library/core/src/tuple.rs
+++ b/library/core/src/tuple.rs
@@ -3,7 +3,6 @@
 use crate::cmp::Ordering::{self, *};
 use crate::marker::{ConstParamTy_, StructuralPartialEq, UnsizedConstParamTy};
 use crate::ops::ControlFlow::{self, Break, Continue};
-use crate::random::{Random, RandomSource};
 
 // Recursive macro for implementing n-ary tuple functions and operations
 //
@@ -133,16 +132,6 @@ macro_rules! tuple_impls {
 
         maybe_tuple_doc! {
             $($T)+ @
-            #[unstable(feature = "random", issue = "130703")]
-            impl<$($T: Random),+> Random for ($($T,)+) {
-                fn random(source: &mut (impl RandomSource + ?Sized)) -> Self {
-                    ($({ let x: $T = Random::random(source); x},)+)
-                }
-            }
-        }
-
-        maybe_tuple_doc! {
-            $($T)+ @
             #[stable(feature = "array_tuple_conv", since = "1.71.0")]
             impl<T> From<[T; ${count($T)}]> for ($(${ignore($T)} T,)+) {
                 #[inline]
diff --git a/library/coretests/tests/io/borrowed_buf.rs b/library/coretests/tests/io/borrowed_buf.rs
index fbd3864dcac..73dbfaf5ee9 100644
--- a/library/coretests/tests/io/borrowed_buf.rs
+++ b/library/coretests/tests/io/borrowed_buf.rs
@@ -165,3 +165,39 @@ fn cursor_set_init() {
     assert_eq!(rbuf.unfilled().uninit_mut().len(), 4);
     assert_eq!(unsafe { rbuf.unfilled().as_mut().len() }, 12);
 }
+
+#[test]
+fn cursor_with_unfilled_buf() {
+    let buf: &mut [_] = &mut [MaybeUninit::uninit(); 16];
+    let mut rbuf = BorrowedBuf::from(buf);
+    let mut cursor = rbuf.unfilled();
+
+    cursor.with_unfilled_buf(|buf| {
+        buf.unfilled().append(&[1, 2, 3]);
+        assert_eq!(buf.filled(), &[1, 2, 3]);
+    });
+
+    assert_eq!(cursor.init_mut().len(), 0);
+    assert_eq!(cursor.written(), 3);
+
+    cursor.with_unfilled_buf(|buf| {
+        assert_eq!(buf.capacity(), 13);
+        assert_eq!(buf.init_len(), 0);
+
+        buf.unfilled().ensure_init();
+        buf.unfilled().advance(4);
+    });
+
+    assert_eq!(cursor.init_mut().len(), 9);
+    assert_eq!(cursor.written(), 7);
+
+    cursor.with_unfilled_buf(|buf| {
+        assert_eq!(buf.capacity(), 9);
+        assert_eq!(buf.init_len(), 9);
+    });
+
+    assert_eq!(cursor.init_mut().len(), 9);
+    assert_eq!(cursor.written(), 7);
+
+    assert_eq!(rbuf.filled(), &[1, 2, 3, 0, 0, 0, 0]);
+}
diff --git a/library/std/src/random.rs b/library/std/src/random.rs
index e7d4ab81df0..3994c5cfaf6 100644
--- a/library/std/src/random.rs
+++ b/library/std/src/random.rs
@@ -1,7 +1,4 @@
 //! Random value generation.
-//!
-//! The [`Random`] trait allows generating a random value for a type using a
-//! given [`RandomSource`].
 
 #[unstable(feature = "random", issue = "130703")]
 pub use core::random::*;
@@ -68,18 +65,11 @@ impl RandomSource for DefaultRandomSource {
     }
 }
 
-/// Generates a random value with the default random source.
+/// Generates a random value from a distribution, using the default random source.
 ///
-/// This is a convenience function for `T::random(&mut DefaultRandomSource)` and
-/// will sample according to the same distribution as the underlying [`Random`]
-/// trait implementation. See [`DefaultRandomSource`] for more information about
-/// how randomness is sourced.
-///
-/// **Warning:** Be careful when manipulating random values! The
-/// [`random`](Random::random) method on integers samples them with a uniform
-/// distribution, so a value of 1 is just as likely as [`i32::MAX`]. By using
-/// modulo operations, some of the resulting values can become more likely than
-/// others. Use audited crates when in doubt.
+/// This is a convenience function for `dist.sample(&mut DefaultRandomSource)` and will sample
+/// according to the same distribution as the underlying [`Distribution`] trait implementation. See
+/// [`DefaultRandomSource`] for more information about how randomness is sourced.
 ///
 /// # Examples
 ///
@@ -89,7 +79,7 @@ impl RandomSource for DefaultRandomSource {
 ///
 /// use std::random::random;
 ///
-/// let bits: u128 = random();
+/// let bits: u128 = random(..);
 /// let g1 = (bits >> 96) as u32;
 /// let g2 = (bits >> 80) as u16;
 /// let g3 = (0x4000 | (bits >> 64) & 0x0fff) as u16;
@@ -101,6 +91,6 @@ impl RandomSource for DefaultRandomSource {
 ///
 /// [version 4/variant 1 UUID]: https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)
 #[unstable(feature = "random", issue = "130703")]
-pub fn random<T: Random>() -> T {
-    T::random(&mut DefaultRandomSource)
+pub fn random<T>(dist: impl Distribution<T>) -> T {
+    dist.sample(&mut DefaultRandomSource)
 }
diff --git a/library/std/src/sys/net/connection/socket/windows.rs b/library/std/src/sys/net/connection/socket/windows.rs
index ce975bb2289..b71d8b1357b 100644
--- a/library/std/src/sys/net/connection/socket/windows.rs
+++ b/library/std/src/sys/net/connection/socket/windows.rs
@@ -8,7 +8,8 @@ use crate::net::{Shutdown, SocketAddr};
 use crate::os::windows::io::{
     AsRawSocket, AsSocket, BorrowedSocket, FromRawSocket, IntoRawSocket, OwnedSocket, RawSocket,
 };
-use crate::sync::OnceLock;
+use crate::sync::atomic::Atomic;
+use crate::sync::atomic::Ordering::{AcqRel, Relaxed};
 use crate::sys::c;
 use crate::sys_common::{AsInner, FromInner, IntoInner};
 use crate::time::Duration;
@@ -114,33 +115,38 @@ pub(super) mod netc {
 #[expect(missing_debug_implementations)]
 pub struct Socket(OwnedSocket);
 
-static WSA_CLEANUP: OnceLock<unsafe extern "system" fn() -> i32> = OnceLock::new();
+static WSA_INITIALIZED: Atomic<bool> = Atomic::<bool>::new(false);
 
 /// Checks whether the Windows socket interface has been started already, and
 /// if not, starts it.
+#[inline]
 pub fn init() {
-    let _ = WSA_CLEANUP.get_or_init(|| unsafe {
+    if !WSA_INITIALIZED.load(Relaxed) {
+        wsa_startup();
+    }
+}
+
+#[cold]
+fn wsa_startup() {
+    unsafe {
         let mut data: c::WSADATA = mem::zeroed();
         let ret = c::WSAStartup(
             0x202, // version 2.2
             &mut data,
         );
         assert_eq!(ret, 0);
-
-        // Only register `WSACleanup` if `WSAStartup` is actually ever called.
-        // Workaround to prevent linking to `WS2_32.dll` when no network functionality is used.
-        // See issue #85441.
-        c::WSACleanup
-    });
+        if WSA_INITIALIZED.swap(true, AcqRel) {
+            // If another thread raced with us and called WSAStartup first then call
+            // WSACleanup so it's as though WSAStartup was only called once.
+            c::WSACleanup();
+        }
+    }
 }
 
 pub fn cleanup() {
-    // only perform cleanup if network functionality was actually initialized
-    if let Some(cleanup) = WSA_CLEANUP.get() {
-        unsafe {
-            cleanup();
-        }
-    }
+    // We don't need to call WSACleanup here because exiting the process will cause
+    // the OS to clean everything for us, which is faster than doing it manually.
+    // See #141799.
 }
 
 /// Returns the last error from the Windows socket interface.
diff --git a/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs b/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs
index cbdaf439b28..dea44124f45 100644
--- a/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs
+++ b/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs
@@ -2,7 +2,7 @@ use crate::cmp;
 use crate::io::{
     BorrowedCursor, Error as IoError, ErrorKind, IoSlice, IoSliceMut, Result as IoResult,
 };
-use crate::random::{DefaultRandomSource, Random};
+use crate::random::random;
 use crate::time::{Duration, Instant};
 
 pub(crate) mod alloc;
@@ -179,7 +179,7 @@ pub fn wait(event_mask: u64, mut timeout: u64) -> IoResult<u64> {
         // trusted to ensure accurate timeouts.
         if let Ok(timeout_signed) = i64::try_from(timeout) {
             let tenth = timeout_signed / 10;
-            let deviation = i64::random(&mut DefaultRandomSource).checked_rem(tenth).unwrap_or(0);
+            let deviation = random::<i64>(..).checked_rem(tenth).unwrap_or(0);
             timeout = timeout_signed.saturating_add(deviation) as _;
         }
     }
diff --git a/library/std/src/sys/sync/once/futex.rs b/library/std/src/sys/sync/once/futex.rs
index 539f0fe89ea..407fdcebcf5 100644
--- a/library/std/src/sys/sync/once/futex.rs
+++ b/library/std/src/sys/sync/once/futex.rs
@@ -8,16 +8,18 @@ use crate::sys::futex::{Futex, Primitive, futex_wait, futex_wake_all};
 // This means we only need one atomic value with 4 states:
 
 /// No initialization has run yet, and no thread is currently using the Once.
-const INCOMPLETE: Primitive = 0;
+const INCOMPLETE: Primitive = 3;
 /// Some thread has previously attempted to initialize the Once, but it panicked,
 /// so the Once is now poisoned. There are no other threads currently accessing
 /// this Once.
-const POISONED: Primitive = 1;
+const POISONED: Primitive = 2;
 /// Some thread is currently attempting to run initialization. It may succeed,
 /// so all future threads need to wait for it to finish.
-const RUNNING: Primitive = 2;
+const RUNNING: Primitive = 1;
 /// Initialization has completed and all future calls should finish immediately.
-const COMPLETE: Primitive = 3;
+/// By choosing this state as the all-zero state the `is_completed` check can be
+/// a bit faster on some platforms.
+const COMPLETE: Primitive = 0;
 
 // An additional bit indicates whether there are waiting threads:
 
diff --git a/library/std/src/sys/sync/once/queue.rs b/library/std/src/sys/sync/once/queue.rs
index 6a2ab0dcf1b..49e15d65f25 100644
--- a/library/std/src/sys/sync/once/queue.rs
+++ b/library/std/src/sys/sync/once/queue.rs
@@ -74,11 +74,12 @@ pub struct OnceState {
 }
 
 // Four states that a Once can be in, encoded into the lower bits of
-// `state_and_queue` in the Once structure.
-const INCOMPLETE: usize = 0x0;
-const POISONED: usize = 0x1;
-const RUNNING: usize = 0x2;
-const COMPLETE: usize = 0x3;
+// `state_and_queue` in the Once structure. By choosing COMPLETE as the all-zero
+// state the `is_completed` check can be a bit faster on some platforms.
+const INCOMPLETE: usize = 0x3;
+const POISONED: usize = 0x2;
+const RUNNING: usize = 0x1;
+const COMPLETE: usize = 0x0;
 
 // Mask to learn about the state. All other bits are the queue of waiters if
 // this is in the RUNNING state.
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 1282a89a5e4..09bb2e35bda 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -2400,10 +2400,10 @@ pub fn run_cargo(
                 keep = true;
             } else if rlib_only_metadata {
                 if filename.contains("jemalloc_sys")
-                    || filename.contains("rustc_smir")
-                    || filename.contains("stable_mir")
+                    || filename.contains("rustc_public_bridge")
+                    || filename.contains("rustc_public")
                 {
-                    // jemalloc_sys and rustc_smir are not linked into librustc_driver.so,
+                    // jemalloc_sys and rustc_public_bridge are not linked into librustc_driver.so,
                     // so we need to distribute them as rlib to be able to use them.
                     keep |= filename.ends_with(".rlib");
                 } else {
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 5de1b472d79..814a44b9a13 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -9,6 +9,7 @@
 //! Each Rust tool **MUST** utilize `ToolBuild` inside their `Step` logic,
 //! return `ToolBuildResult` and should never prepare `cargo` invocations manually.
 
+use std::ffi::OsStr;
 use std::path::PathBuf;
 use std::{env, fs};
 
@@ -136,19 +137,6 @@ impl Step for ToolBuild {
             _ => panic!("unexpected Mode for tool build"),
         }
 
-        // build.tool.TOOL_NAME.features in bootstrap.toml allows specifying which features to
-        // enable for a specific tool. `extra_features` instead is not controlled by the toml and
-        // provides features that are always enabled for a specific tool (e.g. "in-rust-tree" for
-        // rust-analyzer). Finally, `prepare_tool_cargo` might add more features to adapt the build
-        // to the chosen flags (e.g. "all-static" for cargo if `cargo_native_static` is true).
-        let mut features = builder
-            .config
-            .tool
-            .get(self.tool)
-            .and_then(|tool| tool.features.clone())
-            .unwrap_or_default();
-        features.extend(self.extra_features.clone());
-
         let mut cargo = prepare_tool_cargo(
             builder,
             self.compiler,
@@ -157,7 +145,7 @@ impl Step for ToolBuild {
             Kind::Build,
             path,
             self.source_type,
-            &features,
+            &self.extra_features,
         );
 
         // The stage0 compiler changes infrequently and does not directly depend on code
@@ -244,7 +232,8 @@ pub fn prepare_tool_cargo(
 ) -> CargoCommand {
     let mut cargo = builder::Cargo::new(builder, compiler, mode, source_type, target, cmd_kind);
 
-    let dir = builder.src.join(path);
+    let path = PathBuf::from(path);
+    let dir = builder.src.join(&path);
     cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
 
     let mut features = extra_features.to_vec();
@@ -261,6 +250,18 @@ pub fn prepare_tool_cargo(
         }
     }
 
+    // build.tool.TOOL_NAME.features in bootstrap.toml allows specifying which features to enable
+    // for a specific tool. `extra_features` instead is not controlled by the toml and provides
+    // features that are always enabled for a specific tool (e.g. "in-rust-tree" for rust-analyzer).
+    // Finally, `prepare_tool_cargo` above here might add more features to adapt the build
+    // to the chosen flags (e.g. "all-static" for cargo if `cargo_native_static` is true).
+    builder
+        .config
+        .tool
+        .iter()
+        .filter(|(tool_name, _)| path.file_name().and_then(OsStr::to_str) == Some(tool_name))
+        .for_each(|(_, tool)| features.extend(tool.features.clone().unwrap_or_default()));
+
     // clippy tests need to know about the stage sysroot. Set them consistently while building to
     // avoid rebuilding when running tests.
     cargo.env("SYSROOT", builder.sysroot(compiler));
@@ -1140,6 +1141,7 @@ macro_rules! tool_extended {
             stable: $stable:expr
             $( , add_bins_to_sysroot: $add_bins_to_sysroot:expr )?
             $( , add_features: $add_features:expr )?
+            $( , cargo_args: $cargo_args:expr )?
             $( , )?
         }
     ) => {
@@ -1180,6 +1182,7 @@ macro_rules! tool_extended {
                     $path,
                     None $( .or(Some(&$add_bins_to_sysroot)) )?,
                     None $( .or(Some($add_features)) )?,
+                    None $( .or(Some($cargo_args)) )?,
                 )
             }
 
@@ -1219,6 +1222,7 @@ fn should_run_tool_build_step<'a>(
     )
 }
 
+#[expect(clippy::too_many_arguments)] // silence overeager clippy lint
 fn run_tool_build_step(
     builder: &Builder<'_>,
     compiler: Compiler,
@@ -1227,6 +1231,7 @@ fn run_tool_build_step(
     path: &'static str,
     add_bins_to_sysroot: Option<&[&str]>,
     add_features: Option<fn(&Builder<'_>, TargetSelection, &mut Vec<String>)>,
+    cargo_args: Option<&[&'static str]>,
 ) -> ToolBuildResult {
     let mut extra_features = Vec::new();
     if let Some(func) = add_features {
@@ -1243,7 +1248,7 @@ fn run_tool_build_step(
             extra_features,
             source_type: SourceType::InTree,
             allow_features: "",
-            cargo_args: vec![],
+            cargo_args: cargo_args.unwrap_or_default().iter().map(|s| String::from(*s)).collect(),
             artifact_kind: ToolArtifactKind::Binary,
         });
 
@@ -1294,7 +1299,9 @@ tool_extended!(Miri {
     path: "src/tools/miri",
     tool_name: "miri",
     stable: false,
-    add_bins_to_sysroot: ["miri"]
+    add_bins_to_sysroot: ["miri"],
+    // Always compile also tests when building miri. Otherwise feature unification can cause rebuilds between building and testing miri.
+    cargo_args: &["--all-targets"],
 });
 tool_extended!(CargoMiri {
     path: "src/tools/miri/cargo-miri",
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index 4d606953d99..7115c5a1cbe 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -1044,6 +1044,7 @@ impl<'a> Builder<'a> {
             Kind::Test => describe!(
                 crate::core::build_steps::toolstate::ToolStateCheck,
                 test::Tidy,
+                test::Bootstrap,
                 test::Ui,
                 test::Crashes,
                 test::Coverage,
@@ -1098,8 +1099,6 @@ impl<'a> Builder<'a> {
                 test::RustInstaller,
                 test::TestFloatParse,
                 test::CollectLicenseMetadata,
-                // Run bootstrap close to the end as it's unlikely to fail
-                test::Bootstrap,
                 // Run run-make last, since these won't pass without make on Windows
                 test::RunMake,
             ),
diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
index c5d460ac55b..1f6ed8129da 100644
--- a/src/bootstrap/src/utils/change_tracker.rs
+++ b/src/bootstrap/src/utils/change_tracker.rs
@@ -471,4 +471,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
         severity: ChangeSeverity::Info,
         summary: "A --compile-time-deps flag has been added to reduce the time it takes rust-analyzer to start",
     },
+    ChangeInfo {
+        change_id: 143733,
+        severity: ChangeSeverity::Info,
+        summary: "Option `tool.TOOL_NAME.features` now works on any subcommand, not just `build`.",
+    },
 ];
diff --git a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md
index b05318ce9e6..4f44cf1701c 100644
--- a/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md
+++ b/src/doc/rustc-dev-guide/src/rustdoc-internals/rustdoc-test-suite.md
@@ -55,6 +55,9 @@ Similar to shell commands,
 directives can extend across multiple lines if their last char is `\`.
 In this case, the start of the next line should be `//`, with no `@`.
 
+Similar to compiletest directives, besides a space you can also use a colon `:` to separate
+the directive name and the arguments, however a space is preferred for HtmlDocCk directives.
+
 Use the special string `{{channel}}` in XPaths, `PATTERN` arguments and [snapshot files](#snapshot)
 if you'd like to refer to the URL `https://doc.rust-lang.org/CHANNEL` where `CHANNEL` refers to the
 current release channel (e.g, `stable` or `nightly`).
diff --git a/src/etc/htmldocck.py b/src/etc/htmldocck.py
index ddbd256a0d8..72975cc6206 100755
--- a/src/etc/htmldocck.py
+++ b/src/etc/htmldocck.py
@@ -147,48 +147,17 @@ def concat_multi_lines(f):
         print_err(lineno, line, "Trailing backslash at the end of the file")
 
 
-def get_known_directive_names():
-    def filter_line(line):
-        line = line.strip()
-        return line.startswith('"') and (line.endswith('",') or line.endswith('"'))
-
-    # Equivalent to `src/tools/compiletest/src/header.rs` constant of the same name.
-    with open(
-        os.path.join(
-            # We go back to `src`.
-            os.path.dirname(os.path.dirname(__file__)),
-            "tools/compiletest/src/directive-list.rs",
-        ),
-        "r",
-        encoding="utf8",
-    ) as fd:
-        content = fd.read()
-        return [
-            line.strip().replace('",', "").replace('"', "")
-            for line in content.split("\n")
-            if filter_line(line)
-        ]
-
-
-# To prevent duplicating the list of commmands between `compiletest` and `htmldocck`, we put
-# it into a common file which is included in rust code and parsed here.
-# FIXME: This setup is temporary until we figure out how to improve this situation.
-#        See <https://github.com/rust-lang/rust/issues/125813#issuecomment-2141953780>.
-KNOWN_DIRECTIVE_NAMES = get_known_directive_names()
-
 LINE_PATTERN = re.compile(
     r"""
     //@\s+
-    (?P<negated>!?)(?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)
-    (?P<args>.*)$
+    (?P<negated>!?)(?P<cmd>.+?)
+    (?:[\s:](?P<args>.*))?$
 """,
     re.X | re.UNICODE,
 )
 
 DEPRECATED_LINE_PATTERN = re.compile(
-    r"""
-    //\s+@
-""",
+    r"//\s+@",
     re.X | re.UNICODE,
 )
 
@@ -209,12 +178,7 @@ def get_commands(template):
 
             cmd = m.group("cmd")
             negated = m.group("negated") == "!"
-            if not negated and cmd in KNOWN_DIRECTIVE_NAMES:
-                continue
-            args = m.group("args")
-            if args and not args[:1].isspace():
-                print_err(lineno, line, "Invalid template syntax")
-                continue
+            args = m.group("args") or ""
             try:
                 args = shlex.split(args)
             except UnicodeEncodeError:
@@ -636,14 +600,11 @@ def check_command(c, cache):
             else:
                 raise InvalidCheck("Invalid number of {} arguments".format(c.cmd))
 
-        elif c.cmd == "valid-html":
-            raise InvalidCheck("Unimplemented valid-html")
-
-        elif c.cmd == "valid-links":
-            raise InvalidCheck("Unimplemented valid-links")
-
         else:
-            raise InvalidCheck("Unrecognized {}".format(c.cmd))
+            # Ignore unknown directives as they might be compiletest directives
+            # since they share the same `//@` prefix by convention. In any case,
+            # compiletest rejects unknown directives for us.
+            return
 
         if ret == c.negated:
             raise FailedCheck(cerr)
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index a05aab22f1e..3ecd41db2dd 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -796,6 +796,9 @@ impl Item {
                             }
                             Some(format!("#[target_feature({output})]"))
                         }
+                        hir::Attribute::Parsed(AttributeKind::AutomaticallyDerived(..)) => {
+                            Some("#[automatically_derived]".to_string())
+                        }
                         _ => Some({
                             let mut s = rustc_hir_pretty::attribute_to_string(&tcx, attr);
                             assert_eq!(s.pop(), Some('\n'));
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 6a1fad06ae3..70f3f54e4c0 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -980,7 +980,7 @@ fn assoc_method(
     let name = meth.name.as_ref().unwrap();
     let vis = visibility_print_with_space(meth, cx).to_string();
     let defaultness = print_default_space(meth.is_default());
-    // FIXME: Once https://github.com/rust-lang/rust/issues/67792 is implemented, we can remove
+    // FIXME: Once https://github.com/rust-lang/rust/issues/143874 is implemented, we can remove
     // this condition.
     let constness = match render_mode {
         RenderMode::Normal => print_constness_with_space(
@@ -2152,7 +2152,7 @@ fn render_rightside(
     let tcx = cx.tcx();
 
     fmt::from_fn(move |w| {
-        // FIXME: Once https://github.com/rust-lang/rust/issues/67792 is implemented, we can remove
+        // FIXME: Once https://github.com/rust-lang/rust/issues/143874 is implemented, we can remove
         // this condition.
         let const_stability = match render_mode {
             RenderMode::Normal => item.const_stability(tcx),
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 99f0e0531688a822a753cc585b7408b069cb682
+Subproject d3c793b025645a4565ac59aceb30d2d116ff1a4
diff --git a/src/tools/clippy/clippy_lints/src/format_args.rs b/src/tools/clippy/clippy_lints/src/format_args.rs
index 0c39aae9ca9..16c58ecb455 100644
--- a/src/tools/clippy/clippy_lints/src/format_args.rs
+++ b/src/tools/clippy/clippy_lints/src/format_args.rs
@@ -30,6 +30,7 @@ use rustc_span::edition::Edition::Edition2021;
 use rustc_span::{Span, Symbol, sym};
 use rustc_trait_selection::infer::TyCtxtInferExt;
 use rustc_trait_selection::traits::{Obligation, ObligationCause, Selection, SelectionContext};
+use rustc_attr_data_structures::{AttributeKind, find_attr};
 
 declare_clippy_lint! {
     /// ### What it does
@@ -656,7 +657,7 @@ impl<'tcx> FormatArgsExpr<'_, 'tcx> {
                     };
                     let selection = SelectionContext::new(&infcx).select(&obligation);
                     let derived = if let Ok(Some(Selection::UserDefined(data))) = selection {
-                        tcx.has_attr(data.impl_def_id, sym::automatically_derived)
+                        find_attr!(tcx.get_all_attrs(data.impl_def_id), AttributeKind::AutomaticallyDerived(..))
                     } else {
                         false
                     };
diff --git a/src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs b/src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs
index a1dacd359a0..88b099c477f 100644
--- a/src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs
+++ b/src/tools/clippy/clippy_lints_internal/src/derive_deserialize_allowing_unknown.rs
@@ -88,7 +88,7 @@ impl<'tcx> LateLintPass<'tcx> for DeriveDeserializeAllowingUnknown {
         }
 
         // Is it derived?
-        if !cx.tcx.has_attr(item.owner_id, sym::automatically_derived) {
+        if !find_attr!(cx.tcx.get_all_attrs(item.owner_id), AttributeKind::AutomaticallyDerived(..)) {
             return;
         }
 
diff --git a/src/tools/clippy/clippy_test_deps/Cargo.lock b/src/tools/clippy/clippy_test_deps/Cargo.lock
new file mode 100644
index 00000000000..a591dae3a1a
--- /dev/null
+++ b/src/tools/clippy/clippy_test_deps/Cargo.lock
@@ -0,0 +1,505 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "addr2line"
+version = "0.24.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
+dependencies = [
+ "gimli",
+]
+
+[[package]]
+name = "adler2"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
+
+[[package]]
+name = "backtrace"
+version = "0.3.75"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
+dependencies = [
+ "addr2line",
+ "cfg-if",
+ "libc",
+ "miniz_oxide",
+ "object",
+ "rustc-demangle",
+ "windows-targets",
+]
+
+[[package]]
+name = "bitflags"
+version = "2.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
+
+[[package]]
+name = "bytes"
+version = "1.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
+
+[[package]]
+name = "clippy_test_deps"
+version = "0.1.0"
+dependencies = [
+ "futures",
+ "if_chain",
+ "itertools",
+ "parking_lot",
+ "quote",
+ "regex",
+ "serde",
+ "syn",
+ "tokio",
+]
+
+[[package]]
+name = "either"
+version = "1.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
+
+[[package]]
+name = "futures"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
+
+[[package]]
+name = "futures-task"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
+
+[[package]]
+name = "futures-util"
+version = "0.3.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "slab",
+]
+
+[[package]]
+name = "gimli"
+version = "0.31.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
+
+[[package]]
+name = "if_chain"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed"
+
+[[package]]
+name = "io-uring"
+version = "0.7.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013"
+dependencies = [
+ "bitflags",
+ "cfg-if",
+ "libc",
+]
+
+[[package]]
+name = "itertools"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.174"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
+
+[[package]]
+name = "lock_api"
+version = "0.4.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "memchr"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
+
+[[package]]
+name = "miniz_oxide"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
+dependencies = [
+ "adler2",
+]
+
+[[package]]
+name = "mio"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
+dependencies = [
+ "libc",
+ "wasi",
+ "windows-sys",
+]
+
+[[package]]
+name = "object"
+version = "0.36.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "smallvec",
+ "windows-targets",
+]
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.95"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.40"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.5.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "regex"
+version = "1.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
+
+[[package]]
+name = "rustc-demangle"
+version = "0.1.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "serde"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.219"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "slab"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
+
+[[package]]
+name = "smallvec"
+version = "1.15.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
+
+[[package]]
+name = "syn"
+version = "2.0.104"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "tokio"
+version = "1.46.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
+dependencies = [
+ "backtrace",
+ "bytes",
+ "io-uring",
+ "libc",
+ "mio",
+ "pin-project-lite",
+ "slab",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+
+[[package]]
+name = "wasi"
+version = "0.11.1+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
diff --git a/src/tools/clippy/clippy_test_deps/Cargo.toml b/src/tools/clippy/clippy_test_deps/Cargo.toml
index f41334f0ade..a23ffcaf2f9 100644
--- a/src/tools/clippy/clippy_test_deps/Cargo.toml
+++ b/src/tools/clippy/clippy_test_deps/Cargo.toml
@@ -15,3 +15,6 @@ futures = "0.3"
 parking_lot = "0.12"
 tokio = { version = "1", features = ["io-util"] }
 itertools = "0.12"
+
+# Make sure we are not part of the rustc workspace.
+[workspace]
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs
index 54de9baeb12..ad8c816e204 100644
--- a/src/tools/clippy/clippy_utils/src/lib.rs
+++ b/src/tools/clippy/clippy_utils/src/lib.rs
@@ -1785,9 +1785,9 @@ pub fn in_automatically_derived(tcx: TyCtxt<'_>, id: HirId) -> bool {
     tcx.hir_parent_owner_iter(id)
         .filter(|(_, node)| matches!(node, OwnerNode::Item(item) if matches!(item.kind, ItemKind::Impl(_))))
         .any(|(id, _)| {
-            has_attr(
+            find_attr!(
                 tcx.hir_attrs(tcx.local_def_id_to_hir_id(id.def_id)),
-                sym::automatically_derived,
+                AttributeKind::AutomaticallyDerived(..)
             )
         })
 }
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
index 849f44031b7..33da1a25db1 100644
--- a/src/tools/compiletest/src/common.rs
+++ b/src/tools/compiletest/src/common.rs
@@ -53,6 +53,32 @@ impl TestMode {
     }
 }
 
+// Note that coverage tests use the same test files for multiple test modes.
+string_enum! {
+    #[derive(Clone, Copy, PartialEq, Debug)]
+    pub enum TestSuite {
+        Assembly => "assembly",
+        Codegen => "codegen",
+        CodegenUnits => "codegen-units",
+        Coverage => "coverage",
+        CoverageRunRustdoc => "coverage-run-rustdoc",
+        Crashes => "crashes",
+        Debuginfo => "debuginfo",
+        Incremental => "incremental",
+        MirOpt => "mir-opt",
+        Pretty => "pretty",
+        RunMake => "run-make",
+        Rustdoc => "rustdoc",
+        RustdocGui => "rustdoc-gui",
+        RustdocJs => "rustdoc-js",
+        RustdocJsStd=> "rustdoc-js-std",
+        RustdocJson => "rustdoc-json",
+        RustdocUi => "rustdoc-ui",
+        Ui => "ui",
+        UiFullDeps => "ui-fulldeps",
+    }
+}
+
 string_enum! {
     #[derive(Clone, Copy, PartialEq, Debug, Hash)]
     pub enum PassMode {
@@ -276,15 +302,13 @@ pub struct Config {
 
     /// The test suite.
     ///
-    /// Example: `tests/ui/` is the "UI" test *suite*, which happens to also be of the
+    /// Example: `tests/ui/` is [`TestSuite::Ui`] test *suite*, which happens to also be of the
     /// [`TestMode::Ui`] test *mode*.
     ///
-    /// Note that the same test directory (e.g. `tests/coverage/`) may correspond to multiple test
+    /// Note that the same test suite (e.g. `tests/coverage/`) may correspond to multiple test
     /// modes, e.g. `tests/coverage/` can be run under both [`TestMode::CoverageRun`] and
     /// [`TestMode::CoverageMap`].
-    ///
-    /// FIXME: stop using stringly-typed test suites!
-    pub suite: String,
+    pub suite: TestSuite,
 
     /// When specified, **only** the specified [`Debugger`] will be used to run against the
     /// `tests/debuginfo` test suite. When unspecified, `compiletest` will attempt to find all three
@@ -537,8 +561,8 @@ pub struct Config {
     // Configuration for various run-make tests frobbing things like C compilers or querying about
     // various LLVM component information.
     //
-    // FIXME: this really should be better packaged together. FIXME: these need better docs, e.g.
-    // for *host*, or for *target*?
+    // FIXME: this really should be better packaged together.
+    // FIXME: these need better docs, e.g. for *host*, or for *target*?
     pub cc: String,
     pub cxx: String,
     pub cflags: String,
@@ -617,6 +641,8 @@ impl Config {
         // For instance, `//@ ignore-stage1` will not work at all.
         Config {
             mode: TestMode::Rustdoc,
+            // E.g. this has no sensible default tbh.
+            suite: TestSuite::Ui,
 
             // Dummy values.
             edition: Default::default(),
@@ -642,7 +668,6 @@ impl Config {
             sysroot_base: Utf8PathBuf::default(),
             stage: Default::default(),
             stage_id: String::default(),
-            suite: Default::default(),
             debugger: Default::default(),
             run_ignored: Default::default(),
             with_rustc_debug_assertions: Default::default(),
diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs
deleted file mode 100644
index adf2a7bffef..00000000000
--- a/src/tools/compiletest/src/directive-list.rs
+++ /dev/null
@@ -1,260 +0,0 @@
-/// This was originally generated by collecting directives from ui tests and then extracting their
-/// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is
-/// a best-effort approximation for diagnostics. Add new directives to this list when needed.
-const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
-    // tidy-alphabetical-start
-    "add-core-stubs",
-    "assembly-output",
-    "aux-bin",
-    "aux-build",
-    "aux-codegen-backend",
-    "aux-crate",
-    "build-aux-docs",
-    "build-fail",
-    "build-pass",
-    "check-fail",
-    "check-pass",
-    "check-run-results",
-    "check-stdout",
-    "check-test-line-numbers-match",
-    "compile-flags",
-    "doc-flags",
-    "dont-check-compiler-stderr",
-    "dont-check-compiler-stdout",
-    "dont-check-failure-status",
-    "dont-require-annotations",
-    "edition",
-    "error-pattern",
-    "exact-llvm-major-version",
-    "exec-env",
-    "failure-status",
-    "filecheck-flags",
-    "forbid-output",
-    "force-host",
-    "ignore-16bit",
-    "ignore-32bit",
-    "ignore-64bit",
-    "ignore-aarch64",
-    "ignore-aarch64-pc-windows-msvc",
-    "ignore-aarch64-unknown-linux-gnu",
-    "ignore-aix",
-    "ignore-android",
-    "ignore-apple",
-    "ignore-arm",
-    "ignore-arm-unknown-linux-gnueabi",
-    "ignore-arm-unknown-linux-gnueabihf",
-    "ignore-arm-unknown-linux-musleabi",
-    "ignore-arm-unknown-linux-musleabihf",
-    "ignore-auxiliary",
-    "ignore-avr",
-    "ignore-beta",
-    "ignore-cdb",
-    "ignore-compare-mode-next-solver",
-    "ignore-compare-mode-polonius",
-    "ignore-coverage-map",
-    "ignore-coverage-run",
-    "ignore-cross-compile",
-    "ignore-eabi",
-    "ignore-elf",
-    "ignore-emscripten",
-    "ignore-endian-big",
-    "ignore-enzyme",
-    "ignore-freebsd",
-    "ignore-fuchsia",
-    "ignore-gdb",
-    "ignore-gdb-version",
-    "ignore-gnu",
-    "ignore-haiku",
-    "ignore-horizon",
-    "ignore-i686-pc-windows-gnu",
-    "ignore-i686-pc-windows-msvc",
-    "ignore-illumos",
-    "ignore-ios",
-    "ignore-linux",
-    "ignore-lldb",
-    "ignore-llvm-version",
-    "ignore-loongarch32",
-    "ignore-loongarch64",
-    "ignore-macabi",
-    "ignore-macos",
-    "ignore-msp430",
-    "ignore-msvc",
-    "ignore-musl",
-    "ignore-netbsd",
-    "ignore-nightly",
-    "ignore-none",
-    "ignore-nto",
-    "ignore-nvptx64",
-    "ignore-nvptx64-nvidia-cuda",
-    "ignore-openbsd",
-    "ignore-pass",
-    "ignore-powerpc",
-    "ignore-remote",
-    "ignore-riscv64",
-    "ignore-rustc-debug-assertions",
-    "ignore-rustc_abi-x86-sse2",
-    "ignore-s390x",
-    "ignore-sgx",
-    "ignore-sparc64",
-    "ignore-spirv",
-    "ignore-stable",
-    "ignore-stage1",
-    "ignore-stage2",
-    "ignore-std-debug-assertions",
-    "ignore-test",
-    "ignore-thumb",
-    "ignore-thumbv8m.base-none-eabi",
-    "ignore-thumbv8m.main-none-eabi",
-    "ignore-tvos",
-    "ignore-unix",
-    "ignore-unknown",
-    "ignore-uwp",
-    "ignore-visionos",
-    "ignore-vxworks",
-    "ignore-wasi",
-    "ignore-wasm",
-    "ignore-wasm32",
-    "ignore-wasm32-bare",
-    "ignore-wasm64",
-    "ignore-watchos",
-    "ignore-windows",
-    "ignore-windows-gnu",
-    "ignore-windows-msvc",
-    "ignore-x32",
-    "ignore-x86",
-    "ignore-x86_64",
-    "ignore-x86_64-apple-darwin",
-    "ignore-x86_64-pc-windows-gnu",
-    "ignore-x86_64-unknown-linux-gnu",
-    "incremental",
-    "known-bug",
-    "llvm-cov-flags",
-    "max-llvm-major-version",
-    "min-cdb-version",
-    "min-gdb-version",
-    "min-lldb-version",
-    "min-llvm-version",
-    "min-system-llvm-version",
-    "needs-asm-support",
-    "needs-crate-type",
-    "needs-deterministic-layouts",
-    "needs-dlltool",
-    "needs-dynamic-linking",
-    "needs-enzyme",
-    "needs-force-clang-based-tests",
-    "needs-git-hash",
-    "needs-llvm-components",
-    "needs-llvm-zstd",
-    "needs-profiler-runtime",
-    "needs-relocation-model-pic",
-    "needs-run-enabled",
-    "needs-rust-lld",
-    "needs-rustc-debug-assertions",
-    "needs-sanitizer-address",
-    "needs-sanitizer-cfi",
-    "needs-sanitizer-dataflow",
-    "needs-sanitizer-hwaddress",
-    "needs-sanitizer-kcfi",
-    "needs-sanitizer-leak",
-    "needs-sanitizer-memory",
-    "needs-sanitizer-memtag",
-    "needs-sanitizer-safestack",
-    "needs-sanitizer-shadow-call-stack",
-    "needs-sanitizer-support",
-    "needs-sanitizer-thread",
-    "needs-std-debug-assertions",
-    "needs-subprocess",
-    "needs-symlink",
-    "needs-target-has-atomic",
-    "needs-target-std",
-    "needs-threads",
-    "needs-unwind",
-    "needs-wasmtime",
-    "needs-xray",
-    "no-auto-check-cfg",
-    "no-prefer-dynamic",
-    "normalize-stderr",
-    "normalize-stderr-32bit",
-    "normalize-stderr-64bit",
-    "normalize-stdout",
-    "only-16bit",
-    "only-32bit",
-    "only-64bit",
-    "only-aarch64",
-    "only-aarch64-apple-darwin",
-    "only-aarch64-unknown-linux-gnu",
-    "only-apple",
-    "only-arm",
-    "only-avr",
-    "only-beta",
-    "only-bpf",
-    "only-cdb",
-    "only-dist",
-    "only-elf",
-    "only-emscripten",
-    "only-gnu",
-    "only-i686-pc-windows-gnu",
-    "only-i686-pc-windows-msvc",
-    "only-i686-unknown-linux-gnu",
-    "only-ios",
-    "only-linux",
-    "only-loongarch32",
-    "only-loongarch64",
-    "only-loongarch64-unknown-linux-gnu",
-    "only-macos",
-    "only-mips",
-    "only-mips64",
-    "only-msp430",
-    "only-msvc",
-    "only-nightly",
-    "only-nvptx64",
-    "only-powerpc",
-    "only-riscv64",
-    "only-rustc_abi-x86-sse2",
-    "only-s390x",
-    "only-sparc",
-    "only-sparc64",
-    "only-stable",
-    "only-thumb",
-    "only-tvos",
-    "only-unix",
-    "only-visionos",
-    "only-wasm32",
-    "only-wasm32-bare",
-    "only-wasm32-wasip1",
-    "only-watchos",
-    "only-windows",
-    "only-windows-gnu",
-    "only-windows-msvc",
-    "only-x86",
-    "only-x86_64",
-    "only-x86_64-apple-darwin",
-    "only-x86_64-fortanix-unknown-sgx",
-    "only-x86_64-pc-windows-gnu",
-    "only-x86_64-pc-windows-msvc",
-    "only-x86_64-unknown-linux-gnu",
-    "pp-exact",
-    "pretty-compare-only",
-    "pretty-mode",
-    "proc-macro",
-    "reference",
-    "regex-error-pattern",
-    "remap-src-base",
-    "revisions",
-    "run-fail",
-    "run-flags",
-    "run-pass",
-    "run-rustfix",
-    "rustc-env",
-    "rustfix-only-machine-applicable",
-    "should-fail",
-    "should-ice",
-    "stderr-per-bitwidth",
-    "test-mir-pass",
-    "unique-doc-out-dir",
-    "unset-exec-env",
-    "unset-rustc-env",
-    // Used by the tidy check `unknown_revision`.
-    "unused-revision-names",
-    // tidy-alphabetical-end
-];
diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs
index 7fadb4dae2a..6bf968a3132 100644
--- a/src/tools/compiletest/src/directives.rs
+++ b/src/tools/compiletest/src/directives.rs
@@ -56,7 +56,6 @@ impl EarlyProps {
         let mut poisoned = false;
         iter_directives(
             config.mode,
-            &config.suite,
             &mut poisoned,
             testfile,
             rdr,
@@ -349,7 +348,6 @@ impl TestProps {
 
             iter_directives(
                 config.mode,
-                &config.suite,
                 &mut poisoned,
                 testfile,
                 file,
@@ -765,11 +763,266 @@ fn line_directive<'line>(
     Some(DirectiveLine { line_number, revision, raw_directive })
 }
 
-// To prevent duplicating the list of directives between `compiletest`,`htmldocck` and `jsondocck`,
-// we put it into a common file which is included in rust code and parsed here.
-// FIXME: This setup is temporary until we figure out how to improve this situation.
-//        See <https://github.com/rust-lang/rust/issues/125813#issuecomment-2141953780>.
-include!("directive-list.rs");
+/// This was originally generated by collecting directives from ui tests and then extracting their
+/// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is
+/// a best-effort approximation for diagnostics. Add new directives to this list when needed.
+const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
+    // tidy-alphabetical-start
+    "add-core-stubs",
+    "assembly-output",
+    "aux-bin",
+    "aux-build",
+    "aux-codegen-backend",
+    "aux-crate",
+    "build-aux-docs",
+    "build-fail",
+    "build-pass",
+    "check-fail",
+    "check-pass",
+    "check-run-results",
+    "check-stdout",
+    "check-test-line-numbers-match",
+    "compile-flags",
+    "doc-flags",
+    "dont-check-compiler-stderr",
+    "dont-check-compiler-stdout",
+    "dont-check-failure-status",
+    "dont-require-annotations",
+    "edition",
+    "error-pattern",
+    "exact-llvm-major-version",
+    "exec-env",
+    "failure-status",
+    "filecheck-flags",
+    "forbid-output",
+    "force-host",
+    "ignore-16bit",
+    "ignore-32bit",
+    "ignore-64bit",
+    "ignore-aarch64",
+    "ignore-aarch64-pc-windows-msvc",
+    "ignore-aarch64-unknown-linux-gnu",
+    "ignore-aix",
+    "ignore-android",
+    "ignore-apple",
+    "ignore-arm",
+    "ignore-arm-unknown-linux-gnueabi",
+    "ignore-arm-unknown-linux-gnueabihf",
+    "ignore-arm-unknown-linux-musleabi",
+    "ignore-arm-unknown-linux-musleabihf",
+    "ignore-auxiliary",
+    "ignore-avr",
+    "ignore-beta",
+    "ignore-cdb",
+    "ignore-compare-mode-next-solver",
+    "ignore-compare-mode-polonius",
+    "ignore-coverage-map",
+    "ignore-coverage-run",
+    "ignore-cross-compile",
+    "ignore-eabi",
+    "ignore-elf",
+    "ignore-emscripten",
+    "ignore-endian-big",
+    "ignore-enzyme",
+    "ignore-freebsd",
+    "ignore-fuchsia",
+    "ignore-gdb",
+    "ignore-gdb-version",
+    "ignore-gnu",
+    "ignore-haiku",
+    "ignore-horizon",
+    "ignore-i686-pc-windows-gnu",
+    "ignore-i686-pc-windows-msvc",
+    "ignore-illumos",
+    "ignore-ios",
+    "ignore-linux",
+    "ignore-lldb",
+    "ignore-llvm-version",
+    "ignore-loongarch32",
+    "ignore-loongarch64",
+    "ignore-macabi",
+    "ignore-macos",
+    "ignore-msp430",
+    "ignore-msvc",
+    "ignore-musl",
+    "ignore-netbsd",
+    "ignore-nightly",
+    "ignore-none",
+    "ignore-nto",
+    "ignore-nvptx64",
+    "ignore-nvptx64-nvidia-cuda",
+    "ignore-openbsd",
+    "ignore-pass",
+    "ignore-powerpc",
+    "ignore-remote",
+    "ignore-riscv64",
+    "ignore-rustc-debug-assertions",
+    "ignore-rustc_abi-x86-sse2",
+    "ignore-s390x",
+    "ignore-sgx",
+    "ignore-sparc64",
+    "ignore-spirv",
+    "ignore-stable",
+    "ignore-stage1",
+    "ignore-stage2",
+    "ignore-std-debug-assertions",
+    "ignore-test",
+    "ignore-thumb",
+    "ignore-thumbv8m.base-none-eabi",
+    "ignore-thumbv8m.main-none-eabi",
+    "ignore-tvos",
+    "ignore-unix",
+    "ignore-unknown",
+    "ignore-uwp",
+    "ignore-visionos",
+    "ignore-vxworks",
+    "ignore-wasi",
+    "ignore-wasm",
+    "ignore-wasm32",
+    "ignore-wasm32-bare",
+    "ignore-wasm64",
+    "ignore-watchos",
+    "ignore-windows",
+    "ignore-windows-gnu",
+    "ignore-windows-msvc",
+    "ignore-x32",
+    "ignore-x86",
+    "ignore-x86_64",
+    "ignore-x86_64-apple-darwin",
+    "ignore-x86_64-pc-windows-gnu",
+    "ignore-x86_64-unknown-linux-gnu",
+    "incremental",
+    "known-bug",
+    "llvm-cov-flags",
+    "max-llvm-major-version",
+    "min-cdb-version",
+    "min-gdb-version",
+    "min-lldb-version",
+    "min-llvm-version",
+    "min-system-llvm-version",
+    "needs-asm-support",
+    "needs-crate-type",
+    "needs-deterministic-layouts",
+    "needs-dlltool",
+    "needs-dynamic-linking",
+    "needs-enzyme",
+    "needs-force-clang-based-tests",
+    "needs-git-hash",
+    "needs-llvm-components",
+    "needs-llvm-zstd",
+    "needs-profiler-runtime",
+    "needs-relocation-model-pic",
+    "needs-run-enabled",
+    "needs-rust-lld",
+    "needs-rustc-debug-assertions",
+    "needs-sanitizer-address",
+    "needs-sanitizer-cfi",
+    "needs-sanitizer-dataflow",
+    "needs-sanitizer-hwaddress",
+    "needs-sanitizer-kcfi",
+    "needs-sanitizer-leak",
+    "needs-sanitizer-memory",
+    "needs-sanitizer-memtag",
+    "needs-sanitizer-safestack",
+    "needs-sanitizer-shadow-call-stack",
+    "needs-sanitizer-support",
+    "needs-sanitizer-thread",
+    "needs-std-debug-assertions",
+    "needs-subprocess",
+    "needs-symlink",
+    "needs-target-has-atomic",
+    "needs-target-std",
+    "needs-threads",
+    "needs-unwind",
+    "needs-wasmtime",
+    "needs-xray",
+    "no-auto-check-cfg",
+    "no-prefer-dynamic",
+    "normalize-stderr",
+    "normalize-stderr-32bit",
+    "normalize-stderr-64bit",
+    "normalize-stdout",
+    "only-16bit",
+    "only-32bit",
+    "only-64bit",
+    "only-aarch64",
+    "only-aarch64-apple-darwin",
+    "only-aarch64-unknown-linux-gnu",
+    "only-apple",
+    "only-arm",
+    "only-avr",
+    "only-beta",
+    "only-bpf",
+    "only-cdb",
+    "only-dist",
+    "only-elf",
+    "only-emscripten",
+    "only-gnu",
+    "only-i686-pc-windows-gnu",
+    "only-i686-pc-windows-msvc",
+    "only-i686-unknown-linux-gnu",
+    "only-ios",
+    "only-linux",
+    "only-loongarch32",
+    "only-loongarch64",
+    "only-loongarch64-unknown-linux-gnu",
+    "only-macos",
+    "only-mips",
+    "only-mips64",
+    "only-msp430",
+    "only-msvc",
+    "only-nightly",
+    "only-nvptx64",
+    "only-powerpc",
+    "only-riscv64",
+    "only-rustc_abi-x86-sse2",
+    "only-s390x",
+    "only-sparc",
+    "only-sparc64",
+    "only-stable",
+    "only-thumb",
+    "only-tvos",
+    "only-unix",
+    "only-visionos",
+    "only-wasm32",
+    "only-wasm32-bare",
+    "only-wasm32-wasip1",
+    "only-watchos",
+    "only-windows",
+    "only-windows-gnu",
+    "only-windows-msvc",
+    "only-x86",
+    "only-x86_64",
+    "only-x86_64-apple-darwin",
+    "only-x86_64-fortanix-unknown-sgx",
+    "only-x86_64-pc-windows-gnu",
+    "only-x86_64-pc-windows-msvc",
+    "only-x86_64-unknown-linux-gnu",
+    "pp-exact",
+    "pretty-compare-only",
+    "pretty-mode",
+    "proc-macro",
+    "reference",
+    "regex-error-pattern",
+    "remap-src-base",
+    "revisions",
+    "run-fail",
+    "run-flags",
+    "run-pass",
+    "run-rustfix",
+    "rustc-env",
+    "rustfix-only-machine-applicable",
+    "should-fail",
+    "should-ice",
+    "stderr-per-bitwidth",
+    "test-mir-pass",
+    "unique-doc-out-dir",
+    "unset-exec-env",
+    "unset-rustc-env",
+    // Used by the tidy check `unknown_revision`.
+    "unused-revision-names",
+    // tidy-alphabetical-end
+];
 
 const KNOWN_HTMLDOCCK_DIRECTIVE_NAMES: &[&str] = &[
     "count",
@@ -834,42 +1087,32 @@ pub(crate) struct CheckDirectiveResult<'ln> {
 pub(crate) fn check_directive<'a>(
     directive_ln: &'a str,
     mode: TestMode,
-    original_line: &str,
 ) -> CheckDirectiveResult<'a> {
     let (directive_name, post) = directive_ln.split_once([':', ' ']).unwrap_or((directive_ln, ""));
 
+    let is_known_directive = KNOWN_DIRECTIVE_NAMES.contains(&directive_name)
+        || match mode {
+            TestMode::Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
+            TestMode::RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES.contains(&directive_name),
+            _ => false,
+        };
+
     let trailing = post.trim().split_once(' ').map(|(pre, _)| pre).unwrap_or(post);
-    let is_known = |s: &str| {
-        KNOWN_DIRECTIVE_NAMES.contains(&s)
-            || match mode {
-                TestMode::Rustdoc | TestMode::RustdocJson => {
-                    original_line.starts_with("//@")
-                        && match mode {
-                            TestMode::Rustdoc => KNOWN_HTMLDOCCK_DIRECTIVE_NAMES,
-                            TestMode::RustdocJson => KNOWN_JSONDOCCK_DIRECTIVE_NAMES,
-                            _ => unreachable!(),
-                        }
-                        .contains(&s)
-                }
-                _ => false,
-            }
-    };
     let trailing_directive = {
         // 1. is the directive name followed by a space? (to exclude `:`)
-        matches!(directive_ln.get(directive_name.len()..), Some(s) if s.starts_with(' '))
+        directive_ln.get(directive_name.len()..).is_some_and(|s| s.starts_with(' '))
             // 2. is what is after that directive also a directive (ex: "only-x86 only-arm")
-            && is_known(trailing)
+            && KNOWN_DIRECTIVE_NAMES.contains(&trailing)
     }
     .then_some(trailing);
 
-    CheckDirectiveResult { is_known_directive: is_known(&directive_name), trailing_directive }
+    CheckDirectiveResult { is_known_directive, trailing_directive }
 }
 
 const COMPILETEST_DIRECTIVE_PREFIX: &str = "//@";
 
 fn iter_directives(
     mode: TestMode,
-    _suite: &str,
     poisoned: &mut bool,
     testfile: &Utf8Path,
     rdr: impl Read,
@@ -914,9 +1157,9 @@ fn iter_directives(
         };
 
         // Perform unknown directive check on Rust files.
-        if testfile.extension().map(|e| e == "rs").unwrap_or(false) {
+        if testfile.extension() == Some("rs") {
             let CheckDirectiveResult { is_known_directive, trailing_directive } =
-                check_directive(directive_line.raw_directive, mode, ln);
+                check_directive(directive_line.raw_directive, mode);
 
             if !is_known_directive {
                 *poisoned = true;
@@ -936,7 +1179,7 @@ fn iter_directives(
                     "{testfile}:{line_number}: detected trailing compiletest test directive `{}`",
                     trailing_directive,
                 );
-                help!("put the trailing directive in it's own line: `//@ {}`", trailing_directive);
+                help!("put the trailing directive in its own line: `//@ {}`", trailing_directive);
 
                 return;
             }
@@ -1388,7 +1631,6 @@ pub(crate) fn make_test_description<R: Read>(
     // Scan through the test file to handle `ignore-*`, `only-*`, and `needs-*` directives.
     iter_directives(
         config.mode,
-        &config.suite,
         &mut local_poisoned,
         path,
         src,
diff --git a/src/tools/compiletest/src/directives/tests.rs b/src/tools/compiletest/src/directives/tests.rs
index 9c5751b416b..5682cc57b6f 100644
--- a/src/tools/compiletest/src/directives/tests.rs
+++ b/src/tools/compiletest/src/directives/tests.rs
@@ -785,7 +785,7 @@ fn threads_support() {
 
 fn run_path(poisoned: &mut bool, path: &Utf8Path, buf: &[u8]) {
     let rdr = std::io::Cursor::new(&buf);
-    iter_directives(TestMode::Ui, "ui", poisoned, path, rdr, &mut |_| {});
+    iter_directives(TestMode::Ui, poisoned, path, rdr, &mut |_| {});
 }
 
 #[test]
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index be82f8cb480..f3b3605a120 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -360,7 +360,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
         stage_id: matches.opt_str("stage-id").unwrap(),
 
         mode,
-        suite: matches.opt_str("suite").unwrap(),
+        suite: matches.opt_str("suite").unwrap().parse().expect("invalid suite"),
         debugger: matches.opt_str("debugger").map(|debugger| {
             debugger
                 .parse::<Debugger>()
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 12111e9c6ef..cb8f593c9df 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -16,9 +16,9 @@ use regex::{Captures, Regex};
 use tracing::*;
 
 use crate::common::{
-    CompareMode, Config, Debugger, FailMode, PassMode, TestMode, TestPaths, UI_EXTENSIONS,
-    UI_FIXED, UI_RUN_STDERR, UI_RUN_STDOUT, UI_STDERR, UI_STDOUT, UI_SVG, UI_WINDOWS_SVG,
-    expected_output_path, incremental_dir, output_base_dir, output_base_name,
+    CompareMode, Config, Debugger, FailMode, PassMode, TestMode, TestPaths, TestSuite,
+    UI_EXTENSIONS, UI_FIXED, UI_RUN_STDERR, UI_RUN_STDOUT, UI_STDERR, UI_STDOUT, UI_SVG,
+    UI_WINDOWS_SVG, expected_output_path, incremental_dir, output_base_dir, output_base_name,
     output_testname_unique,
 };
 use crate::compute_diff::{DiffLine, make_diff, write_diff, write_filtered_diff};
@@ -1494,7 +1494,10 @@ impl<'test> TestCx<'test> {
     }
 
     fn is_rustdoc(&self) -> bool {
-        matches!(self.config.suite.as_str(), "rustdoc-ui" | "rustdoc-js" | "rustdoc-json")
+        matches!(
+            self.config.suite,
+            TestSuite::RustdocUi | TestSuite::RustdocJs | TestSuite::RustdocJson
+        )
     }
 
     fn make_compile_args(
diff --git a/src/tools/compiletest/src/runtest/coverage.rs b/src/tools/compiletest/src/runtest/coverage.rs
index 38f0e956474..d0a0c960b45 100644
--- a/src/tools/compiletest/src/runtest/coverage.rs
+++ b/src/tools/compiletest/src/runtest/coverage.rs
@@ -6,7 +6,7 @@ use std::process::Command;
 use camino::{Utf8Path, Utf8PathBuf};
 use glob::glob;
 
-use crate::common::{UI_COVERAGE, UI_COVERAGE_MAP};
+use crate::common::{TestSuite, UI_COVERAGE, UI_COVERAGE_MAP};
 use crate::runtest::{Emit, ProcRes, TestCx, WillExecute};
 use crate::util::static_regex;
 
@@ -91,7 +91,7 @@ impl<'test> TestCx<'test> {
         let mut profraw_paths = vec![profraw_path];
         let mut bin_paths = vec![self.make_exe_name()];
 
-        if self.config.suite == "coverage-run-rustdoc" {
+        if self.config.suite == TestSuite::CoverageRunRustdoc {
             self.run_doctests_for_coverage(&mut profraw_paths, &mut bin_paths);
         }
 
diff --git a/src/tools/compiletest/src/runtest/rustdoc.rs b/src/tools/compiletest/src/runtest/rustdoc.rs
index 637ea833357..236f021ce82 100644
--- a/src/tools/compiletest/src/runtest/rustdoc.rs
+++ b/src/tools/compiletest/src/runtest/rustdoc.rs
@@ -4,7 +4,7 @@ use super::{TestCx, remove_and_create_dir_all};
 
 impl TestCx<'_> {
     pub(super) fn run_rustdoc_test(&self) {
-        assert!(self.revision.is_none(), "revisions not relevant here");
+        assert!(self.revision.is_none(), "revisions not supported in this test suite");
 
         let out_dir = self.output_base_dir();
         remove_and_create_dir_all(&out_dir).unwrap_or_else(|e| {
diff --git a/src/tools/compiletest/src/runtest/rustdoc_json.rs b/src/tools/compiletest/src/runtest/rustdoc_json.rs
index 9f88faca892..4f35efedfde 100644
--- a/src/tools/compiletest/src/runtest/rustdoc_json.rs
+++ b/src/tools/compiletest/src/runtest/rustdoc_json.rs
@@ -6,7 +6,7 @@ impl TestCx<'_> {
     pub(super) fn run_rustdoc_json_test(&self) {
         //FIXME: Add bless option.
 
-        assert!(self.revision.is_none(), "revisions not relevant here");
+        assert!(self.revision.is_none(), "revisions not supported in this test suite");
 
         let out_dir = self.output_base_dir();
         remove_and_create_dir_all(&out_dir).unwrap_or_else(|e| {
diff --git a/src/tools/jsondocck/src/directive.rs b/src/tools/jsondocck/src/directive.rs
index fdb2fa6dbbe..c52c1686660 100644
--- a/src/tools/jsondocck/src/directive.rs
+++ b/src/tools/jsondocck/src/directive.rs
@@ -105,13 +105,10 @@ impl DirectiveKind {
                 [_path, value] => Self::HasNotValue { value: value.clone() },
                 _ => panic!("`//@ !has` must have 2 or 3 arguments, but got {args:?}"),
             },
-            // Ignore compiletest directives, like //@ edition
-            (_, false) if KNOWN_DIRECTIVE_NAMES.contains(&directive_name) => {
-                return None;
-            }
-            _ => {
-                panic!("Invalid directive `//@ {}{directive_name}`", if negated { "!" } else { "" })
-            }
+            // Ignore unknown directives as they might be compiletest directives
+            // since they share the same `//@` prefix by convention. In any case,
+            // compiletest rejects unknown directives for us.
+            _ => return None,
         };
 
         Some((kind, &args[0]))
@@ -216,10 +213,6 @@ fn get_one<'a>(matches: &[&'a Value]) -> Result<&'a Value, String> {
     }
 }
 
-// FIXME: This setup is temporary until we figure out how to improve this situation.
-//        See <https://github.com/rust-lang/rust/issues/125813#issuecomment-2141953780>.
-include!(concat!(env!("CARGO_MANIFEST_DIR"), "/../compiletest/src/directive-list.rs"));
-
 fn string_to_value<'a>(s: &str, cache: &'a Cache) -> Cow<'a, Value> {
     if s.starts_with("$") {
         Cow::Borrowed(&cache.variables.get(&s[1..]).unwrap_or_else(|| {
diff --git a/src/tools/jsondocck/src/main.rs b/src/tools/jsondocck/src/main.rs
index d84be4d3a3a..c3487565c23 100644
--- a/src/tools/jsondocck/src/main.rs
+++ b/src/tools/jsondocck/src/main.rs
@@ -47,8 +47,8 @@ static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
         ^\s*
         //@\s+
         (?P<negated>!?)
-        (?P<directive>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)
-        (?P<args>.*)$
+        (?P<directive>.+?)
+        (?:[\s:](?P<args>.*))?$
     "#,
     )
     .ignore_whitespace(true)
@@ -58,15 +58,7 @@ static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
 });
 
 static DEPRECATED_LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
-    RegexBuilder::new(
-        r#"
-        //\s+@
-    "#,
-    )
-    .ignore_whitespace(true)
-    .unicode(true)
-    .build()
-    .unwrap()
+    RegexBuilder::new(r"//\s+@").ignore_whitespace(true).unicode(true).build().unwrap()
 });
 
 fn print_err(msg: &str, lineno: usize) {
@@ -94,7 +86,7 @@ fn get_directives(template: &str) -> Result<Vec<Directive>, ()> {
 
         let negated = &cap["negated"] == "!";
 
-        let args_str = &cap["args"];
+        let args_str = cap.name("args").map(|m| m.as_str()).unwrap_or_default();
         let Some(args) = shlex::split(args_str) else {
             print_err(&format!("Invalid arguments to shlex::split: `{args_str}`",), lineno);
             errors = true;
diff --git a/src/tools/miri/test_dependencies/Cargo.toml b/src/tools/miri/test_dependencies/Cargo.toml
index fa833b51fa3..35555723f5d 100644
--- a/src/tools/miri/test_dependencies/Cargo.toml
+++ b/src/tools/miri/test_dependencies/Cargo.toml
@@ -34,4 +34,5 @@ windows-sys = { version = "0.59", features = [
     "Wdk_Storage_FileSystem",
 ] }
 
+# Make sure we are not part of the rustc workspace.
 [workspace]
diff --git a/src/tools/miri/tests/pass/shims/random.rs b/src/tools/miri/tests/pass/shims/random.rs
index ae75ebdcd3f..2a5c8993662 100644
--- a/src/tools/miri/tests/pass/shims/random.rs
+++ b/src/tools/miri/tests/pass/shims/random.rs
@@ -1,5 +1,5 @@
 #![feature(random)]
 
 fn main() {
-    let _x: i32 = std::random::random();
+    let _x: i32 = std::random::random(..);
 }
diff --git a/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs b/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs
index de8a42979bb..f9eb44d03ab 100644
--- a/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs
+++ b/src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs
@@ -4711,9 +4711,9 @@ The tracking issue for this feature is: [#133668]
         label: "const_trait_impl",
         description: r##"# `const_trait_impl`
 
-The tracking issue for this feature is: [#67792]
+The tracking issue for this feature is: [#143874]
 
-[#67792]: https://github.com/rust-lang/rust/issues/67792
+[#143874]: https://github.com/rust-lang/rust/issues/143874
 
 ------------------------
 "##,
diff --git a/src/tools/tidy/Cargo.toml b/src/tools/tidy/Cargo.toml
index 4835c220210..d995106ae02 100644
--- a/src/tools/tidy/Cargo.toml
+++ b/src/tools/tidy/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "tidy"
 version = "0.1.0"
-edition = "2021"
+edition = "2024"
 autobins = false
 
 [dependencies]
diff --git a/src/tools/tidy/src/alphabetical.rs b/src/tools/tidy/src/alphabetical.rs
index 141083290c6..9ddce725106 100644
--- a/src/tools/tidy/src/alphabetical.rs
+++ b/src/tools/tidy/src/alphabetical.rs
@@ -103,7 +103,7 @@ fn check_section<'a>(
 
         let prev_line_trimmed_lowercase = prev_line.trim_start_matches(' ');
 
-        if version_sort(&trimmed_line, &prev_line_trimmed_lowercase).is_lt() {
+        if version_sort(trimmed_line, prev_line_trimmed_lowercase).is_lt() {
             tidy_error_ext!(err, bad, "{file}:{}: line not in alphabetical order", idx + 1);
         }
 
diff --git a/src/tools/tidy/src/bins.rs b/src/tools/tidy/src/bins.rs
index 9b78ba75a05..a18f549844b 100644
--- a/src/tools/tidy/src/bins.rs
+++ b/src/tools/tidy/src/bins.rs
@@ -75,7 +75,7 @@ mod os_impl {
                         return ReadOnlyFs;
                     }
 
-                    panic!("unable to create temporary file `{:?}`: {:?}", path, e);
+                    panic!("unable to create temporary file `{path:?}`: {e:?}");
                 }
             }
         }
@@ -83,12 +83,7 @@ mod os_impl {
         for &source_dir in sources {
             match check_dir(source_dir) {
                 Unsupported => return false,
-                ReadOnlyFs => {
-                    return match check_dir(output) {
-                        Supported => true,
-                        _ => false,
-                    };
-                }
+                ReadOnlyFs => return matches!(check_dir(output), Supported),
                 _ => {}
             }
         }
@@ -139,7 +134,7 @@ mod os_impl {
                     return;
                 }
 
-                if t!(is_executable(&file), file) {
+                if t!(is_executable(file), file) {
                     let rel_path = file.strip_prefix(path).unwrap();
                     let git_friendly_path = rel_path.to_str().unwrap().replace("\\", "/");
 
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index bf813d2131e..f43f5eae9a5 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -624,7 +624,7 @@ fn check_proc_macro_dep_list(root: &Path, cargo: &Path, bless: bool, bad: &mut b
     let is_proc_macro_pkg = |pkg: &Package| pkg.targets.iter().any(|target| target.is_proc_macro());
 
     let mut proc_macro_deps = HashSet::new();
-    for pkg in metadata.packages.iter().filter(|pkg| is_proc_macro_pkg(*pkg)) {
+    for pkg in metadata.packages.iter().filter(|pkg| is_proc_macro_pkg(pkg)) {
         deps_of(&metadata, &pkg.id, &mut proc_macro_deps);
     }
     // Remove the proc-macro crates themselves
diff --git a/src/tools/tidy/src/error_codes.rs b/src/tools/tidy/src/error_codes.rs
index bb61412f678..65aa89fe801 100644
--- a/src/tools/tidy/src/error_codes.rs
+++ b/src/tools/tidy/src/error_codes.rs
@@ -119,8 +119,7 @@ fn extract_error_codes(root_path: &Path, errors: &mut Vec<String>) -> Vec<String
             let Some(split_line) = split_line else {
                 errors.push(format!(
                     "{path}:{line_index}: Expected a line with the format `Eabcd: abcd, \
-                    but got \"{}\" without a `:` delimiter",
-                    line,
+                    but got \"{line}\" without a `:` delimiter",
                 ));
                 continue;
             };
@@ -129,10 +128,8 @@ fn extract_error_codes(root_path: &Path, errors: &mut Vec<String>) -> Vec<String
 
             // If this is a duplicate of another error code, emit a fatal error.
             if error_codes.contains(&err_code) {
-                errors.push(format!(
-                    "{path}:{line_index}: Found duplicate error code: `{}`",
-                    err_code
-                ));
+                errors
+                    .push(format!("{path}:{line_index}: Found duplicate error code: `{err_code}`"));
                 continue;
             }
 
@@ -145,8 +142,7 @@ fn extract_error_codes(root_path: &Path, errors: &mut Vec<String>) -> Vec<String
             let Some(rest) = rest else {
                 errors.push(format!(
                     "{path}:{line_index}: Expected a line with the format `Eabcd: abcd, \
-                    but got \"{}\" without a `,` delimiter",
-                    line,
+                    but got \"{line}\" without a `,` delimiter",
                 ));
                 continue;
             };
@@ -209,7 +205,7 @@ fn check_error_codes_docs(
         }
 
         let (found_code_example, found_proper_doctest, emit_ignore_warning, no_longer_emitted) =
-            check_explanation_has_doctest(&contents, &err_code);
+            check_explanation_has_doctest(contents, err_code);
 
         if emit_ignore_warning {
             verbose_print!(
@@ -232,7 +228,7 @@ fn check_error_codes_docs(
             return;
         }
 
-        let test_ignored = IGNORE_DOCTEST_CHECK.contains(&&err_code);
+        let test_ignored = IGNORE_DOCTEST_CHECK.contains(&err_code);
 
         // Check that the explanation has a doctest, and if it shouldn't, that it doesn't
         if !found_proper_doctest && !test_ignored {
@@ -300,7 +296,7 @@ fn check_error_codes_tests(
     let tests_path = root_path.join(Path::new(ERROR_TESTS_PATH));
 
     for code in error_codes {
-        let test_path = tests_path.join(format!("{}.stderr", code));
+        let test_path = tests_path.join(format!("{code}.stderr"));
 
         if !test_path.exists() && !IGNORE_UI_TEST_CHECK.contains(&code.as_str()) {
             verbose_print!(
@@ -388,7 +384,7 @@ fn check_error_codes_used(
 
                     if !error_codes.contains(&error_code) {
                         // This error code isn't properly defined, we must error.
-                        errors.push(format!("Error code `{}` is used in the compiler but not defined and documented in `compiler/rustc_error_codes/src/lib.rs`.", error_code));
+                        errors.push(format!("Error code `{error_code}` is used in the compiler but not defined and documented in `compiler/rustc_error_codes/src/lib.rs`."));
                         continue;
                     }
 
diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs
index baab46752a5..381ea44fd46 100644
--- a/src/tools/tidy/src/ext_tool_checks.rs
+++ b/src/tools/tidy/src/ext_tool_checks.rs
@@ -64,8 +64,8 @@ fn check_impl(
     extra_checks: Option<&str>,
     pos_args: &[String],
 ) -> Result<(), Error> {
-    let show_diff = std::env::var("TIDY_PRINT_DIFF")
-        .map_or(false, |v| v.eq_ignore_ascii_case("true") || v == "1");
+    let show_diff =
+        std::env::var("TIDY_PRINT_DIFF").is_ok_and(|v| v.eq_ignore_ascii_case("true") || v == "1");
 
     // Split comma-separated args up
     let lint_args = match extra_checks {
@@ -141,7 +141,7 @@ fn check_impl(
             );
         }
         // Rethrow error
-        let _ = res?;
+        res?;
     }
 
     if python_fmt {
@@ -173,7 +173,7 @@ fn check_impl(
         }
 
         // Rethrow error
-        let _ = res?;
+        res?;
     }
 
     if cpp_fmt {
@@ -244,7 +244,7 @@ fn check_impl(
             }
         }
         // Rethrow error
-        let _ = res?;
+        res?;
     }
 
     if shell_lint {
@@ -286,8 +286,8 @@ fn run_ruff(
     file_args: &[&OsStr],
     ruff_args: &[&OsStr],
 ) -> Result<(), Error> {
-    let mut cfg_args_ruff = cfg_args.into_iter().copied().collect::<Vec<_>>();
-    let mut file_args_ruff = file_args.into_iter().copied().collect::<Vec<_>>();
+    let mut cfg_args_ruff = cfg_args.to_vec();
+    let mut file_args_ruff = file_args.to_vec();
 
     let mut cfg_path = root_path.to_owned();
     cfg_path.extend(RUFF_CONFIG_PATH);
@@ -305,7 +305,7 @@ fn run_ruff(
         file_args_ruff.push(root_path.as_os_str());
     }
 
-    let mut args: Vec<&OsStr> = ruff_args.into_iter().copied().collect();
+    let mut args: Vec<&OsStr> = ruff_args.to_vec();
     args.extend(merge_args(&cfg_args_ruff, &file_args_ruff));
     py_runner(py_path, true, None, "ruff", &args)
 }
diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs
index 55f937aeacf..bc217a55cc1 100644
--- a/src/tools/tidy/src/extdeps.rs
+++ b/src/tools/tidy/src/extdeps.rs
@@ -41,7 +41,7 @@ pub fn check(root: &Path, bad: &mut bool) {
             let source = line.split_once('=').unwrap().1.trim();
 
             // Ensure source is allowed.
-            if !ALLOWED_SOURCES.contains(&&*source) {
+            if !ALLOWED_SOURCES.contains(&source) {
                 tidy_error!(bad, "invalid source: {}", source);
             }
         }
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index 6093e7fd263..e83b47e1380 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -125,8 +125,8 @@ pub fn check(
                 let gate_test_str = "gate-test-";
 
                 let feature_name = match line.find(gate_test_str) {
-                    // NB: the `splitn` always succeeds, even if the delimiter is not present.
-                    Some(i) => line[i + gate_test_str.len()..].splitn(2, ' ').next().unwrap(),
+                    // `split` always contains at least 1 element, even if the delimiter is not present.
+                    Some(i) => line[i + gate_test_str.len()..].split(' ').next().unwrap(),
                     None => continue,
                 };
                 match features.get_mut(feature_name) {
@@ -135,16 +135,14 @@ pub fn check(
                             err(&format!(
                                 "The file is already marked as gate test \
                                       through its name, no need for a \
-                                      'gate-test-{}' comment",
-                                feature_name
+                                      'gate-test-{feature_name}' comment"
                             ));
                         }
                         f.has_gate_test = true;
                     }
                     None => {
                         err(&format!(
-                            "gate-test test found referencing a nonexistent feature '{}'",
-                            feature_name
+                            "gate-test test found referencing a nonexistent feature '{feature_name}'"
                         ));
                     }
                 }
@@ -170,8 +168,7 @@ pub fn check(
         );
         println!(
             "Hint: If you already have such a test and don't want to rename it,\
-                \n      you can also add a // gate-test-{} line to the test file.",
-            name
+                \n      you can also add a // gate-test-{name} line to the test file."
         );
     }
 
@@ -231,7 +228,7 @@ pub fn check(
 fn get_version_and_channel(src_path: &Path) -> (Version, String) {
     let version_str = t!(std::fs::read_to_string(src_path.join("version")));
     let version_str = version_str.trim();
-    let version = t!(std::str::FromStr::from_str(&version_str).map_err(|e| format!("{e:?}")));
+    let version = t!(std::str::FromStr::from_str(version_str).map_err(|e| format!("{e:?}")));
     let channel_str = t!(std::fs::read_to_string(src_path.join("ci").join("channel")));
     (version, channel_str.trim().to_owned())
 }
@@ -468,7 +465,7 @@ fn get_and_check_lib_features(
     map_lib_features(base_src_path, &mut |res, file, line| match res {
         Ok((name, f)) => {
             let mut check_features = |f: &Feature, list: &Features, display: &str| {
-                if let Some(ref s) = list.get(name) {
+                if let Some(s) = list.get(name) {
                     if f.tracking_issue != s.tracking_issue && f.level != Status::Accepted {
                         tidy_error!(
                             bad,
@@ -483,7 +480,7 @@ fn get_and_check_lib_features(
                     }
                 }
             };
-            check_features(&f, &lang_features, "corresponding lang feature");
+            check_features(&f, lang_features, "corresponding lang feature");
             check_features(&f, &lib_features, "previous");
             lib_features.insert(name.to_owned(), f);
         }
@@ -543,7 +540,7 @@ fn map_lib_features(
                     continue;
                 }
 
-                if let Some((ref name, ref mut f)) = becoming_feature {
+                if let Some((name, ref mut f)) = becoming_feature {
                     if f.tracking_issue.is_none() {
                         f.tracking_issue = find_attr_val(line, "issue").and_then(handle_issue_none);
                     }
diff --git a/src/tools/tidy/src/features/version.rs b/src/tools/tidy/src/features/version.rs
index 6a902e80f8e..0e0629a48e2 100644
--- a/src/tools/tidy/src/features/version.rs
+++ b/src/tools/tidy/src/features/version.rs
@@ -20,7 +20,7 @@ impl fmt::Display for Version {
             Version::Explicit { parts } => {
                 f.pad(&format!("{}.{}.{}", parts[0], parts[1], parts[2]))
             }
-            Version::CurrentPlaceholder => f.pad(&format!("CURRENT")),
+            Version::CurrentPlaceholder => f.pad("CURRENT"),
         }
     }
 }
diff --git a/src/tools/tidy/src/features/version/tests.rs b/src/tools/tidy/src/features/version/tests.rs
index 7701dce2df1..453ba40586e 100644
--- a/src/tools/tidy/src/features/version/tests.rs
+++ b/src/tools/tidy/src/features/version/tests.rs
@@ -33,6 +33,6 @@ fn test_to_string() {
 
     assert_eq!(v_1_0_0.to_string(), "1.0.0");
     assert_eq!(v_1_32_1.to_string(), "1.32.1");
-    assert_eq!(format!("{:<8}", v_1_32_1), "1.32.1  ");
-    assert_eq!(format!("{:>8}", v_1_32_1), "  1.32.1");
+    assert_eq!(format!("{v_1_32_1:<8}"), "1.32.1  ");
+    assert_eq!(format!("{v_1_32_1:>8}"), "  1.32.1");
 }
diff --git a/src/tools/tidy/src/fluent_alphabetical.rs b/src/tools/tidy/src/fluent_alphabetical.rs
index 6f154b92eff..48d14a37514 100644
--- a/src/tools/tidy/src/fluent_alphabetical.rs
+++ b/src/tools/tidy/src/fluent_alphabetical.rs
@@ -13,8 +13,8 @@ fn message() -> &'static Regex {
     static_regex!(r#"(?m)^([a-zA-Z0-9_]+)\s*=\s*"#)
 }
 
-fn filter_fluent(path: &Path) -> bool {
-    if let Some(ext) = path.extension() { ext.to_str() != Some("ftl") } else { true }
+fn is_fluent(path: &Path) -> bool {
+    path.extension().is_some_and(|ext| ext == "flt")
 }
 
 fn check_alphabetic(
@@ -92,7 +92,7 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
     let mut all_defined_msgs = HashMap::new();
     walk(
         path,
-        |path, is_dir| filter_dirs(path) || (!is_dir && filter_fluent(path)),
+        |path, is_dir| filter_dirs(path) || (!is_dir && !is_fluent(path)),
         &mut |ent, contents| {
             if bless {
                 let sorted = sort_messages(
@@ -104,7 +104,7 @@ pub fn check(path: &Path, bless: bool, bad: &mut bool) {
                 if sorted != contents {
                     let mut f =
                         OpenOptions::new().write(true).truncate(true).open(ent.path()).unwrap();
-                    f.write(sorted.as_bytes()).unwrap();
+                    f.write_all(sorted.as_bytes()).unwrap();
                 }
             } else {
                 check_alphabetic(
diff --git a/src/tools/tidy/src/fluent_period.rs b/src/tools/tidy/src/fluent_period.rs
index 6a136e5aec6..85c1ef6166a 100644
--- a/src/tools/tidy/src/fluent_period.rs
+++ b/src/tools/tidy/src/fluent_period.rs
@@ -37,7 +37,7 @@ fn check_period(filename: &str, contents: &str, bad: &mut bool) {
                 if let Some(PatternElement::TextElement { value }) = pat.elements.last() {
                     // We don't care about ellipses.
                     if value.ends_with(".") && !value.ends_with("...") {
-                        let ll = find_line(contents, *value);
+                        let ll = find_line(contents, value);
                         let name = m.id.name;
                         tidy_error!(bad, "{filename}:{ll}: message `{name}` ends in a period");
                     }
@@ -52,7 +52,7 @@ fn check_period(filename: &str, contents: &str, bad: &mut bool) {
 
                 if let Some(PatternElement::TextElement { value }) = attr.value.elements.last() {
                     if value.ends_with(".") && !value.ends_with("...") {
-                        let ll = find_line(contents, *value);
+                        let ll = find_line(contents, value);
                         let name = attr.id.name;
                         tidy_error!(bad, "{filename}:{ll}: attr `{name}` ends in a period");
                     }
diff --git a/src/tools/tidy/src/fluent_used.rs b/src/tools/tidy/src/fluent_used.rs
index ab56b5f0b0e..12fafd9a7ff 100644
--- a/src/tools/tidy/src/fluent_used.rs
+++ b/src/tools/tidy/src/fluent_used.rs
@@ -13,8 +13,8 @@ fn filter_used_messages(
     // we don't just check messages never appear in Rust files,
     // because messages can be used as parts of other fluent messages in Fluent files,
     // so we do checking messages appear only once in all Rust and Fluent files.
-    let mut matches = static_regex!(r"\w+").find_iter(contents);
-    while let Some(name) = matches.next() {
+    let matches = static_regex!(r"\w+").find_iter(contents);
+    for name in matches {
         if let Some((name, filename)) = msgs_not_appeared_yet.remove_entry(name.as_str()) {
             // if one msg appears for the first time,
             // remove it from `msgs_not_appeared_yet` and insert it into `msgs_appeared_only_once`.
diff --git a/src/tools/tidy/src/gcc_submodule.rs b/src/tools/tidy/src/gcc_submodule.rs
index 952ebe9e0cf..5d726c3ea48 100644
--- a/src/tools/tidy/src/gcc_submodule.rs
+++ b/src/tools/tidy/src/gcc_submodule.rs
@@ -7,7 +7,9 @@ use std::process::Command;
 pub fn check(root_path: &Path, compiler_path: &Path, bad: &mut bool) {
     let cg_gcc_version_path = compiler_path.join("rustc_codegen_gcc/libgccjit.version");
     let cg_gcc_version = std::fs::read_to_string(&cg_gcc_version_path)
-        .expect(&format!("Cannot read GCC version from {}", cg_gcc_version_path.display()))
+        .unwrap_or_else(|_| {
+            panic!("Cannot read GCC version from {}", cg_gcc_version_path.display())
+        })
         .trim()
         .to_string();
 
@@ -27,14 +29,13 @@ pub fn check(root_path: &Path, compiler_path: &Path, bad: &mut bool) {
     //  e607be166673a8de9fc07f6f02c60426e556c5f2 src/gcc (master-e607be166673a8de9fc07f6f02c60426e556c5f2.e607be)
     // +e607be166673a8de9fc07f6f02c60426e556c5f2 src/gcc (master-e607be166673a8de9fc07f6f02c60426e556c5f2.e607be)
     let git_output = String::from_utf8_lossy(&git_output.stdout)
-        .trim()
         .split_whitespace()
         .next()
         .unwrap_or_default()
         .to_string();
 
     // The SHA can start with + if the submodule is modified or - if it is not checked out.
-    let gcc_submodule_sha = git_output.trim_start_matches(&['+', '-']);
+    let gcc_submodule_sha = git_output.trim_start_matches(['+', '-']);
     if gcc_submodule_sha != cg_gcc_version {
         *bad = true;
         eprintln!(
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index 1eb5485f2b8..a67f7a511b5 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -15,11 +15,12 @@ use std::{env, process};
 use tidy::*;
 
 fn main() {
-    // Running Cargo will read the libstd Cargo.toml
+    // Enable nightly, because Cargo will read the libstd Cargo.toml
     // which uses the unstable `public-dependency` feature.
-    //
-    // `setenv` might not be thread safe, so run it before using multiple threads.
-    env::set_var("RUSTC_BOOTSTRAP", "1");
+    // SAFETY: no other threads have been spawned
+    unsafe {
+        env::set_var("RUSTC_BOOTSTRAP", "1");
+    }
 
     let root_path: PathBuf = env::args_os().nth(1).expect("need path to root of repo").into();
     let cargo: PathBuf = env::args_os().nth(2).expect("need path to cargo").into();
diff --git a/src/tools/tidy/src/mir_opt_tests.rs b/src/tools/tidy/src/mir_opt_tests.rs
index bb0d8150be4..1efe71b1687 100644
--- a/src/tools/tidy/src/mir_opt_tests.rs
+++ b/src/tools/tidy/src/mir_opt_tests.rs
@@ -49,7 +49,7 @@ fn check_unused_files(path: &Path, bless: bool, bad: &mut bool) {
 }
 
 fn check_dash_files(path: &Path, bless: bool, bad: &mut bool) {
-    for file in walkdir::WalkDir::new(&path.join("mir-opt"))
+    for file in walkdir::WalkDir::new(path.join("mir-opt"))
         .into_iter()
         .filter_map(Result::ok)
         .filter(|e| e.file_type().is_file())
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index 9b915e0f737..b7d4a331891 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -86,7 +86,7 @@ pub fn check(path: &Path, bad: &mut bool) {
             return;
         }
 
-        check_cfgs(contents, &file, bad, &mut saw_target_arch, &mut saw_cfg_bang);
+        check_cfgs(contents, file, bad, &mut saw_target_arch, &mut saw_cfg_bang);
     });
 
     assert!(saw_target_arch);
diff --git a/src/tools/tidy/src/rustdoc_gui_tests.rs b/src/tools/tidy/src/rustdoc_gui_tests.rs
index 91776bc989e..3b995f219d2 100644
--- a/src/tools/tidy/src/rustdoc_gui_tests.rs
+++ b/src/tools/tidy/src/rustdoc_gui_tests.rs
@@ -5,7 +5,7 @@ use std::path::Path;
 pub fn check(path: &Path, bad: &mut bool) {
     crate::walk::walk(
         &path.join("rustdoc-gui"),
-        |p, is_dir| !is_dir && p.extension().map_or(true, |e| e != "goml"),
+        |p, is_dir| !is_dir && p.extension().is_none_or(|e| e != "goml"),
         &mut |entry, content| {
             for line in content.lines() {
                 if !line.starts_with("// ") {
diff --git a/src/tools/tidy/src/rustdoc_js.rs b/src/tools/tidy/src/rustdoc_js.rs
index 5e924544f0d..5737fcbafc0 100644
--- a/src/tools/tidy/src/rustdoc_js.rs
+++ b/src/tools/tidy/src/rustdoc_js.rs
@@ -88,7 +88,7 @@ pub fn check(librustdoc_path: &Path, tools_path: &Path, src_path: &Path, bad: &m
     let mut files_to_check = Vec::new();
     walk_no_read(
         &[&librustdoc_path.join("html/static/js")],
-        |path, is_dir| is_dir || !path.extension().is_some_and(|ext| ext == OsStr::new("js")),
+        |path, is_dir| is_dir || path.extension().is_none_or(|ext| ext != OsStr::new("js")),
         &mut |path: &DirEntry| {
             files_to_check.push(path.path().into());
         },
diff --git a/src/tools/tidy/src/rustdoc_json.rs b/src/tools/tidy/src/rustdoc_json.rs
index 19b8e79ec33..722e1ebd0ca 100644
--- a/src/tools/tidy/src/rustdoc_json.rs
+++ b/src/tools/tidy/src/rustdoc_json.rs
@@ -20,7 +20,7 @@ pub fn check(src_path: &Path, ci_info: &crate::CiInfo, bad: &mut bool) {
         return;
     }
     // Then we check that if `FORMAT_VERSION` was updated, the `Latest feature:` was also updated.
-    match crate::git_diff(&base_commit, src_path.join("rustdoc-json-types")) {
+    match crate::git_diff(base_commit, src_path.join("rustdoc-json-types")) {
         Some(output) => {
             let mut format_version_updated = false;
             let mut latest_feature_comment_updated = false;
diff --git a/src/tools/tidy/src/rustdoc_templates.rs b/src/tools/tidy/src/rustdoc_templates.rs
index 2173dbf7e74..dca3e8d9d25 100644
--- a/src/tools/tidy/src/rustdoc_templates.rs
+++ b/src/tools/tidy/src/rustdoc_templates.rs
@@ -14,7 +14,7 @@ const TAGS: &[(&str, &str)] = &[("{#", "#}"), ("{%", "%}"), ("{{", "}}")];
 pub fn check(librustdoc_path: &Path, bad: &mut bool) {
     walk(
         &librustdoc_path.join("html/templates"),
-        |path, is_dir| is_dir || !path.extension().is_some_and(|ext| ext == OsStr::new("html")),
+        |path, is_dir| is_dir || path.extension().is_none_or(|ext| ext != OsStr::new("html")),
         &mut |path: &DirEntry, file_content: &str| {
             let mut lines = file_content.lines().enumerate().peekable();
 
@@ -23,7 +23,7 @@ pub fn check(librustdoc_path: &Path, bad: &mut bool) {
                 if let Some(need_next_line_check) = TAGS.iter().find_map(|(tag, end_tag)| {
                     // We first check if the line ends with a jinja tag.
                     if !line.ends_with(end_tag) {
-                        return None;
+                        None
                     // Then we check if this a comment tag.
                     } else if *tag != "{#" {
                         return Some(false);
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs
index 2237eac200d..8dde4618ce5 100644
--- a/src/tools/tidy/src/style.rs
+++ b/src/tools/tidy/src/style.rs
@@ -94,10 +94,9 @@ fn generate_problems<'a>(
     letter_digit: &'a FxHashMap<char, char>,
 ) -> impl Iterator<Item = u32> + 'a {
     consts.iter().flat_map(move |const_value| {
-        let problem =
-            letter_digit.iter().fold(format!("{:X}", const_value), |acc, (key, value)| {
-                acc.replace(&value.to_string(), &key.to_string())
-            });
+        let problem = letter_digit.iter().fold(format!("{const_value:X}"), |acc, (key, value)| {
+            acc.replace(&value.to_string(), &key.to_string())
+        });
         let indexes: Vec<usize> = problem
             .chars()
             .enumerate()
@@ -341,7 +340,7 @@ fn is_unexplained_ignore(extension: &str, line: &str) -> bool {
 
 pub fn check(path: &Path, bad: &mut bool) {
     fn skip(path: &Path, is_dir: bool) -> bool {
-        if path.file_name().map_or(false, |name| name.to_string_lossy().starts_with(".#")) {
+        if path.file_name().is_some_and(|name| name.to_string_lossy().starts_with(".#")) {
             // vim or emacs temporary file
             return true;
         }
@@ -358,12 +357,12 @@ pub fn check(path: &Path, bad: &mut bool) {
         let extensions = ["rs", "py", "js", "sh", "c", "cpp", "h", "md", "css", "ftl", "goml"];
 
         // NB: don't skip paths without extensions (or else we'll skip all directories and will only check top level files)
-        if path.extension().map_or(true, |ext| !extensions.iter().any(|e| ext == OsStr::new(e))) {
+        if path.extension().is_none_or(|ext| !extensions.iter().any(|e| ext == OsStr::new(e))) {
             return true;
         }
 
         // We only check CSS files in rustdoc.
-        path.extension().map_or(false, |e| e == "css") && !is_in(path, "src", "librustdoc")
+        path.extension().is_some_and(|e| e == "css") && !is_in(path, "src", "librustdoc")
     }
 
     // This creates a RegexSet as regex contains performance optimizations to be able to deal with these over
@@ -435,7 +434,7 @@ pub fn check(path: &Path, bad: &mut bool) {
             mut skip_copyright,
             mut skip_dbg,
             mut skip_odd_backticks,
-        ] = contains_ignore_directives(&path_str, can_contain, &contents, CONFIGURABLE_CHECKS);
+        ] = contains_ignore_directives(&path_str, can_contain, contents, CONFIGURABLE_CHECKS);
         let mut leading_new_lines = false;
         let mut trailing_new_lines = 0;
         let mut lines = 0;
diff --git a/src/tools/tidy/src/target_specific_tests.rs b/src/tools/tidy/src/target_specific_tests.rs
index a66ccd37070..1a6fd3eaf2d 100644
--- a/src/tools/tidy/src/target_specific_tests.rs
+++ b/src/tools/tidy/src/target_specific_tests.rs
@@ -30,10 +30,9 @@ pub fn check(tests_path: &Path, bad: &mut bool) {
                         comp_vec.push(component);
                     }
                 }
-            } else if directive.starts_with(COMPILE_FLAGS_HEADER) {
-                let compile_flags = &directive[COMPILE_FLAGS_HEADER.len()..];
+            } else if let Some(compile_flags) = directive.strip_prefix(COMPILE_FLAGS_HEADER) {
                 if let Some((_, v)) = compile_flags.split_once("--target") {
-                    let v = v.trim_start_matches(|c| c == ' ' || c == '=');
+                    let v = v.trim_start_matches([' ', '=']);
                     let v = if v == "{{target}}" { Some((v, v)) } else { v.split_once("-") };
                     if let Some((arch, _)) = v {
                         let info = header_map.entry(revision).or_insert(RevisionInfo::default());
@@ -57,15 +56,13 @@ pub fn check(tests_path: &Path, bad: &mut bool) {
                 (None, None) => {}
                 (Some(_), None) => {
                     eprintln!(
-                        "{}: revision {} should specify `{}` as it has `--target` set",
-                        file, rev, LLVM_COMPONENTS_HEADER
+                        "{file}: revision {rev} should specify `{LLVM_COMPONENTS_HEADER}` as it has `--target` set"
                     );
                     *bad = true;
                 }
                 (None, Some(_)) => {
                     eprintln!(
-                        "{}: revision {} should not specify `{}` as it doesn't need `--target`",
-                        file, rev, LLVM_COMPONENTS_HEADER
+                        "{file}: revision {rev} should not specify `{LLVM_COMPONENTS_HEADER}` as it doesn't need `--target`"
                     );
                     *bad = true;
                 }
diff --git a/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs b/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs
index ee92d302db3..02412b6f190 100644
--- a/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs
+++ b/src/tools/tidy/src/tests_revision_unpaired_stdout_stderr.rs
@@ -38,7 +38,7 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
 
             let sibling_path = sibling.path();
 
-            let Some(ext) = sibling_path.extension().map(OsStr::to_str).flatten() else {
+            let Some(ext) = sibling_path.extension().and_then(OsStr::to_str) else {
                 continue;
             };
 
@@ -84,7 +84,7 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
                 }
             });
 
-            let Some(test_name) = test.file_stem().map(OsStr::to_str).flatten() else {
+            let Some(test_name) = test.file_stem().and_then(OsStr::to_str) else {
                 continue;
             };
 
@@ -102,9 +102,9 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
         // of the form: `test-name.revision.compare_mode.extension`, but our only concern is
         // `test-name.revision` and `extension`.
         for sibling in files_under_inspection.iter().filter(|f| {
-            f.extension().map(OsStr::to_str).flatten().is_some_and(|ext| EXTENSIONS.contains(&ext))
+            f.extension().and_then(OsStr::to_str).is_some_and(|ext| EXTENSIONS.contains(&ext))
         }) {
-            let Some(filename) = sibling.file_name().map(OsStr::to_str).flatten() else {
+            let Some(filename) = sibling.file_name().and_then(OsStr::to_str) else {
                 continue;
             };
 
@@ -131,10 +131,10 @@ pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) {
                 }
                 [_, _] => return,
                 [_, found_revision, .., extension] => {
-                    if !IGNORES.contains(&found_revision)
+                    if !IGNORES.contains(found_revision)
                         && !expected_revisions.contains(*found_revision)
                         // This is from `//@ stderr-per-bitwidth`
-                        && !(*extension == "stderr" && ["32bit", "64bit"].contains(&found_revision))
+                        && !(*extension == "stderr" && ["32bit", "64bit"].contains(found_revision))
                     {
                         // Found some unexpected revision-esque component that is not a known
                         // compare-mode or expected revision.
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index 53226fcb80e..b1ace74e5bd 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -57,11 +57,9 @@ const EXTENSION_EXCEPTION_PATHS: &[&str] = &[
 fn check_entries(tests_path: &Path, bad: &mut bool) {
     let mut directories: HashMap<PathBuf, u32> = HashMap::new();
 
-    for dir in Walk::new(&tests_path.join("ui")) {
-        if let Ok(entry) = dir {
-            let parent = entry.path().parent().unwrap().to_path_buf();
-            *directories.entry(parent).or_default() += 1;
-        }
+    for entry in Walk::new(tests_path.join("ui")).flatten() {
+        let parent = entry.path().parent().unwrap().to_path_buf();
+        *directories.entry(parent).or_default() += 1;
     }
 
     let (mut max, mut max_issues) = (0, 0);
@@ -99,7 +97,7 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
 "#;
 
     let path = &root_path.join("tests");
-    check_entries(&path, bad);
+    check_entries(path, bad);
 
     // the list of files in ui tests that are allowed to start with `issue-XXXX`
     // BTreeSet because we would like a stable ordering so --bless works
@@ -109,13 +107,12 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
         .strip_prefix(issues_txt_header)
         .unwrap()
         .lines()
-        .map(|line| {
+        .inspect(|&line| {
             if prev_line > line {
                 is_sorted = false;
             }
 
             prev_line = line;
-            line
         })
         .collect();
 
@@ -203,7 +200,7 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
         // so we don't bork things on panic or a contributor using Ctrl+C
         let blessed_issues_path = tidy_src.join("issues_blessed.txt");
         let mut blessed_issues_txt = fs::File::create(&blessed_issues_path).unwrap();
-        blessed_issues_txt.write(issues_txt_header.as_bytes()).unwrap();
+        blessed_issues_txt.write_all(issues_txt_header.as_bytes()).unwrap();
         // If we changed paths to use the OS separator, reassert Unix chauvinism for blessing.
         for filename in allowed_issue_names.difference(&remaining_issue_names) {
             writeln!(blessed_issues_txt, "{filename}").unwrap();
diff --git a/src/tools/tidy/src/unstable_book.rs b/src/tools/tidy/src/unstable_book.rs
index a2453a6c960..9dc9d42d466 100644
--- a/src/tools/tidy/src/unstable_book.rs
+++ b/src/tools/tidy/src/unstable_book.rs
@@ -38,7 +38,7 @@ fn dir_entry_is_file(dir_entry: &fs::DirEntry) -> bool {
 pub fn collect_unstable_feature_names(features: &Features) -> BTreeSet<String> {
     features
         .iter()
-        .filter(|&(_, ref f)| f.level == Status::Unstable)
+        .filter(|&(_, f)| f.level == Status::Unstable)
         .map(|(name, _)| name.replace('_', "-"))
         .collect()
 }
@@ -90,7 +90,7 @@ pub fn check(path: &Path, features: CollectedFeatures, bad: &mut bool) {
     let lib_features = features
         .lib
         .into_iter()
-        .filter(|&(ref name, _)| !lang_features.contains_key(name))
+        .filter(|(name, _)| !lang_features.contains_key(name))
         .collect::<Features>();
 
     // Library features
diff --git a/src/tools/tidy/src/walk.rs b/src/tools/tidy/src/walk.rs
index c2c9eb8d250..7825ebeb5ba 100644
--- a/src/tools/tidy/src/walk.rs
+++ b/src/tools/tidy/src/walk.rs
@@ -66,7 +66,7 @@ pub fn walk_many(
             Ok(s) => s,
             Err(_) => return, // skip this file
         };
-        f(&entry, &contents_str);
+        f(entry, contents_str);
     });
 }
 
@@ -83,7 +83,7 @@ pub(crate) fn walk_no_read(
         !skip(e.path(), e.file_type().map(|ft| ft.is_dir()).unwrap_or(false))
     });
     for entry in walker.build().flatten() {
-        if entry.file_type().map_or(true, |kind| kind.is_dir() || kind.is_symlink()) {
+        if entry.file_type().is_none_or(|kind| kind.is_dir() || kind.is_symlink()) {
             continue;
         }
         f(&entry);
diff --git a/src/tools/tidy/src/x_version.rs b/src/tools/tidy/src/x_version.rs
index 489343561e1..6a5e9eca813 100644
--- a/src/tools/tidy/src/x_version.rs
+++ b/src/tools/tidy/src/x_version.rs
@@ -26,7 +26,7 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
                     // Check this is the rust-lang/rust x tool installation since it should be
                     // installed at a path containing `src/tools/x`.
                     if let Some(path) = iter.next() {
-                        if path.contains(&"src/tools/x") {
+                        if path.contains("src/tools/x") {
                             let version = version.strip_prefix("v").unwrap();
                             installed = Some(Version::parse(version).unwrap());
                             break;
@@ -42,15 +42,15 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
 
         if let Some(expected) = get_x_wrapper_version(root, cargo) {
             if installed < expected {
-                return println!(
+                println!(
                     "Current version of x is {installed}, but the latest version is {expected}\nConsider updating to the newer version of x by running `cargo install --path src/tools/x`"
-                );
+                )
             }
         } else {
-            return tidy_error!(
+            tidy_error!(
                 bad,
                 "Unable to parse the latest version of `x` at `src/tools/x/Cargo.toml`"
-            );
+            )
         }
     } else {
         tidy_error!(bad, "failed to check version of `x`: {}", cargo_list.status)
diff --git a/src/tools/tier-check/Cargo.toml b/src/tools/tier-check/Cargo.toml
index 3f08165a3fc..a34f9447fab 100644
--- a/src/tools/tier-check/Cargo.toml
+++ b/src/tools/tier-check/Cargo.toml
@@ -1,7 +1,7 @@
 [package]
 name = "tier-check"
 version = "0.1.0"
-edition = "2021"
+edition = "2024"
 license = "MIT OR Apache-2.0"
 
 [dependencies]
diff --git a/src/tools/tier-check/src/main.rs b/src/tools/tier-check/src/main.rs
index 91b96117db0..6c27a2ec442 100644
--- a/src/tools/tier-check/src/main.rs
+++ b/src/tools/tier-check/src/main.rs
@@ -25,29 +25,27 @@ fn main() {
     let doc_targets: HashSet<_> = doc_targets_md
         .lines()
         .filter(|line| line.starts_with(&['`', '['][..]) && line.contains('|'))
-        .map(|line| line.split('`').skip(1).next().expect("expected target code span"))
+        .map(|line| line.split('`').nth(1).expect("expected target code span"))
         .collect();
 
     let missing: Vec<_> = target_list.difference(&doc_targets).collect();
     let extra: Vec<_> = doc_targets.difference(&target_list).collect();
     for target in &missing {
         eprintln!(
-            "error: target `{}` is missing from {}\n\
-            If this is a new target, please add it to {}.",
-            target, filename, src
+            "error: target `{target}` is missing from {filename}\n\
+            If this is a new target, please add it to {src}."
         );
     }
     for target in &extra {
         eprintln!(
-            "error: target `{}` is in {}, but does not appear in the rustc target list\n\
-            If the target has been removed, please edit {} and remove the target.",
-            target, filename, src
+            "error: target `{target}` is in {filename}, but does not appear in the rustc target list\n\
+            If the target has been removed, please edit {src} and remove the target."
         );
     }
     // Check target names for unwanted characters like `.` that can cause problems e.g. in Cargo.
     // See also Tier 3 target policy.
     // If desired, target names can ignore this check.
-    let ignore_target_names = vec![
+    let ignore_target_names = [
         "thumbv8m.base-none-eabi",
         "thumbv8m.main-none-eabi",
         "thumbv8m.main-none-eabihf",
diff --git a/tests/mir-opt/pre-codegen/README.md b/tests/mir-opt/pre-codegen/README.md
index a338c18e09e..f0598703cd9 100644
--- a/tests/mir-opt/pre-codegen/README.md
+++ b/tests/mir-opt/pre-codegen/README.md
@@ -1,3 +1,3 @@
-The goal of this directory is to track the quality of MIR that is given to codegen in a standard `-O` condiguration.
+The goal of this directory is to track the quality of MIR that is given to codegen in a standard `-O` configuration.
 
 As such, feel free to `--bless` whatever changes you get here, so long as doing so doesn't add substantially more MIR.
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
index be3de580983..5ce815b9aed 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
@@ -16,7 +16,7 @@ error[E0658]: const trait impls are experimental
 LL | trait Bar: ~const Foo {}
    |            ^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -26,7 +26,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn foo<T: ~const Bar>(x: &T) {
    |                 ^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
index a23793580f7..3dc147e076f 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
@@ -16,7 +16,7 @@ error[E0658]: const trait impls are experimental
 7 | trait Bar: ~const Foo {}
   |            ^^^^^^
   |
-  = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+  = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error[E0658]: const trait impls are experimental
  --> const-super-trait.rs:9:17
@@ -24,7 +24,7 @@ error[E0658]: const trait impls are experimental
 9 | const fn foo<T: ~const Bar>(x: &T) {
   |                 ^^^^^^
   |
-  = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+  = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error: `[const]` can only be applied to `#[const_trait]` traits
  --> const-super-trait.rs:7:12
diff --git a/tests/ui-fulldeps/stable-mir/check_abi.rs b/tests/ui-fulldeps/stable-mir/check_abi.rs
index 9d83dd9ce1a..fc2227d147d 100644
--- a/tests/ui-fulldeps/stable-mir/check_abi.rs
+++ b/tests/ui-fulldeps/stable-mir/check_abi.rs
@@ -14,17 +14,17 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::abi::{
+use rustc_public::abi::{
     ArgAbi, CallConvention, FieldsShape, IntegerLength, PassMode, Primitive, Scalar, ValueAbi,
     VariantsShape,
 };
-use stable_mir::mir::MirVisitor;
-use stable_mir::mir::mono::Instance;
-use stable_mir::target::MachineInfo;
-use stable_mir::ty::{AdtDef, RigidTy, Ty, TyKind};
-use stable_mir::{CrateDef, CrateItem, CrateItems, ItemKind};
+use rustc_public::mir::MirVisitor;
+use rustc_public::mir::mono::Instance;
+use rustc_public::target::MachineInfo;
+use rustc_public::ty::{AdtDef, RigidTy, Ty, TyKind};
+use rustc_public::{CrateDef, CrateItem, CrateItems, ItemKind};
 use std::assert_matches::assert_matches;
 use std::collections::HashSet;
 use std::convert::TryFrom;
@@ -36,7 +36,7 @@ const CRATE_NAME: &str = "input";
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
 
     // Test fn_abi
     let target_fn = *get_item(&items, (ItemKind::Fn, "fn_abi")).unwrap();
@@ -69,7 +69,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert!(ptr_variadic_fn_abi.c_variadic);
     assert_eq!(ptr_variadic_fn_abi.args.len(), 1);
 
-    let entry = stable_mir::entry_fn().unwrap();
+    let entry = rustc_public::entry_fn().unwrap();
     let main_fn = Instance::try_from(entry).unwrap();
     let mut visitor = AdtDefVisitor::default();
     visitor.visit_body(&main_fn.body().unwrap());
@@ -147,7 +147,7 @@ fn check_niche(abi: &ArgAbi) {
 fn get_item<'a>(
     items: &'a CrateItems,
     item: (ItemKind, &str),
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| (item.0 == crate_item.kind()) && crate_item.name() == item.1)
 }
 
@@ -157,7 +157,7 @@ struct AdtDefVisitor {
 }
 
 impl MirVisitor for AdtDefVisitor {
-    fn visit_ty(&mut self, ty: &Ty, _location: stable_mir::mir::visit::Location) {
+    fn visit_ty(&mut self, ty: &Ty, _location: rustc_public::mir::visit::Location) {
         if let TyKind::RigidTy(RigidTy::Adt(adt, _)) = ty.kind() {
             self.adt_defs.insert(adt);
         }
diff --git a/tests/ui-fulldeps/stable-mir/check_allocation.rs b/tests/ui-fulldeps/stable-mir/check_allocation.rs
index c2d1d5d873b..83845a9aa42 100644
--- a/tests/ui-fulldeps/stable-mir/check_allocation.rs
+++ b/tests/ui-fulldeps/stable-mir/check_allocation.rs
@@ -17,7 +17,7 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::ascii::Char;
 use std::assert_matches::assert_matches;
@@ -27,19 +27,19 @@ use std::ffi::CStr;
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::crate_def::CrateDef;
-use stable_mir::mir::Body;
-use stable_mir::mir::alloc::GlobalAlloc;
-use stable_mir::mir::mono::{Instance, StaticDef};
-use stable_mir::ty::{Allocation, ConstantKind};
-use stable_mir::{CrateItem, CrateItems, ItemKind};
+use rustc_public::crate_def::CrateDef;
+use rustc_public::mir::Body;
+use rustc_public::mir::alloc::GlobalAlloc;
+use rustc_public::mir::mono::{Instance, StaticDef};
+use rustc_public::ty::{Allocation, ConstantKind};
+use rustc_public::{CrateItem, CrateItems, ItemKind};
 
 const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     check_foo(*get_item(&items, (ItemKind::Static, "FOO")).unwrap());
     check_bar(*get_item(&items, (ItemKind::Static, "BAR")).unwrap());
     check_len(*get_item(&items, (ItemKind::Static, "LEN")).unwrap());
@@ -164,7 +164,7 @@ fn check_other_consts(item: CrateItem) {
     }
     let bool_id = bool_id.unwrap();
     let char_id = char_id.unwrap();
-    // FIXME(stable_mir): add `read_ptr` to `Allocation`
+    // FIXME(rustc_public): add `read_ptr` to `Allocation`
     assert_ne!(bool_id, char_id);
 }
 
@@ -196,7 +196,7 @@ fn check_len(item: CrateItem) {
 fn get_item<'a>(
     items: &'a CrateItems,
     item: (ItemKind, &str),
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| (item.0 == crate_item.kind()) && crate_item.name() == item.1)
 }
 
diff --git a/tests/ui-fulldeps/stable-mir/check_assoc_items.rs b/tests/ui-fulldeps/stable-mir/check_assoc_items.rs
index 574f7797854..1557991f8ca 100644
--- a/tests/ui-fulldeps/stable-mir/check_assoc_items.rs
+++ b/tests/ui-fulldeps/stable-mir/check_assoc_items.rs
@@ -14,20 +14,20 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::collections::HashSet;
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::ty::*;
-use stable_mir::{CrateDef, *};
+use rustc_public::ty::*;
+use rustc_public::{CrateDef, *};
 
 const CRATE_NAME: &str = "crate_assoc_items";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_assoc_items() -> ControlFlow<()> {
-    let local_crate = stable_mir::local_crate();
+    let local_crate = rustc_public::local_crate();
     check_items(
         &local_crate.fn_defs(),
         &[
diff --git a/tests/ui-fulldeps/stable-mir/check_attribute.rs b/tests/ui-fulldeps/stable-mir/check_attribute.rs
index f234c658dfd..d8807872ec4 100644
--- a/tests/ui-fulldeps/stable-mir/check_attribute.rs
+++ b/tests/ui-fulldeps/stable-mir/check_attribute.rs
@@ -13,9 +13,9 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::{CrateDef, CrateItems};
+use rustc_public::{CrateDef, CrateItems};
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -24,7 +24,7 @@ const CRATE_NAME: &str = "input";
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
 
     test_tool(&items);
 
@@ -46,7 +46,7 @@ fn test_tool(items: &CrateItems) {
 fn get_item<'a>(
     items: &'a CrateItems,
     name: &str,
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| crate_item.name() == name)
 }
 
diff --git a/tests/ui-fulldeps/stable-mir/check_binop.rs b/tests/ui-fulldeps/stable-mir/check_binop.rs
index 748c2088a30..aa089a5d125 100644
--- a/tests/ui-fulldeps/stable-mir/check_binop.rs
+++ b/tests/ui-fulldeps/stable-mir/check_binop.rs
@@ -13,12 +13,12 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::mir::mono::Instance;
-use stable_mir::mir::visit::{Location, MirVisitor};
-use stable_mir::mir::{LocalDecl, Rvalue, Statement, StatementKind, Terminator, TerminatorKind};
-use stable_mir::ty::{RigidTy, TyKind};
+use rustc_public::mir::mono::Instance;
+use rustc_public::mir::visit::{Location, MirVisitor};
+use rustc_public::mir::{LocalDecl, Rvalue, Statement, StatementKind, Terminator, TerminatorKind};
+use rustc_public::ty::{RigidTy, TyKind};
 use std::collections::HashSet;
 use std::convert::TryFrom;
 use std::io::Write;
@@ -27,7 +27,7 @@ use std::ops::ControlFlow;
 /// This function tests that we can correctly get type information from binary operations.
 fn test_binops() -> ControlFlow<()> {
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     let mut instances =
         items.into_iter().map(|item| Instance::try_from(item).unwrap()).collect::<Vec<_>>();
     while let Some(instance) = instances.pop() {
diff --git a/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs b/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs
index 2af32afc1f7..725b538b0fe 100644
--- a/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs
+++ b/tests/ui-fulldeps/stable-mir/check_coroutine_body.rs
@@ -14,18 +14,18 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::mir::Body;
-use stable_mir::ty::{RigidTy, TyKind};
+use rustc_public::mir::Body;
+use rustc_public::ty::{RigidTy, TyKind};
 
 const CRATE_NAME: &str = "crate_coroutine_body";
 
 fn test_coroutine_body() -> ControlFlow<()> {
-    let crate_items = stable_mir::all_local_items();
+    let crate_items = rustc_public::all_local_items();
     if let Some(body) = crate_items.iter().find_map(|item| {
         let item_ty = item.ty();
         if let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &item_ty.kind() {
diff --git a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs b/tests/ui-fulldeps/stable-mir/check_crate_defs.rs
index d3929c5e48b..27d5b0bc238 100644
--- a/tests/ui-fulldeps/stable-mir/check_crate_defs.rs
+++ b/tests/ui-fulldeps/stable-mir/check_crate_defs.rs
@@ -14,9 +14,9 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::CrateDef;
+use rustc_public::CrateDef;
 use std::collections::HashSet;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -26,7 +26,7 @@ const CRATE_NAME: &str = "crate_defs";
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
-    let local = stable_mir::local_crate();
+    let local = rustc_public::local_crate();
     check_items(&local.statics(), &["PRIVATE_STATIC", "dummy::PUBLIC_STATIC"]);
     check_items(
         &local.fn_defs(),
@@ -44,7 +44,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     // Find items inside core crate.
     // FIXME: We are currently missing primitive type methods and trait implementations for external
     // crates.
-    let core = stable_mir::find_crates("core").pop().expect("Cannot find `core` crate");
+    let core = rustc_public::find_crates("core").pop().expect("Cannot find `core` crate");
     contains(
         &core.fn_defs(),
         &[
diff --git a/tests/ui-fulldeps/stable-mir/check_def_ty.rs b/tests/ui-fulldeps/stable-mir/check_def_ty.rs
index 101e7eb9121..b5954352dc0 100644
--- a/tests/ui-fulldeps/stable-mir/check_def_ty.rs
+++ b/tests/ui-fulldeps/stable-mir/check_def_ty.rs
@@ -14,10 +14,10 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::ty::{Ty, ForeignItemKind};
-use stable_mir::*;
+use rustc_public::ty::{Ty, ForeignItemKind};
+use rustc_public::*;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -25,7 +25,7 @@ const CRATE_NAME: &str = "crate_def_ty";
 
 /// Test if we can retrieve type information from different definitions.
 fn test_def_tys() -> ControlFlow<()> {
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     for item in &items {
         // Type from crate items.
         let ty = item.ty();
@@ -37,7 +37,7 @@ fn test_def_tys() -> ControlFlow<()> {
         }
     }
 
-    let foreign_items = stable_mir::local_crate().foreign_modules();
+    let foreign_items = rustc_public::local_crate().foreign_modules();
     for item in foreign_items[0].module().items() {
         // Type from foreign items.
         let ty = item.ty();
diff --git a/tests/ui-fulldeps/stable-mir/check_defs.rs b/tests/ui-fulldeps/stable-mir/check_defs.rs
index 65db50ee3ff..5e45f19cac8 100644
--- a/tests/ui-fulldeps/stable-mir/check_defs.rs
+++ b/tests/ui-fulldeps/stable-mir/check_defs.rs
@@ -13,13 +13,13 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::assert_matches::assert_matches;
 use mir::{mono::Instance, TerminatorKind::*};
-use stable_mir::mir::mono::InstanceKind;
-use stable_mir::ty::{RigidTy, TyKind, Ty, UintTy};
-use stable_mir::*;
+use rustc_public::mir::mono::InstanceKind;
+use rustc_public::ty::{RigidTy, TyKind, Ty, UintTy};
+use rustc_public::*;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -27,7 +27,7 @@ const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
-    let entry = stable_mir::entry_fn().unwrap();
+    let entry = rustc_public::entry_fn().unwrap();
     let main_fn = Instance::try_from(entry).unwrap();
     assert_eq!(main_fn.name(), "main");
     assert_eq!(main_fn.trimmed_name(), "main");
diff --git a/tests/ui-fulldeps/stable-mir/check_foreign.rs b/tests/ui-fulldeps/stable-mir/check_foreign.rs
index 2947d51b63b..9aee067f41b 100644
--- a/tests/ui-fulldeps/stable-mir/check_foreign.rs
+++ b/tests/ui-fulldeps/stable-mir/check_foreign.rs
@@ -14,9 +14,9 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 extern crate rustc_span;
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::{
+use rustc_public::{
     ty::{Abi, ForeignItemKind},
     *,
 };
diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/stable-mir/check_instance.rs
index 9b1e4176531..18971076043 100644
--- a/tests/ui-fulldeps/stable-mir/check_instance.rs
+++ b/tests/ui-fulldeps/stable-mir/check_instance.rs
@@ -13,21 +13,21 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 use std::ops::ControlFlow;
 
 use mir::mono::Instance;
 use mir::TerminatorKind::*;
-use stable_mir::ty::{RigidTy, TyKind};
-use stable_mir::*;
+use rustc_public::ty::{RigidTy, TyKind};
+use rustc_public::*;
 
 const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
 
     // Get all items and split generic vs monomorphic items.
     let (generic, mono): (Vec<_>, Vec<_>) =
diff --git a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs b/tests/ui-fulldeps/stable-mir/check_intrinsics.rs
index 2fce367c7a0..854ac77956e 100644
--- a/tests/ui-fulldeps/stable-mir/check_intrinsics.rs
+++ b/tests/ui-fulldeps/stable-mir/check_intrinsics.rs
@@ -18,12 +18,12 @@ extern crate rustc_hir;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::mir::mono::{Instance, InstanceKind};
-use stable_mir::mir::visit::{Location, MirVisitor};
-use stable_mir::mir::{LocalDecl, Terminator, TerminatorKind};
-use stable_mir::ty::{FnDef, GenericArgs, RigidTy, TyKind};
+use rustc_public::mir::mono::{Instance, InstanceKind};
+use rustc_public::mir::visit::{Location, MirVisitor};
+use rustc_public::mir::{LocalDecl, Terminator, TerminatorKind};
+use rustc_public::ty::{FnDef, GenericArgs, RigidTy, TyKind};
 use std::assert_matches::assert_matches;
 use std::convert::TryFrom;
 use std::io::Write;
@@ -32,7 +32,7 @@ use std::ops::ControlFlow;
 /// This function tests that we can correctly get type information from binary operations.
 fn test_intrinsics() -> ControlFlow<()> {
     // Find items in the local crate.
-    let main_def = stable_mir::all_local_items()[0];
+    let main_def = rustc_public::all_local_items()[0];
     let main_instance = Instance::try_from(main_def).unwrap();
     let main_body = main_instance.body().unwrap();
     let mut visitor = CallsVisitor { locals: main_body.locals(), calls: Default::default() };
diff --git a/tests/ui-fulldeps/stable-mir/check_item_kind.rs b/tests/ui-fulldeps/stable-mir/check_item_kind.rs
index 20b9e86ff92..58e740bdaef 100644
--- a/tests/ui-fulldeps/stable-mir/check_item_kind.rs
+++ b/tests/ui-fulldeps/stable-mir/check_item_kind.rs
@@ -13,9 +13,9 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::*;
+use rustc_public::*;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -23,7 +23,7 @@ const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_item_kind() -> ControlFlow<()> {
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     assert_eq!(items.len(), 4);
     // Constructor item.
     for item in items {
diff --git a/tests/ui-fulldeps/stable-mir/check_normalization.rs b/tests/ui-fulldeps/stable-mir/check_normalization.rs
index bb5cd49e1b0..aa6a257dac6 100644
--- a/tests/ui-fulldeps/stable-mir/check_normalization.rs
+++ b/tests/ui-fulldeps/stable-mir/check_normalization.rs
@@ -12,11 +12,11 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
 use mir::mono::Instance;
 use ty::{Ty, TyKind, RigidTy};
-use stable_mir::*;
+use rustc_public::*;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -24,7 +24,7 @@ const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
 
     // Get all items and split generic vs monomorphic items.
     let instances: Vec<_> =
diff --git a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs b/tests/ui-fulldeps/stable-mir/check_trait_queries.rs
index 73ba0ea23c9..a6c37883643 100644
--- a/tests/ui-fulldeps/stable-mir/check_trait_queries.rs
+++ b/tests/ui-fulldeps/stable-mir/check_trait_queries.rs
@@ -14,9 +14,9 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::CrateDef;
+use rustc_public::CrateDef;
 use std::collections::HashSet;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -25,7 +25,7 @@ const CRATE_NAME: &str = "trait_test";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_traits() -> ControlFlow<()> {
-    let local_crate = stable_mir::local_crate();
+    let local_crate = rustc_public::local_crate();
     let local_traits = local_crate.trait_decls();
     assert_eq!(local_traits.len(), 1, "Expected `Max` trait, but found {:?}", local_traits);
     assert_eq!(&local_traits[0].name(), "Max");
@@ -42,14 +42,14 @@ fn test_traits() -> ControlFlow<()> {
     assert_impl(&impl_names, "<u64 as Max>");
     assert_impl(&impl_names, "<impl std::convert::From<Positive> for u64>");
 
-    let all_traits = stable_mir::all_trait_decls();
+    let all_traits = rustc_public::all_trait_decls();
     assert!(all_traits.len() > local_traits.len());
     assert!(
         local_traits.iter().all(|t| all_traits.contains(t)),
         "Local: {local_traits:#?}, All: {all_traits:#?}"
     );
 
-    let all_impls = stable_mir::all_trait_impls();
+    let all_impls = rustc_public::all_trait_impls();
     assert!(all_impls.len() > local_impls.len());
     assert!(
         local_impls.iter().all(|t| all_impls.contains(t)),
diff --git a/tests/ui-fulldeps/stable-mir/check_transform.rs b/tests/ui-fulldeps/stable-mir/check_transform.rs
index 460f1b9e963..3209fcf9ede 100644
--- a/tests/ui-fulldeps/stable-mir/check_transform.rs
+++ b/tests/ui-fulldeps/stable-mir/check_transform.rs
@@ -15,13 +15,13 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::mir::alloc::GlobalAlloc;
-use stable_mir::mir::mono::Instance;
-use stable_mir::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind};
-use stable_mir::ty::{ConstantKind, MirConst};
-use stable_mir::{CrateDef, CrateItems, ItemKind};
+use rustc_public::mir::alloc::GlobalAlloc;
+use rustc_public::mir::mono::Instance;
+use rustc_public::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind};
+use rustc_public::ty::{ConstantKind, MirConst};
+use rustc_public::{CrateDef, CrateItems, ItemKind};
 use std::convert::TryFrom;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -31,7 +31,7 @@ const CRATE_NAME: &str = "input";
 /// This function uses the Stable MIR APIs to transform the MIR.
 fn test_transform() -> ControlFlow<()> {
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
 
     // Test fn_abi
     let target_fn = *get_item(&items, (ItemKind::Fn, "dummy")).unwrap();
@@ -109,7 +109,7 @@ fn change_panic_msg(mut body: Body, new_msg: &str) -> Body {
 fn get_item<'a>(
     items: &'a CrateItems,
     item: (ItemKind, &str),
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| (item.0 == crate_item.kind()) && crate_item.name() == item.1)
 }
 
diff --git a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs b/tests/ui-fulldeps/stable-mir/check_ty_fold.rs
index 1a21757d038..07ef0d2bb50 100644
--- a/tests/ui-fulldeps/stable-mir/check_ty_fold.rs
+++ b/tests/ui-fulldeps/stable-mir/check_ty_fold.rs
@@ -15,13 +15,13 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::mir::{
+use rustc_public::mir::{
     Body, FieldIdx, MirVisitor, Place, ProjectionElem,
     visit::{Location, PlaceContext},
 };
-use stable_mir::ty::{RigidTy, Ty, TyKind};
+use rustc_public::ty::{RigidTy, Ty, TyKind};
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -29,7 +29,7 @@ const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
-    let main_fn = stable_mir::entry_fn();
+    let main_fn = rustc_public::entry_fn();
     let body = main_fn.unwrap().expect_body();
     let mut visitor = PlaceVisitor { body: &body, tested: false };
     visitor.visit_body(&body);
diff --git a/tests/ui-fulldeps/stable-mir/check_variant.rs b/tests/ui-fulldeps/stable-mir/check_variant.rs
index 4cff57308f6..ebe76bd89d5 100644
--- a/tests/ui-fulldeps/stable-mir/check_variant.rs
+++ b/tests/ui-fulldeps/stable-mir/check_variant.rs
@@ -15,15 +15,15 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::CrateItem;
-use stable_mir::crate_def::CrateDef;
-use stable_mir::mir::{AggregateKind, Rvalue, Statement, StatementKind};
-use stable_mir::ty::{IntTy, RigidTy, Ty};
+use rustc_public::CrateItem;
+use rustc_public::crate_def::CrateDef;
+use rustc_public::mir::{AggregateKind, Rvalue, Statement, StatementKind};
+use rustc_public::ty::{IntTy, RigidTy, Ty};
 
 const CRATE_NAME: &str = "crate_variant_ty";
 
@@ -97,7 +97,7 @@ fn check_adt_poly2() {
 }
 
 fn get_fn(name: &str) -> CrateItem {
-    stable_mir::all_local_items().into_iter().find(|it| it.name().eq(name)).unwrap()
+    rustc_public::all_local_items().into_iter().find(|it| it.name().eq(name)).unwrap()
 }
 
 fn check_statement_is_aggregate_assign(
diff --git a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs b/tests/ui-fulldeps/stable-mir/closure-generic-body.rs
index 6b3447e5839..e5f910fbda1 100644
--- a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs
+++ b/tests/ui-fulldeps/stable-mir/closure-generic-body.rs
@@ -14,18 +14,18 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
-use stable_mir::ty::{FnDef, RigidTy, TyKind};
+use rustc_public::mir::{Body, ConstOperand, Operand, TerminatorKind};
+use rustc_public::ty::{FnDef, RigidTy, TyKind};
 
 const CRATE_NAME: &str = "crate_closure_body";
 
 fn test_closure_body() -> ControlFlow<()> {
-    let crate_items = stable_mir::all_local_items();
+    let crate_items = rustc_public::all_local_items();
     for item in crate_items {
         let item_ty = item.ty();
         match &item_ty.kind() {
diff --git a/tests/ui-fulldeps/stable-mir/closure_body.rs b/tests/ui-fulldeps/stable-mir/closure_body.rs
index a1c97e7549b..f5f9f23ad12 100644
--- a/tests/ui-fulldeps/stable-mir/closure_body.rs
+++ b/tests/ui-fulldeps/stable-mir/closure_body.rs
@@ -14,18 +14,18 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 use std::ops::ControlFlow;
 
-use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
-use stable_mir::ty::{FnDef, RigidTy, TyKind};
+use rustc_public::mir::{Body, ConstOperand, Operand, TerminatorKind};
+use rustc_public::ty::{FnDef, RigidTy, TyKind};
 
 const CRATE_NAME: &str = "crate_closure_body";
 
 fn test_closure_body() -> ControlFlow<()> {
-    let crate_items = stable_mir::all_local_items();
+    let crate_items = rustc_public::all_local_items();
     for item in crate_items {
         let item_ty = item.ty();
         match &item_ty.kind() {
diff --git a/tests/ui-fulldeps/stable-mir/compilation-result.rs b/tests/ui-fulldeps/stable-mir/compilation-result.rs
index d577de48c55..ed013375c71 100644
--- a/tests/ui-fulldeps/stable-mir/compilation-result.rs
+++ b/tests/ui-fulldeps/stable-mir/compilation-result.rs
@@ -14,7 +14,7 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use std::io::Write;
 
@@ -40,7 +40,7 @@ fn test_continue(args: &[String]) {
 
 fn test_break(args: &[String]) {
     let result = run!(args, || ControlFlow::Break::<bool, i32>(false));
-    assert_eq!(result, Err(stable_mir::CompilerError::Interrupted(false)));
+    assert_eq!(result, Err(rustc_public::CompilerError::Interrupted(false)));
 }
 
 #[allow(unreachable_code)]
@@ -48,7 +48,7 @@ fn test_skipped(args: &[String]) {
     let mut args = args.to_vec();
     args.push("--version".to_string());
     let result = run!(&args, || unreachable!() as ControlFlow<()>);
-    assert_eq!(result, Err(stable_mir::CompilerError::Skipped));
+    assert_eq!(result, Err(rustc_public::CompilerError::Skipped));
 }
 
 #[allow(unreachable_code)]
@@ -56,7 +56,7 @@ fn test_failed(args: &[String]) {
     let mut args = args.to_vec();
     args.push("--cfg=broken".to_string());
     let result = run!(&args, || unreachable!() as ControlFlow<()>);
-    assert_eq!(result, Err(stable_mir::CompilerError::Failed));
+    assert_eq!(result, Err(rustc_public::CompilerError::Failed));
 }
 
 /// Test that we are able to pass a closure and set the return according to the captured value.
diff --git a/tests/ui-fulldeps/stable-mir/crate-info.rs b/tests/ui-fulldeps/stable-mir/crate-info.rs
index fd7c2032b6d..4f46dff9b82 100644
--- a/tests/ui-fulldeps/stable-mir/crate-info.rs
+++ b/tests/ui-fulldeps/stable-mir/crate-info.rs
@@ -15,13 +15,13 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use rustc_hir::def::DefKind;
-use stable_mir::ItemKind;
-use stable_mir::crate_def::CrateDef;
-use stable_mir::mir::mono::Instance;
-use stable_mir::ty::{RigidTy, TyKind};
+use rustc_public::ItemKind;
+use rustc_public::crate_def::CrateDef;
+use rustc_public::mir::mono::Instance;
+use rustc_public::ty::{RigidTy, TyKind};
 use std::assert_matches::assert_matches;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -30,18 +30,18 @@ const CRATE_NAME: &str = "input";
 
 /// This function uses the Stable MIR APIs to get information about the test crate.
 fn test_stable_mir() -> ControlFlow<()> {
-    // Get the local crate using stable_mir API.
-    let local = stable_mir::local_crate();
+    // Get the local crate using rustc_public API.
+    let local = rustc_public::local_crate();
     assert_eq!(&local.name, CRATE_NAME);
 
-    assert_eq!(stable_mir::entry_fn(), None);
+    assert_eq!(rustc_public::entry_fn(), None);
 
     // Find items in the local crate.
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     assert!(get_item(&items, (DefKind::Fn, "foo::bar")).is_some());
 
     // Find the `std` crate and assert that there is only one of it.
-    assert!(stable_mir::find_crates("std").len() == 1);
+    assert!(rustc_public::find_crates("std").len() == 1);
 
     let bar = get_item(&items, (DefKind::Fn, "bar")).unwrap();
     let body = bar.expect_body();
@@ -50,11 +50,11 @@ fn test_stable_mir() -> ControlFlow<()> {
     let block = &body.blocks[0];
     assert_eq!(block.statements.len(), 1);
     match &block.statements[0].kind {
-        stable_mir::mir::StatementKind::Assign(..) => {}
+        rustc_public::mir::StatementKind::Assign(..) => {}
         other => panic!("{other:?}"),
     }
     match &block.terminator.kind {
-        stable_mir::mir::TerminatorKind::Return => {}
+        rustc_public::mir::TerminatorKind::Return => {}
         other => panic!("{other:?}"),
     }
 
@@ -64,7 +64,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.blocks.len(), 4);
     let block = &body.blocks[0];
     match &block.terminator.kind {
-        stable_mir::mir::TerminatorKind::Call { .. } => {}
+        rustc_public::mir::TerminatorKind::Call { .. } => {}
         other => panic!("{other:?}"),
     }
 
@@ -73,28 +73,32 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.locals().len(), 6);
     assert_matches!(
         body.locals()[0].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Bool)
     );
     assert_matches!(
         body.locals()[1].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Bool)
     );
     assert_matches!(
         body.locals()[2].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Char)
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Char)
     );
     assert_matches!(
         body.locals()[3].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Int(stable_mir::ty::IntTy::I32))
+        rustc_public::ty::TyKind::RigidTy(
+            rustc_public::ty::RigidTy::Int(rustc_public::ty::IntTy::I32)
+        )
     );
     assert_matches!(
         body.locals()[4].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Uint(stable_mir::ty::UintTy::U64))
+        rustc_public::ty::TyKind::RigidTy(
+            rustc_public::ty::RigidTy::Uint(rustc_public::ty::UintTy::U64)
+        )
     );
     assert_matches!(
         body.locals()[5].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Float(
-            stable_mir::ty::FloatTy::F64
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Float(
+            rustc_public::ty::FloatTy::F64
         ))
     );
 
@@ -103,7 +107,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.blocks.len(), 2);
     let block = &body.blocks[0];
     match &block.terminator.kind {
-        stable_mir::mir::TerminatorKind::Drop { .. } => {}
+        rustc_public::mir::TerminatorKind::Drop { .. } => {}
         other => panic!("{other:?}"),
     }
 
@@ -112,7 +116,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.blocks.len(), 2);
     let block = &body.blocks[0];
     match &block.terminator.kind {
-        stable_mir::mir::TerminatorKind::Assert { .. } => {}
+        rustc_public::mir::TerminatorKind::Assert { .. } => {}
         other => panic!("{other:?}"),
     }
 
@@ -120,7 +124,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     let instance = Instance::try_from(monomorphic.clone()).unwrap();
     for block in instance.body().unwrap().blocks {
         match &block.terminator.kind {
-            stable_mir::mir::TerminatorKind::Call { func, .. } => {
+            rustc_public::mir::TerminatorKind::Call { func, .. } => {
                 let TyKind::RigidTy(ty) = func.ty(&body.locals()).unwrap().kind() else {
                     unreachable!()
                 };
@@ -131,7 +135,7 @@ fn test_stable_mir() -> ControlFlow<()> {
                     other => panic!("{other:?}"),
                 }
             }
-            stable_mir::mir::TerminatorKind::Return => {}
+            rustc_public::mir::TerminatorKind::Return => {}
             other => panic!("{other:?}"),
         }
     }
@@ -145,22 +149,26 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.locals().len(), 4);
     assert_matches!(
         body.ret_local().ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Char)
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Char)
     );
     assert_eq!(body.arg_locals().len(), 2);
     assert_matches!(
         body.arg_locals()[0].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Int(stable_mir::ty::IntTy::I32))
+        rustc_public::ty::TyKind::RigidTy(
+            rustc_public::ty::RigidTy::Int(rustc_public::ty::IntTy::I32)
+        )
     );
     assert_matches!(
         body.arg_locals()[1].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Uint(stable_mir::ty::UintTy::U64))
+        rustc_public::ty::TyKind::RigidTy(
+            rustc_public::ty::RigidTy::Uint(rustc_public::ty::UintTy::U64)
+        )
     );
     assert_eq!(body.inner_locals().len(), 1);
     // If conditions have an extra inner local to hold their results
     assert_matches!(
         body.inner_locals()[0].ty.kind(),
-        stable_mir::ty::TyKind::RigidTy(stable_mir::ty::RigidTy::Bool)
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Bool)
     );
 
     ControlFlow::Continue(())
@@ -168,9 +176,9 @@ fn test_stable_mir() -> ControlFlow<()> {
 
 // Use internal API to find a function in a crate.
 fn get_item<'a>(
-    items: &'a stable_mir::CrateItems,
+    items: &'a rustc_public::CrateItems,
     item: (DefKind, &str),
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| {
         matches!(
             (item.0, crate_item.kind()),
diff --git a/tests/ui-fulldeps/stable-mir/projections.rs b/tests/ui-fulldeps/stable-mir/projections.rs
index f8104287700..3b360cd2fcf 100644
--- a/tests/ui-fulldeps/stable-mir/projections.rs
+++ b/tests/ui-fulldeps/stable-mir/projections.rs
@@ -15,12 +15,12 @@ extern crate rustc_middle;
 extern crate rustc_driver;
 extern crate rustc_interface;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::ItemKind;
-use stable_mir::crate_def::CrateDef;
-use stable_mir::mir::{ProjectionElem, Rvalue, StatementKind};
-use stable_mir::ty::{RigidTy, TyKind, UintTy};
+use rustc_public::ItemKind;
+use rustc_public::crate_def::CrateDef;
+use rustc_public::mir::{ProjectionElem, Rvalue, StatementKind};
+use rustc_public::ty::{RigidTy, TyKind, UintTy};
 use std::assert_matches::assert_matches;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -29,15 +29,15 @@ const CRATE_NAME: &str = "input";
 
 /// Tests projections within Place objects
 fn test_place_projections() -> ControlFlow<()> {
-    let items = stable_mir::all_local_items();
+    let items = rustc_public::all_local_items();
     let body = get_item(&items, (ItemKind::Fn, "projections")).unwrap().expect_body();
     assert_eq!(body.blocks.len(), 4);
     // The first statement assigns `&s.c` to a local. The projections include a deref for `s`, since
     // `s` is passed as a reference argument, and a field access for field `c`.
     match &body.blocks[0].statements[0].kind {
         StatementKind::Assign(
-            place @ stable_mir::mir::Place { local: _, projection: local_proj },
-            Rvalue::Ref(_, _, stable_mir::mir::Place { local: _, projection: r_proj }),
+            place @ rustc_public::mir::Place { local: _, projection: local_proj },
+            Rvalue::Ref(_, _, rustc_public::mir::Place { local: _, projection: r_proj }),
         ) => {
             // We can't match on vecs, only on slices. Comparing statements for equality wouldn't be
             // any easier since we'd then have to add in the expected local and region values
@@ -48,7 +48,7 @@ fn test_place_projections() -> ControlFlow<()> {
                 [ProjectionElem::Deref, ProjectionElem::Field(2, ty)] => {
                     assert_matches!(
                         ty.kind(),
-                        TyKind::RigidTy(RigidTy::Uint(stable_mir::ty::UintTy::U8))
+                        TyKind::RigidTy(RigidTy::Uint(rustc_public::ty::UintTy::U8))
                     );
                     let ty = place.ty(body.locals()).unwrap();
                     assert_matches!(ty.kind().rigid(), Some(RigidTy::Ref(..)));
@@ -70,8 +70,8 @@ fn test_place_projections() -> ControlFlow<()> {
     // since `slice` is a reference, and an index.
     match &body.blocks[2].statements[0].kind {
         StatementKind::Assign(
-            place @ stable_mir::mir::Place { local: _, projection: local_proj },
-            Rvalue::Use(stable_mir::mir::Operand::Copy(stable_mir::mir::Place {
+            place @ rustc_public::mir::Place { local: _, projection: local_proj },
+            Rvalue::Use(rustc_public::mir::Operand::Copy(rustc_public::mir::Place {
                 local: _,
                 projection: r_proj,
             })),
@@ -93,18 +93,18 @@ fn test_place_projections() -> ControlFlow<()> {
     // The first terminator gets a slice of an array via the Index operation. Specifically it
     // performs `&vals[1..3]`. There are no projections in this case, the arguments are just locals.
     match &body.blocks[0].terminator.kind {
-        stable_mir::mir::TerminatorKind::Call { args, .. } =>
+        rustc_public::mir::TerminatorKind::Call { args, .. } =>
         // We can't match on vecs, only on slices. Comparing for equality wouldn't be any easier
         // since we'd then have to add in the expected local values instead of matching on
         // wildcards.
         {
             match &args[..] {
                 [
-                    stable_mir::mir::Operand::Move(stable_mir::mir::Place {
+                    rustc_public::mir::Operand::Move(rustc_public::mir::Place {
                         local: _,
                         projection: arg1_proj,
                     }),
-                    stable_mir::mir::Operand::Move(stable_mir::mir::Place {
+                    rustc_public::mir::Operand::Move(rustc_public::mir::Place {
                         local: _,
                         projection: arg2_proj,
                     }),
@@ -133,9 +133,9 @@ fn test_place_projections() -> ControlFlow<()> {
 
 // Use internal API to find a function in a crate.
 fn get_item<'a>(
-    items: &'a stable_mir::CrateItems,
+    items: &'a rustc_public::CrateItems,
     item: (ItemKind, &str),
-) -> Option<&'a stable_mir::CrateItem> {
+) -> Option<&'a rustc_public::CrateItem> {
     items.iter().find(|crate_item| crate_item.kind() == item.0 && crate_item.name() == item.1)
 }
 
diff --git a/tests/ui-fulldeps/stable-mir/smir_internal.rs b/tests/ui-fulldeps/stable-mir/smir_internal.rs
index 287f4353d51..dd70cfe5f5e 100644
--- a/tests/ui-fulldeps/stable-mir/smir_internal.rs
+++ b/tests/ui-fulldeps/stable-mir/smir_internal.rs
@@ -14,17 +14,17 @@ extern crate rustc_driver;
 extern crate rustc_interface;
 extern crate rustc_middle;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use rustc_middle::ty::TyCtxt;
-use stable_mir::rustc_internal;
+use rustc_public::rustc_internal;
 use std::io::Write;
 use std::ops::ControlFlow;
 
 const CRATE_NAME: &str = "input";
 
 fn test_translation(tcx: TyCtxt<'_>) -> ControlFlow<()> {
-    let main_fn = stable_mir::entry_fn().unwrap();
+    let main_fn = rustc_public::entry_fn().unwrap();
     let body = main_fn.expect_body();
     let orig_ty = body.locals()[0].ty;
     let rustc_ty = rustc_internal::internal(tcx, &orig_ty);
diff --git a/tests/ui-fulldeps/stable-mir/smir_serde.rs b/tests/ui-fulldeps/stable-mir/smir_serde.rs
index c2f00e56c2c..31642c6cb94 100644
--- a/tests/ui-fulldeps/stable-mir/smir_serde.rs
+++ b/tests/ui-fulldeps/stable-mir/smir_serde.rs
@@ -16,11 +16,11 @@ extern crate rustc_middle;
 extern crate serde;
 extern crate serde_json;
 #[macro_use]
-extern crate stable_mir;
+extern crate rustc_public;
 
 use rustc_middle::ty::TyCtxt;
 use serde_json::to_string;
-use stable_mir::mir::Body;
+use rustc_public::mir::Body;
 use std::io::{BufWriter, Write};
 use std::ops::ControlFlow;
 
@@ -29,9 +29,9 @@ const CRATE_NAME: &str = "input";
 fn serialize_to_json(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
     let path = "output.json";
     let mut writer = BufWriter::new(std::fs::File::create(path).expect("Failed to create path"));
-    let local_crate = stable_mir::local_crate();
+    let local_crate = rustc_public::local_crate();
     let items: Vec<Body> =
-        stable_mir::all_local_items().iter().map(|item| item.expect_body()).collect();
+        rustc_public::all_local_items().iter().map(|item| item.expect_body()).collect();
     let crate_data = (local_crate.name, items);
     writer
         .write_all(to_string(&crate_data).expect("serde_json failed").as_bytes())
diff --git a/tests/ui-fulldeps/stable-mir/smir_visitor.rs b/tests/ui-fulldeps/stable-mir/smir_visitor.rs
index 46f85a992ef..66787e2927b 100644
--- a/tests/ui-fulldeps/stable-mir/smir_visitor.rs
+++ b/tests/ui-fulldeps/stable-mir/smir_visitor.rs
@@ -13,11 +13,11 @@ extern crate rustc_middle;
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate stable_mir;
+extern crate rustc_public;
 
-use stable_mir::mir::MirVisitor;
-use stable_mir::mir::MutMirVisitor;
-use stable_mir::*;
+use rustc_public::mir::MirVisitor;
+use rustc_public::mir::MutMirVisitor;
+use rustc_public::*;
 use std::collections::HashSet;
 use std::io::Write;
 use std::ops::ControlFlow;
@@ -25,7 +25,7 @@ use std::ops::ControlFlow;
 const CRATE_NAME: &str = "input";
 
 fn test_visitor() -> ControlFlow<()> {
-    let main_fn = stable_mir::entry_fn();
+    let main_fn = rustc_public::entry_fn();
     let main_body = main_fn.unwrap().expect_body();
     let main_visitor = TestVisitor::collect(&main_body);
     assert!(main_visitor.ret_val.is_some());
@@ -99,7 +99,7 @@ impl<'a> mir::MirVisitor for TestVisitor<'a> {
 }
 
 fn test_mut_visitor() -> ControlFlow<()> {
-    let main_fn = stable_mir::entry_fn();
+    let main_fn = rustc_public::entry_fn();
     let mut main_body = main_fn.unwrap().expect_body();
     let locals = main_body.locals().to_vec();
     let mut main_visitor = TestMutVisitor::collect(locals);
diff --git a/tests/ui/SUMMARY.md b/tests/ui/SUMMARY.md
index 8de74d41f39..1aeb0fcfbea 100644
--- a/tests/ui/SUMMARY.md
+++ b/tests/ui/SUMMARY.md
@@ -410,7 +410,7 @@ These tests revolve around command-line flags which change the way error/warning
 
 ## `tests/ui/diagnostic_namespace/`
 
-Exercises `#[diagnostic::*]` namespaced attributes. See [RFC 3368 Diagnostic attribute namepsace](https://github.com/rust-lang/rfcs/blob/master/text/3368-diagnostic-attribute-namespace.md).
+Exercises `#[diagnostic::*]` namespaced attributes. See [RFC 3368 Diagnostic attribute namespace](https://github.com/rust-lang/rfcs/blob/master/text/3368-diagnostic-attribute-namespace.md).
 
 ## `tests/ui/diagnostic-width/`: `--diagnostic-width`
 
diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr
index f16ba706485..3dc3c32c936 100644
--- a/tests/ui/attributes/malformed-attrs.stderr
+++ b/tests/ui/attributes/malformed-attrs.stderr
@@ -22,12 +22,6 @@ error[E0463]: can't find crate for `wloop`
 LL | extern crate wloop;
    | ^^^^^^^^^^^^^^^^^^^ can't find crate
 
-error: malformed `omit_gdb_pretty_printer_section` attribute input
-  --> $DIR/malformed-attrs.rs:26:1
-   |
-LL | #![omit_gdb_pretty_printer_section = 1]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![omit_gdb_pretty_printer_section]`
-
 error: malformed `windows_subsystem` attribute input
   --> $DIR/malformed-attrs.rs:29:1
    |
@@ -116,12 +110,6 @@ error: malformed `cfi_encoding` attribute input
 LL | #[cfi_encoding]
    | ^^^^^^^^^^^^^^^ help: must be of the form: `#[cfi_encoding = "encoding"]`
 
-error: malformed `link_ordinal` attribute input
-  --> $DIR/malformed-attrs.rs:167:5
-   |
-LL |     #[link_ordinal]
-   |     ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_ordinal(ordinal)]`
-
 error: malformed `linkage` attribute input
   --> $DIR/malformed-attrs.rs:173:5
    |
@@ -164,12 +152,6 @@ error: malformed `debugger_visualizer` attribute input
 LL | #[debugger_visualizer]
    | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]`
 
-error: malformed `automatically_derived` attribute input
-  --> $DIR/malformed-attrs.rs:191:1
-   |
-LL | #[automatically_derived = 18]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[automatically_derived]`
-
 error: malformed `thread_local` attribute input
   --> $DIR/malformed-attrs.rs:203:1
    |
@@ -283,6 +265,15 @@ LL | #[debugger_visualizer]
    = note: OR
    = note: expected: `gdb_script_file = "..."`
 
+error[E0565]: malformed `omit_gdb_pretty_printer_section` attribute input
+  --> $DIR/malformed-attrs.rs:26:1
+   |
+LL | #![omit_gdb_pretty_printer_section = 1]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^
+   | |                                  |
+   | |                                  didn't expect any arguments here
+   | help: must be of the form: `#[omit_gdb_pretty_printer_section]`
+
 error[E0539]: malformed `export_name` attribute input
   --> $DIR/malformed-attrs.rs:32:1
    |
@@ -537,6 +528,15 @@ LL |     #[unsafe(ffi_pure = 1)]
    |     |                 didn't expect any arguments here
    |     help: must be of the form: `#[ffi_pure]`
 
+error[E0539]: malformed `link_ordinal` attribute input
+  --> $DIR/malformed-attrs.rs:167:5
+   |
+LL |     #[link_ordinal]
+   |     ^^^^^^^^^^^^^^^
+   |     |
+   |     expected this to be a list
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
+
 error[E0565]: malformed `ffi_const` attribute input
   --> $DIR/malformed-attrs.rs:171:5
    |
@@ -546,6 +546,15 @@ LL |     #[unsafe(ffi_const = 1)]
    |     |                  didn't expect any arguments here
    |     help: must be of the form: `#[ffi_const]`
 
+error[E0565]: malformed `automatically_derived` attribute input
+  --> $DIR/malformed-attrs.rs:191:1
+   |
+LL | #[automatically_derived = 18]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^----^
+   | |                       |
+   | |                       didn't expect any arguments here
+   | help: must be of the form: `#[automatically_derived]`
+
 error[E0565]: malformed `non_exhaustive` attribute input
   --> $DIR/malformed-attrs.rs:197:1
    |
diff --git a/tests/ui/consts/issue-90870.stderr b/tests/ui/consts/issue-90870.stderr
index 60993f25864..c5a78531026 100644
--- a/tests/ui/consts/issue-90870.stderr
+++ b/tests/ui/consts/issue-90870.stderr
@@ -5,7 +5,7 @@ LL |     a == b
    |     ^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 help: consider dereferencing here
@@ -31,7 +31,7 @@ LL |     a == b
    |     ^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 help: consider dereferencing here
@@ -57,7 +57,7 @@ LL |         if l == r {
    |            ^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 help: consider dereferencing here
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
index 49c666f498f..4cba54bf67c 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
@@ -121,21 +121,6 @@ LL - #![rustc_main]
 LL + #[rustc_main]
    |
 
-error: `automatically_derived` attribute cannot be used at crate level
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:23:1
-   |
-LL | #![automatically_derived]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL | mod inline {
-   |     ------ the inner attribute doesn't annotate this module
-   |
-help: perhaps you meant to use an outer attribute
-   |
-LL - #![automatically_derived]
-LL + #[automatically_derived]
-   |
-
 error: `repr` attribute cannot be used at crate level
   --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
    |
@@ -166,6 +151,21 @@ LL - #![path = "3800"]
 LL + #[path = "3800"]
    |
 
+error: `automatically_derived` attribute cannot be used at crate level
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:23:1
+   |
+LL | #![automatically_derived]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | mod inline {
+   |     ------ the inner attribute doesn't annotate this module
+   |
+help: perhaps you meant to use an outer attribute
+   |
+LL - #![automatically_derived]
+LL + #[automatically_derived]
+   |
+
 error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:42:17
    |
diff --git a/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr b/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr
index d4b5b47b41b..deab31c251f 100644
--- a/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr
+++ b/tests/ui/impl-trait/precise-capturing/bound-modifiers.stderr
@@ -63,7 +63,7 @@ error[E0658]: const trait impls are experimental
 LL | fn constness() -> impl Sized + const use<> {}
    |                                ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs
index 9b7e8d70743..87b4999c5f9 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.rs
@@ -1,10 +1,10 @@
 #[link(name = "foo")]
 extern "C" {
     #[link_ordinal("JustMonika")]
-    //~^ ERROR illegal ordinal format in `link_ordinal`
+    //~^ ERROR malformed `link_ordinal` attribute input
     fn foo();
     #[link_ordinal("JustMonika")]
-    //~^ ERROR illegal ordinal format in `link_ordinal`
+    //~^ ERROR malformed `link_ordinal` attribute input
     static mut imported_variable: i32;
 }
 
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr
index 6341e57a0be..ffae30aabcc 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr
@@ -1,18 +1,21 @@
-error: illegal ordinal format in `link_ordinal`
+error[E0539]: malformed `link_ordinal` attribute input
   --> $DIR/link-ordinal-invalid-format.rs:3:5
    |
 LL |     #[link_ordinal("JustMonika")]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: an unsuffixed integer value, e.g., `1`, is expected
+   |     ^^^^^^^^^^^^^^^------------^^
+   |     |              |
+   |     |              expected an integer literal here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
-error: illegal ordinal format in `link_ordinal`
+error[E0539]: malformed `link_ordinal` attribute input
   --> $DIR/link-ordinal-invalid-format.rs:6:5
    |
 LL |     #[link_ordinal("JustMonika")]
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: an unsuffixed integer value, e.g., `1`, is expected
+   |     ^^^^^^^^^^^^^^^------------^^
+   |     |              |
+   |     |              expected an integer literal here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0539`.
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs
index 6b8cd49566d..2a8b9ebacf7 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs
@@ -1,10 +1,12 @@
 #[link(name = "foo")]
 extern "C" {
     #[link_ordinal()]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+    //~^ ERROR malformed `link_ordinal` attribute input
+    //~| NOTE  expected a single argument
     fn foo();
     #[link_ordinal()]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+    //~^ ERROR malformed `link_ordinal` attribute input
+    //~| NOTE  expected a single argument
     static mut imported_variable: i32;
 }
 
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr
index 1b04bb228e7..c6b8a18d03a 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr
@@ -1,18 +1,21 @@
-error: incorrect number of arguments to `#[link_ordinal]`
+error[E0805]: malformed `link_ordinal` attribute input
   --> $DIR/link-ordinal-missing-argument.rs:3:5
    |
 LL |     #[link_ordinal()]
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
+   |     ^^^^^^^^^^^^^^--^
+   |     |             |
+   |     |             expected a single argument here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-missing-argument.rs:6:5
+error[E0805]: malformed `link_ordinal` attribute input
+  --> $DIR/link-ordinal-missing-argument.rs:7:5
    |
 LL |     #[link_ordinal()]
-   |     ^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
+   |     ^^^^^^^^^^^^^^--^
+   |     |             |
+   |     |             expected a single argument here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0805`.
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs
index 9988115fd8b..ddf9583352f 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs
@@ -1,10 +1,12 @@
 #[link(name = "foo")]
 extern "C" {
     #[link_ordinal(3, 4)]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+    //~^ ERROR malformed `link_ordinal` attribute input
+    //~| NOTE  expected a single argument
     fn foo();
     #[link_ordinal(3, 4)]
-    //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+    //~^ ERROR malformed `link_ordinal` attribute input
+    //~| NOTE  expected a single argument
     static mut imported_variable: i32;
 }
 
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr
index d5ce8aff34f..7d63304f598 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr
+++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr
@@ -1,18 +1,21 @@
-error: incorrect number of arguments to `#[link_ordinal]`
+error[E0805]: malformed `link_ordinal` attribute input
   --> $DIR/link-ordinal-too-many-arguments.rs:3:5
    |
 LL |     #[link_ordinal(3, 4)]
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
+   |     ^^^^^^^^^^^^^^------^
+   |     |             |
+   |     |             expected a single argument here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
-error: incorrect number of arguments to `#[link_ordinal]`
-  --> $DIR/link-ordinal-too-many-arguments.rs:6:5
+error[E0805]: malformed `link_ordinal` attribute input
+  --> $DIR/link-ordinal-too-many-arguments.rs:7:5
    |
 LL |     #[link_ordinal(3, 4)]
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: the attribute requires exactly one argument
+   |     ^^^^^^^^^^^^^^------^
+   |     |             |
+   |     |             expected a single argument here
+   |     help: must be of the form: `#[link_ordinal(ordinal)]`
 
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0805`.
diff --git a/tests/ui/lint/unused/unused-attr-duplicate.stderr b/tests/ui/lint/unused/unused-attr-duplicate.stderr
index 2310c12c80b..6db6af823f4 100644
--- a/tests/ui/lint/unused/unused-attr-duplicate.stderr
+++ b/tests/ui/lint/unused/unused-attr-duplicate.stderr
@@ -41,18 +41,6 @@ LL | #[should_panic]
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 error: unused attribute
-  --> $DIR/unused-attr-duplicate.rs:70:1
-   |
-LL | #[automatically_derived]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
-   |
-note: attribute also specified here
-  --> $DIR/unused-attr-duplicate.rs:69:1
-   |
-LL | #[automatically_derived]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: unused attribute
   --> $DIR/unused-attr-duplicate.rs:14:1
    |
 LL | #![crate_name = "unused_attr_duplicate2"]
@@ -191,6 +179,18 @@ LL | #[non_exhaustive]
    | ^^^^^^^^^^^^^^^^^
 
 error: unused attribute
+  --> $DIR/unused-attr-duplicate.rs:70:1
+   |
+LL | #[automatically_derived]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+note: attribute also specified here
+  --> $DIR/unused-attr-duplicate.rs:69:1
+   |
+LL | #[automatically_derived]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: unused attribute
   --> $DIR/unused-attr-duplicate.rs:74:1
    |
 LL | #[inline(never)]
diff --git a/tests/ui/traits/const-traits/cross-crate.stock.stderr b/tests/ui/traits/const-traits/cross-crate.stock.stderr
index 7cdde5a079f..44a60c99ae9 100644
--- a/tests/ui/traits/const-traits/cross-crate.stock.stderr
+++ b/tests/ui/traits/const-traits/cross-crate.stock.stderr
@@ -5,7 +5,7 @@ LL |     Const.func();
    |           ^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/cross-crate.stocknc.stderr b/tests/ui/traits/const-traits/cross-crate.stocknc.stderr
index fb47bf9169f..766c20aa821 100644
--- a/tests/ui/traits/const-traits/cross-crate.stocknc.stderr
+++ b/tests/ui/traits/const-traits/cross-crate.stocknc.stderr
@@ -13,7 +13,7 @@ LL |     Const.func();
    |           ^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/feature-gate.stock.stderr b/tests/ui/traits/const-traits/feature-gate.stock.stderr
index f9d966f0362..f3ba3039a23 100644
--- a/tests/ui/traits/const-traits/feature-gate.stock.stderr
+++ b/tests/ui/traits/const-traits/feature-gate.stock.stderr
@@ -4,7 +4,7 @@ error[E0658]: const trait impls are experimental
 LL | impl const T for S {}
    |      ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -14,7 +14,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn f<A: [const] T>() {}
    |               ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -24,7 +24,7 @@ error[E0658]: const trait impls are experimental
 LL | fn g<A: const T>() {}
    |         ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -34,7 +34,7 @@ error[E0658]: const trait impls are experimental
 LL | discard! { impl [const] T }
    |                 ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -44,7 +44,7 @@ error[E0658]: const trait impls are experimental
 LL | discard! { impl const T }
    |                 ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -54,7 +54,7 @@ error[E0658]: `const_trait` is a temporary placeholder for marking a trait that
 LL | #[const_trait]
    | ^^^^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.stderr b/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.stderr
index bc0e48112b9..a4e77154b17 100644
--- a/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.stderr
+++ b/tests/ui/traits/const-traits/macro-bare-trait-objects-const-trait-bounds.stderr
@@ -13,7 +13,7 @@ error[E0658]: const trait impls are experimental
 LL | check! { [const] Trait }
    |           ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr
index 5dd648554c9..b500e4858d1 100644
--- a/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr
+++ b/tests/ui/traits/const-traits/macro-const-trait-bound-theoretical-regression.stderr
@@ -26,7 +26,7 @@ error[E0658]: const trait impls are experimental
 LL | demo! { impl const Trait }
    |              ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -36,7 +36,7 @@ error[E0658]: const trait impls are experimental
 LL | demo! { dyn const Trait }
    |             ^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/staged-api-user-crate.stderr b/tests/ui/traits/const-traits/staged-api-user-crate.stderr
index 8ac83770cf7..81611da9e74 100644
--- a/tests/ui/traits/const-traits/staged-api-user-crate.stderr
+++ b/tests/ui/traits/const-traits/staged-api-user-crate.stderr
@@ -5,7 +5,7 @@ LL |     Unstable::func();
    |     ^^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/staged-api.stderr b/tests/ui/traits/const-traits/staged-api.stderr
index 4756c490cb1..3e85834eb94 100644
--- a/tests/ui/traits/const-traits/staged-api.stderr
+++ b/tests/ui/traits/const-traits/staged-api.stderr
@@ -21,7 +21,7 @@ error: trait implementations cannot be const stable yet
 LL | impl const U for u16 {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error: const stability on the impl does not match the const stability on the trait
   --> $DIR/staged-api.rs:102:1
@@ -46,7 +46,7 @@ error: trait implementations cannot be const stable yet
 LL | impl const S for u16 {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error: const stability on the impl does not match the const stability on the trait
   --> $DIR/staged-api.rs:117:1
diff --git a/tests/ui/traits/const-traits/std-impl-gate.stock.stderr b/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
index 1fa71e41a98..261f68bebdb 100644
--- a/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
+++ b/tests/ui/traits/const-traits/std-impl-gate.stock.stderr
@@ -5,7 +5,7 @@ LL |     Default::default()
    |     ^^^^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
index eb1beb41e37..3f48375dd04 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr
@@ -16,7 +16,7 @@ error[E0658]: const trait impls are experimental
 LL | trait Bar: [const] Foo {}
    |            ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -26,7 +26,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn foo<T: [const] Bar>(x: &T) {
    |                 ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
index eb1beb41e37..3f48375dd04 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr
@@ -16,7 +16,7 @@ error[E0658]: const trait impls are experimental
 LL | trait Bar: [const] Foo {}
    |            ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -26,7 +26,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn foo<T: [const] Bar>(x: &T) {
    |                 ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr
index 7c465731a99..b00ad706a5f 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr
@@ -4,7 +4,7 @@ error[E0658]: const trait impls are experimental
 LL | trait Bar: [const] Foo {}
    |            ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -14,7 +14,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn foo<T: [const] Bar>(x: &T) {
    |                 ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -24,7 +24,7 @@ error[E0658]: `const_trait` is a temporary placeholder for marking a trait that
 LL | #[cfg_attr(any(yyy, yyn, nyy, nyn), const_trait)]
    |                                     ^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -34,7 +34,7 @@ error[E0658]: `const_trait` is a temporary placeholder for marking a trait that
 LL | #[cfg_attr(any(yyy, yny, nyy, nyn), const_trait)]
    |                                     ^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -45,7 +45,7 @@ LL |     x.a();
    |       ^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr
index 7c465731a99..b00ad706a5f 100644
--- a/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr
+++ b/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr
@@ -4,7 +4,7 @@ error[E0658]: const trait impls are experimental
 LL | trait Bar: [const] Foo {}
    |            ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -14,7 +14,7 @@ error[E0658]: const trait impls are experimental
 LL | const fn foo<T: [const] Bar>(x: &T) {
    |                 ^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -24,7 +24,7 @@ error[E0658]: `const_trait` is a temporary placeholder for marking a trait that
 LL | #[cfg_attr(any(yyy, yyn, nyy, nyn), const_trait)]
    |                                     ^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -34,7 +34,7 @@ error[E0658]: `const_trait` is a temporary placeholder for marking a trait that
 LL | #[cfg_attr(any(yyy, yny, nyy, nyn), const_trait)]
    |                                     ^^^^^^^^^^^
    |
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -45,7 +45,7 @@ LL |     x.a();
    |       ^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-   = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/triagebot.toml b/triagebot.toml
index 125617fce74..75e794c700d 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -1050,8 +1050,8 @@ cc = ["@davidtwco", "@compiler-errors", "@TaKO8Ki"]
 message = "`rustc_macros::diagnostics` was changed"
 cc = ["@davidtwco", "@compiler-errors", "@TaKO8Ki"]
 
-[mentions."compiler/stable_mir"]
-message = "This PR changes Stable MIR"
+[mentions."compiler/rustc_public"]
+message = "This PR changes rustc_public"
 cc = ["@oli-obk", "@celinval", "@ouz-a"]
 
 [mentions."compiler/rustc_target/src/spec"]
@@ -1445,7 +1445,7 @@ dep-bumps = [
 "/compiler/rustc_const_eval/src/interpret" =             ["compiler", "mir"]
 "/compiler/rustc_mir_build/src/builder" =                ["compiler", "mir"]
 "/compiler/rustc_mir_transform" =                        ["compiler", "mir", "mir-opt"]
-"/compiler/rustc_smir" =                                 ["project-stable-mir"]
+"/compiler/rustc_public_bridge" =                        ["project-stable-mir"]
 "/compiler/rustc_parse" =                                ["compiler", "parser"]
 "/compiler/rustc_parse/src/lexer" =                      ["compiler", "lexer"]
 "/compiler/rustc_query_impl" =                           ["compiler", "query-system"]
@@ -1455,7 +1455,7 @@ dep-bumps = [
 "/compiler/rustc_trait_selection" =                      ["compiler", "types"]
 "/compiler/rustc_traits" =                               ["compiler", "types"]
 "/compiler/rustc_type_ir" =                              ["compiler", "types"]
-"/compiler/stable_mir" =                                 ["project-stable-mir"]
+"/compiler/rustc_public" =                               ["project-stable-mir"]
 "/library/alloc" =                                       ["libs"]
 "/library/core" =                                        ["libs", "@scottmcm"]
 "/library/panic_abort" =                                 ["libs"]