@@ -244,12 +244,12 @@ fn wait_for_query<'tcx, C: QueryCache, const FLAGS: QueryFlags>(
244244
245245 match result {
246246 Ok ( ( ) ) => {
247- let Some ( ( v, index) ) = query. query_cache ( tcx ) . lookup ( & key) else {
247+ let Some ( ( v, index) ) = query. query_cache ( ) . lookup ( & key) else {
248248 outline ( || {
249249 // We didn't find the query result in the query cache. Check if it was
250250 // poisoned due to a panic instead.
251251 let key_hash = sharded:: make_hash ( & key) ;
252- let shard = query. query_state ( tcx ) . active . lock_shard_by_hash ( key_hash) ;
252+ let shard = query. query_state ( ) . active . lock_shard_by_hash ( key_hash) ;
253253 match shard. find ( key_hash, equivalent_key ( & key) ) {
254254 // The query we waited on panicked. Continue unwinding here.
255255 Some ( ( _, ActiveKeyStatus :: Poisoned ) ) => FatalError . raise ( ) ,
@@ -278,9 +278,8 @@ fn try_execute_query<'tcx, C: QueryCache, const FLAGS: QueryFlags, const INCR: b
278278 key : C :: Key ,
279279 dep_node : Option < DepNode > ,
280280) -> ( C :: Value , Option < DepNodeIndex > ) {
281- let state = query. query_state ( tcx) ;
282281 let key_hash = sharded:: make_hash ( & key) ;
283- let mut state_lock = state . active . lock_shard_by_hash ( key_hash) ;
282+ let mut state_lock = query . query_state ( ) . active . lock_shard_by_hash ( key_hash) ;
284283
285284 // For the parallel compiler we need to check both the query cache and query state structures
286285 // while holding the state lock to ensure that 1) the query has not yet completed and 2) the
@@ -289,7 +288,7 @@ fn try_execute_query<'tcx, C: QueryCache, const FLAGS: QueryFlags, const INCR: b
289288 // executing, but another thread may have already completed the query and stores it result
290289 // in the query cache.
291290 if tcx. sess . threads ( ) > 1 {
292- if let Some ( ( value, index) ) = query. query_cache ( tcx ) . lookup ( & key) {
291+ if let Some ( ( value, index) ) = query. query_cache ( ) . lookup ( & key) {
293292 tcx. prof . query_cache_hit ( index. into ( ) ) ;
294293 return ( value, Some ( index) ) ;
295294 }
@@ -308,7 +307,7 @@ fn try_execute_query<'tcx, C: QueryCache, const FLAGS: QueryFlags, const INCR: b
308307 // Drop the lock before we start executing the query
309308 drop ( state_lock) ;
310309
311- execute_job :: < C , FLAGS , INCR > ( query, tcx, state , key, key_hash, id, dep_node)
310+ execute_job :: < C , FLAGS , INCR > ( query, tcx, key, key_hash, id, dep_node)
312311 }
313312 Entry :: Occupied ( mut entry) => {
314313 match & mut entry. get_mut ( ) . 1 {
@@ -340,15 +339,14 @@ fn try_execute_query<'tcx, C: QueryCache, const FLAGS: QueryFlags, const INCR: b
340339fn execute_job < ' tcx , C : QueryCache , const FLAGS : QueryFlags , const INCR : bool > (
341340 query : SemiDynamicQueryDispatcher < ' tcx , C , FLAGS > ,
342341 tcx : TyCtxt < ' tcx > ,
343- state : & ' tcx QueryState < ' tcx , C :: Key > ,
344342 key : C :: Key ,
345343 key_hash : u64 ,
346344 id : QueryJobId ,
347345 dep_node : Option < DepNode > ,
348346) -> ( C :: Value , Option < DepNodeIndex > ) {
349347 // Set up a guard object that will automatically poison the query if a
350348 // panic occurs while executing the query (or any intermediate plumbing).
351- let job_guard = ActiveJobGuard { state, key, key_hash } ;
349+ let job_guard = ActiveJobGuard { state : query . query_state ( ) , key, key_hash } ;
352350
353351 debug_assert_eq ! ( tcx. dep_graph. is_fully_enabled( ) , INCR ) ;
354352
@@ -359,7 +357,7 @@ fn execute_job<'tcx, C: QueryCache, const FLAGS: QueryFlags, const INCR: bool>(
359357 execute_job_non_incr ( query, tcx, key, id)
360358 } ;
361359
362- let cache = query. query_cache ( tcx ) ;
360+ let cache = query. query_cache ( ) ;
363361 if query. feedable ( ) {
364362 // We should not compute queries that also got a value via feeding.
365363 // This can't happen, as query feeding adds the very dependencies to the fed query
@@ -680,7 +678,7 @@ pub(crate) fn force_query<'tcx, C: QueryCache, const FLAGS: QueryFlags>(
680678) {
681679 // We may be concurrently trying both execute and force a query.
682680 // Ensure that only one of them runs the query.
683- if let Some ( ( _, index) ) = query. query_cache ( tcx ) . lookup ( & key) {
681+ if let Some ( ( _, index) ) = query. query_cache ( ) . lookup ( & key) {
684682 tcx. prof . query_cache_hit ( index. into ( ) ) ;
685683 return ;
686684 }
0 commit comments