about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/queries.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-03-27 08:07:23 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-04-19 14:16:18 +0000
commite9a2f8fef181a8aa0145a2665804916effb6365e (patch)
tree4d602fa071b4afd1b016db988c5d22de5ae675f8 /compiler/rustc_interface/src/queries.rs
parent9e63e991e9690122df470f1fd6931a99bcc5e324 (diff)
downloadrust-e9a2f8fef181a8aa0145a2665804916effb6365e.tar.gz
rust-e9a2f8fef181a8aa0145a2665804916effb6365e.zip
Remove `feed_local_crate` in favor of creating the `CrateNum` via `TyCtxt`
Diffstat (limited to 'compiler/rustc_interface/src/queries.rs')
-rw-r--r--compiler/rustc_interface/src/queries.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index 375a390948b..1b9165342d4 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -143,13 +143,12 @@ impl<'tcx> Queries<'tcx> {
             )) as _);
             let definitions = FreezeLock::new(Definitions::new(stable_crate_id));
 
-            let mut stable_crate_ids = StableCrateIdMap::default();
-            stable_crate_ids.insert(stable_crate_id, LOCAL_CRATE);
+            let stable_crate_ids = FreezeLock::new(StableCrateIdMap::default());
             let untracked = Untracked {
                 cstore,
                 source_span: AppendOnlyIndexVec::new(),
                 definitions,
-                stable_crate_ids: FreezeLock::new(stable_crate_ids),
+                stable_crate_ids,
             };
 
             let qcx = passes::create_global_ctxt(
@@ -164,7 +163,8 @@ impl<'tcx> Queries<'tcx> {
             );
 
             qcx.enter(|tcx| {
-                let feed = tcx.feed_local_crate();
+                let feed = tcx.create_crate_num(stable_crate_id).unwrap();
+                assert_eq!(feed.key(), LOCAL_CRATE);
                 feed.crate_name(crate_name);
 
                 let feed = tcx.feed_unit_query();