diff options
| author | Alex Macleod <alex@macleod.io> | 2025-03-19 02:19:33 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2025-04-10 13:39:23 +0000 |
| commit | f74032621621d32cf59739b00ecc8f7f9510fc28 (patch) | |
| tree | df46c38200f67c9d57296f745bc0c9570b7cba49 /compiler/rustc_interface/src/interface.rs | |
| parent | 87e60a7d285f8ea560189024f85f2b194d1f168f (diff) | |
| download | rust-f74032621621d32cf59739b00ecc8f7f9510fc28.tar.gz rust-f74032621621d32cf59739b00ecc8f7f9510fc28.zip | |
Allow drivers to supply a list of extra symbols to intern
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 3f87b1a547b..5717a2b8743 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -340,6 +340,10 @@ pub struct Config { /// the list of queries. pub override_queries: Option<fn(&Session, &mut Providers)>, + /// An extra set of symbols to add to the symbol interner, the symbol indices + /// will start at [`PREDEFINED_SYMBOLS_COUNT`](rustc_span::symbol::PREDEFINED_SYMBOLS_COUNT) + pub extra_symbols: Vec<&'static str>, + /// This is a callback from the driver that is called to create a codegen backend. /// /// Has no uses within this repository, but is used by bjorn3 for "the @@ -401,6 +405,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se &early_dcx, config.opts.edition, config.opts.unstable_opts.threads, + &config.extra_symbols, SourceMapInputs { file_loader, path_mapping, hash_kind, checksum_hash_kind }, |current_gcx| { // The previous `early_dcx` can't be reused here because it doesn't |
