summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-04-11 13:31:44 +1000
committerGitHub <noreply@github.com>2025-04-11 13:31:44 +1000
commit0abc6c6e9859bc6915ddc76d484117ff626481c6 (patch)
tree0b6437e14ea0a3cb5eb585dbebf0c75c094311f8 /compiler/rustc_driver_impl
parent63df6f1200a133792267bbdf59dda7e4392e2d52 (diff)
parentf74032621621d32cf59739b00ecc8f7f9510fc28 (diff)
downloadrust-0abc6c6e9859bc6915ddc76d484117ff626481c6.tar.gz
rust-0abc6c6e9859bc6915ddc76d484117ff626481c6.zip
Rollup merge of #138682 - Alexendoo:extra-symbols, r=fee1-dead
Allow drivers to supply a list of extra symbols to intern

Allows adding new symbols as `const`s in external drivers, desirable in Clippy so we can use them in patterns to replace code like https://github.com/rust-lang/rust/blob/75530e9f72a1990ed2305e16fd51d02f47048f12/src/tools/clippy/clippy_lints/src/casts/cast_ptr_alignment.rs#L66

The Clippy change adds a couple symbols as a demo, the exact `clippy_utils` API and replacing other usages can be done on the Clippy side to minimise sync conflicts

---

try-job: aarch64-gnu
Diffstat (limited to 'compiler/rustc_driver_impl')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index bbc18c371ea..7d9560ab4c5 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -264,6 +264,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
         hash_untracked_state: None,
         register_lints: None,
         override_queries: None,
+        extra_symbols: Vec::new(),
         make_codegen_backend: None,
         registry: diagnostics_registry(),
         using_internal_features: &USING_INTERNAL_FEATURES,