mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Feed resolutions
query instead of it being a thin wrapper around an untracked field
This commit is contained in:
parent
222d1ff68d
commit
408ae0fcb9
@ -817,7 +817,6 @@ pub fn create_global_ctxt<'tcx>(
|
|||||||
lint_store,
|
lint_store,
|
||||||
arena,
|
arena,
|
||||||
hir_arena,
|
hir_arena,
|
||||||
untracked_resolutions,
|
|
||||||
untracked,
|
untracked,
|
||||||
krate,
|
krate,
|
||||||
dep_graph,
|
dep_graph,
|
||||||
@ -832,8 +831,9 @@ pub fn create_global_ctxt<'tcx>(
|
|||||||
|
|
||||||
let mut qcx = QueryContext { gcx };
|
let mut qcx = QueryContext { gcx };
|
||||||
qcx.enter(|tcx| {
|
qcx.enter(|tcx| {
|
||||||
tcx.feed_unit_query()
|
let feed = tcx.feed_unit_query();
|
||||||
.resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)))
|
feed.resolver_for_lowering(tcx.arena.alloc(Steal::new(untracked_resolver_for_lowering)));
|
||||||
|
feed.resolutions(tcx.arena.alloc(untracked_resolutions));
|
||||||
});
|
});
|
||||||
qcx
|
qcx
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ macro_rules! arena_types {
|
|||||||
[decode] borrowck_result:
|
[decode] borrowck_result:
|
||||||
rustc_middle::mir::BorrowCheckResult<'tcx>,
|
rustc_middle::mir::BorrowCheckResult<'tcx>,
|
||||||
[] resolver: rustc_data_structures::steal::Steal<rustc_middle::ty::ResolverAstLowering>,
|
[] resolver: rustc_data_structures::steal::Steal<rustc_middle::ty::ResolverAstLowering>,
|
||||||
|
[] resolutions: rustc_middle::ty::ResolverGlobalCtxt,
|
||||||
[decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
|
[decode] unsafety_check_result: rustc_middle::mir::UnsafetyCheckResult,
|
||||||
[decode] code_region: rustc_middle::mir::coverage::CodeRegion,
|
[decode] code_region: rustc_middle::mir::coverage::CodeRegion,
|
||||||
[] const_allocs: rustc_middle::mir::interpret::Allocation,
|
[] const_allocs: rustc_middle::mir::interpret::Allocation,
|
||||||
|
@ -27,7 +27,7 @@ rustc_queries! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
|
query resolutions(_: ()) -> &'tcx ty::ResolverGlobalCtxt {
|
||||||
eval_always
|
feedable
|
||||||
no_hash
|
no_hash
|
||||||
desc { "getting the resolver outputs" }
|
desc { "getting the resolver outputs" }
|
||||||
}
|
}
|
||||||
|
@ -428,8 +428,7 @@ pub struct GlobalCtxt<'tcx> {
|
|||||||
pub consts: CommonConsts<'tcx>,
|
pub consts: CommonConsts<'tcx>,
|
||||||
|
|
||||||
untracked: Untracked,
|
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,
|
/// 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.
|
/// which lowers it from AST to HIR. It must not be read or used by anything else.
|
||||||
pub untracked_crate: Steal<Lrc<ast::Crate>>,
|
pub untracked_crate: Steal<Lrc<ast::Crate>>,
|
||||||
@ -592,7 +591,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||||||
lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
|
lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
|
||||||
arena: &'tcx WorkerLocal<Arena<'tcx>>,
|
arena: &'tcx WorkerLocal<Arena<'tcx>>,
|
||||||
hir_arena: &'tcx WorkerLocal<hir::Arena<'tcx>>,
|
hir_arena: &'tcx WorkerLocal<hir::Arena<'tcx>>,
|
||||||
untracked_resolutions: ty::ResolverGlobalCtxt,
|
|
||||||
untracked: Untracked,
|
untracked: Untracked,
|
||||||
krate: Lrc<ast::Crate>,
|
krate: Lrc<ast::Crate>,
|
||||||
dep_graph: DepGraph,
|
dep_graph: DepGraph,
|
||||||
@ -622,7 +620,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||||||
lifetimes: common_lifetimes,
|
lifetimes: common_lifetimes,
|
||||||
consts: common_consts,
|
consts: common_consts,
|
||||||
untracked,
|
untracked,
|
||||||
untracked_resolutions,
|
|
||||||
untracked_crate: Steal::new(krate),
|
untracked_crate: Steal::new(krate),
|
||||||
on_disk_cache,
|
on_disk_cache,
|
||||||
queries,
|
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) {
|
pub fn provide(providers: &mut ty::query::Providers) {
|
||||||
providers.resolutions = |tcx, ()| &tcx.untracked_resolutions;
|
|
||||||
providers.module_reexports =
|
providers.module_reexports =
|
||||||
|tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
|
|tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
|
||||||
providers.crate_name = |tcx, id| {
|
providers.crate_name = |tcx, id| {
|
||||||
|
Loading…
Reference in New Issue
Block a user