Avoiding calling queries when collecting active queries
This commit is contained in:
@@ -26,8 +26,8 @@ use rustc_middle::ty::TyCtxt;
|
||||
use rustc_query_system::dep_graph::SerializedDepNodeIndex;
|
||||
use rustc_query_system::ich::StableHashingContext;
|
||||
use rustc_query_system::query::{
|
||||
CycleError, HashResult, QueryCache, QueryConfig, QueryMap, QueryMode, QueryState,
|
||||
get_query_incr, get_query_non_incr,
|
||||
CycleError, HashResult, QueryCache, QueryConfig, QueryMap, QueryMode, QueryStackDeferred,
|
||||
QueryState, get_query_incr, get_query_non_incr,
|
||||
};
|
||||
use rustc_query_system::{HandleCycleError, Value};
|
||||
use rustc_span::{ErrorGuaranteed, Span};
|
||||
@@ -84,7 +84,10 @@ where
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn query_state<'a>(self, qcx: QueryCtxt<'tcx>) -> &'a QueryState<Self::Key>
|
||||
fn query_state<'a>(
|
||||
self,
|
||||
qcx: QueryCtxt<'tcx>,
|
||||
) -> &'a QueryState<Self::Key, QueryStackDeferred<'tcx>>
|
||||
where
|
||||
QueryCtxt<'tcx>: 'a,
|
||||
{
|
||||
@@ -93,7 +96,7 @@ where
|
||||
unsafe {
|
||||
&*(&qcx.tcx.query_system.states as *const QueryStates<'tcx>)
|
||||
.byte_add(self.dynamic.query_state)
|
||||
.cast::<QueryState<Self::Key>>()
|
||||
.cast::<QueryState<Self::Key, QueryStackDeferred<'tcx>>>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user