Skip to content

Commit 408ae0f

Browse files
committed
Feed resolutions query instead of it being a thin wrapper around an untracked field
1 parent 222d1ff commit 408ae0f

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

compiler/rustc_interface/src/passes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,6 @@ pub fn create_global_ctxt<'tcx>(
817817
lint_store,
818818
arena,
819819
hir_arena,
820-
untracked_resolutions,
821820
untracked,
822821
krate,
823822
dep_graph,
@@ -832,8 +831,9 @@ pub fn create_global_ctxt<'tcx>(
832831

833832
let mut qcx = QueryContext { gcx };
834833
qcx.enter(|tcx| {
835-
tcx.feed_unit_query()
836-
.resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)))
834+
let feed = tcx.feed_unit_query();
835+
feed.resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)));
836+
feed.resolutions(tcx.arena.alloc(untracked_resolutions));
837837
});
838838
qcx
839839
}

compiler/rustc_middle/src/arena.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ macro_rules! arena_types {
3131
[decode] borrowck_result:
3232
rustc_middle::mir::BorrowCheckResult<'tcx>,
3333
[] resolver: rustc_data_structures::steal::Steal<rustc_middle::ty::ResolverAstLowering>,
34+
[] resolutions: rustc_middle::ty::ResolverGlobalCtxt,
3435
[decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
3536
[decode] code_region: rustc_middle::mir::coverage::CodeRegion,
3637
[] const_allocs: rustc_middle::mir::interpret::Allocation,

compiler/rustc_middle/src/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rustc_queries! {
2727
}
2828

2929
query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
30-
eval_always
30+
feedable
3131
no_hash
3232
desc { "getting the resolver outputs" }
3333
}

compiler/rustc_middle/src/ty/context.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,7 @@ pub struct GlobalCtxt<'tcx> {
428428
pub consts: CommonConsts<'tcx>,
429429

430430
untracked: Untracked,
431-
/// Output of the resolver.
432-
pub(crate) untracked_resolutions: ty::ResolverGlobalCtxt,
431+
433432
/// The entire crate as AST. This field serves as the input for the hir_crate query,
434433
/// which lowers it from AST to HIR. It must not be read or used by anything else.
435434
pub untracked_crate: Steal<Lrc<ast::Crate>>,
@@ -592,7 +591,6 @@ impl<'tcx> TyCtxt<'tcx> {
592591
lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
593592
arena: &'tcx WorkerLocal<Arena<'tcx>>,
594593
hir_arena: &'tcx WorkerLocal<hir::Arena<'tcx>>,
595-
untracked_resolutions: ty::ResolverGlobalCtxt,
596594
untracked: Untracked,
597595
krate: Lrc<ast::Crate>,
598596
dep_graph: DepGraph,
@@ -622,7 +620,6 @@ impl<'tcx> TyCtxt<'tcx> {
622620
lifetimes: common_lifetimes,
623621
consts: common_consts,
624622
untracked,
625-
untracked_resolutions,
626623
untracked_crate: Steal::new(krate),
627624
on_disk_cache,
628625
queries,
@@ -2407,7 +2404,6 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
24072404
}
24082405

24092406
pub fn provide(providers: &mut ty::query::Providers) {
2410-
providers.resolutions = |tcx, ()| &tcx.untracked_resolutions;
24112407
providers.module_reexports =
24122408
|tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
24132409
providers.crate_name = |tcx, id| {

0 commit comments

Comments
 (0)