about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-03-26 16:52:06 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-19 14:16:18 +0000
commitfbc9b94064c611f341d613ce14d321b267b3c298 (patch)
tree601c6bcb511c2c56c26a5e643701ed38ad209a28 /compiler/rustc_interface
parent10be74569ce3f3140e2d035af920ee0e78682407 (diff)
downloadrust-fbc9b94064c611f341d613ce14d321b267b3c298.tar.gz
rust-fbc9b94064c611f341d613ce14d321b267b3c298.zip
Move `stable_crate_ids` from `CrateStore` to `Untracked`
This way it's like `Definitions`, which creates `DefId`s by interning `DefPathData`s, but for interning stable crate hashes
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/queries.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index ee677a092e2..375a390948b 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -8,7 +8,7 @@ use rustc_codegen_ssa::CodegenResults;
 use rustc_data_structures::steal::Steal;
 use rustc_data_structures::svh::Svh;
 use rustc_data_structures::sync::{AppendOnlyIndexVec, FreezeLock, OnceLock, WorkerLocal};
-use rustc_hir::def_id::{StableCrateId, LOCAL_CRATE};
+use rustc_hir::def_id::{StableCrateId, StableCrateIdMap, LOCAL_CRATE};
 use rustc_hir::definitions::Definitions;
 use rustc_incremental::setup_dep_graph;
 use rustc_metadata::creader::CStore;
@@ -140,11 +140,17 @@ impl<'tcx> Queries<'tcx> {
 
             let cstore = FreezeLock::new(Box::new(CStore::new(
                 self.compiler.codegen_backend.metadata_loader(),
-                stable_crate_id,
             )) as _);
             let definitions = FreezeLock::new(Definitions::new(stable_crate_id));
-            let untracked =
-                Untracked { cstore, source_span: AppendOnlyIndexVec::new(), definitions };
+
+            let mut stable_crate_ids = StableCrateIdMap::default();
+            stable_crate_ids.insert(stable_crate_id, LOCAL_CRATE);
+            let untracked = Untracked {
+                cstore,
+                source_span: AppendOnlyIndexVec::new(),
+                definitions,
+                stable_crate_ids: FreezeLock::new(stable_crate_ids),
+            };
 
             let qcx = passes::create_global_ctxt(
                 self.compiler,