]> git.lizzy.rs Git - rust.git/commitdiff
Feed `resolutions` query instead of it being a thin wrapper around an untracked field
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 5 Dec 2022 16:19:14 +0000 (16:19 +0000)
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Thu, 12 Jan 2023 17:14:17 +0000 (17:14 +0000)
compiler/rustc_interface/src/passes.rs
compiler/rustc_middle/src/arena.rs
compiler/rustc_middle/src/query/mod.rs
compiler/rustc_middle/src/ty/context.rs

index 86d56385bc9630486eed68198343e07741555ae0..e8656e0dbc2ab705d51e470cb0c00e8cee3ce57b 100644 (file)
@@ -817,7 +817,6 @@ pub fn create_global_ctxt<'tcx>(
                 lint_store,
                 arena,
                 hir_arena,
-                untracked_resolutions,
                 untracked,
                 krate,
                 dep_graph,
@@ -832,8 +831,9 @@ pub fn create_global_ctxt<'tcx>(
 
     let mut qcx = QueryContext { gcx };
     qcx.enter(|tcx| {
-        tcx.feed_unit_query()
-            .resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)))
+        let feed = tcx.feed_unit_query();
+        feed.resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)));
+        feed.resolutions(tcx.arena.alloc(untracked_resolutions));
     });
     qcx
 }
index 75282f958b53b3b738c6498f16600f59209f2698..ca058cc3c6d8de5b56ddb482fc5b2c6dffa95d48 100644 (file)
@@ -31,6 +31,7 @@ macro_rules! arena_types {
             [decode] borrowck_result:
                 rustc_middle::mir::BorrowCheckResult<'tcx>,
             [] resolver: rustc_data_structures::steal::Steal<rustc_middle::ty::ResolverAstLowering>,
+            [] resolutions: rustc_middle::ty::ResolverGlobalCtxt,
             [decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
             [decode] code_region: rustc_middle::mir::coverage::CodeRegion,
             [] const_allocs: rustc_middle::mir::interpret::Allocation,
index 076ce1bdb3486f52604e53a7843c9e45356bf7ba..4315247eace262eac7b0304f24350acf2ddbdcd8 100644 (file)
@@ -27,7 +27,7 @@
     }
 
     query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
-        eval_always
+        feedable
         no_hash
         desc { "getting the resolver outputs" }
     }
index 5de414077a2b134bc8b9c0ac4924cc18f23b9565..276aadcb66be4e4f0cb1394fb3ff7cb188f212e8 100644 (file)
@@ -428,8 +428,7 @@ pub struct GlobalCtxt<'tcx> {
     pub consts: CommonConsts<'tcx>,
 
     untracked: Untracked,
-    /// Output of the resolver.
-    pub(crate) untracked_resolutions: ty::ResolverGlobalCtxt,
+
     /// The entire crate as AST. This field serves as the input for the hir_crate query,
     /// which lowers it from AST to HIR. It must not be read or used by anything else.
     pub untracked_crate: Steal<Lrc<ast::Crate>>,
@@ -592,7 +591,6 @@ pub fn create_global_ctxt(
         lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
         arena: &'tcx WorkerLocal<Arena<'tcx>>,
         hir_arena: &'tcx WorkerLocal<hir::Arena<'tcx>>,
-        untracked_resolutions: ty::ResolverGlobalCtxt,
         untracked: Untracked,
         krate: Lrc<ast::Crate>,
         dep_graph: DepGraph,
@@ -622,7 +620,6 @@ pub fn create_global_ctxt(
             lifetimes: common_lifetimes,
             consts: common_consts,
             untracked,
-            untracked_resolutions,
             untracked_crate: Steal::new(krate),
             on_disk_cache,
             queries,
@@ -2407,7 +2404,6 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
 }
 
 pub fn provide(providers: &mut ty::query::Providers) {
-    providers.resolutions = |tcx, ()| &tcx.untracked_resolutions;
     providers.module_reexports =
         |tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
     providers.crate_name = |tcx, id| {