about summary refs log tree commit diff
path: root/compiler
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
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')
-rw-r--r--compiler/rustc_interface/src/queries.rs8
-rw-r--r--compiler/rustc_middle/src/ty/context.rs7
2 files changed, 4 insertions, 11 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();
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index b5769e6fee2..65ff643ed4b 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -565,13 +565,6 @@ impl<'tcx> TyCtxt<'tcx> {
         TyCtxtFeed { tcx: self, key: () }
     }
 
-    /// Can only be fed before queries are run, and is thus exempt from any
-    /// incremental issues. Do not use except for the initial query feeding.
-    pub fn feed_local_crate(self) -> TyCtxtFeed<'tcx, CrateNum> {
-        self.dep_graph.assert_ignored();
-        TyCtxtFeed { tcx: self, key: LOCAL_CRATE }
-    }
-
     /// Only used in the resolver to register the `CRATE_DEF_ID` `DefId` and feed
     /// some queries for it. It will panic if used twice.
     pub fn create_local_crate_def_id(self, span: Span) -> TyCtxtFeed<'tcx, LocalDefId> {