55use crate :: dep_graph:: { DepKind , DepNode } ;
66use crate :: dep_graph:: { DepNodeIndex , SerializedDepNodeIndex } ;
77use crate :: query:: caches:: QueryCache ;
8- use crate :: query:: config:: QueryDescription ;
8+ use crate :: query:: config:: { QueryDescription , QueryVtable , QueryVtableExt } ;
99use crate :: query:: job:: { QueryInfo , QueryJob , QueryJobId , QueryJobInfo , QueryShardJobId } ;
1010use crate :: query:: QueryContext ;
1111
@@ -406,7 +406,7 @@ where
406406 // expensive for some `DepKind`s.
407407 if !tcx. dep_graph ( ) . is_fully_enabled ( ) {
408408 let null_dep_node = DepNode :: new_no_params ( DepKind :: NULL ) ;
409- return force_query_with_job :: < Q , _ > ( tcx, key, job, null_dep_node) . 0 ;
409+ return force_query_with_job ( tcx, key, job, null_dep_node, & Q :: VTABLE ) . 0 ;
410410 }
411411
412412 if Q :: ANON {
@@ -455,7 +455,7 @@ where
455455 }
456456 }
457457
458- let ( result, dep_node_index) = force_query_with_job :: < Q , _ > ( tcx, key, job, dep_node) ;
458+ let ( result, dep_node_index) = force_query_with_job ( tcx, key, job, dep_node, & Q :: VTABLE ) ;
459459 tcx. dep_graph ( ) . read_index ( dep_node_index) ;
460460 result
461461}
@@ -549,14 +549,17 @@ fn incremental_verify_ich<Q, CTX>(
549549}
550550
551551#[ inline( always) ]
552- fn force_query_with_job < Q , CTX > (
552+ fn force_query_with_job < C , CTX > (
553553 tcx : CTX ,
554- key : Q :: Key ,
555- job : JobOwner < ' _ , CTX , Q :: Cache > ,
554+ key : C :: Key ,
555+ job : JobOwner < ' _ , CTX , C > ,
556556 dep_node : DepNode < CTX :: DepKind > ,
557- ) -> ( Q :: Stored , DepNodeIndex )
557+ query : & QueryVtable < CTX , C :: Key , C :: Value > ,
558+ ) -> ( C :: Stored , DepNodeIndex )
558559where
559- Q : QueryDescription < CTX > ,
560+ C : QueryCache ,
561+ C :: Key : Eq + Clone + Debug ,
562+ C :: Stored : Clone ,
560563 CTX : QueryContext ,
561564{
562565 // If the following assertion triggers, it can have two reasons:
@@ -577,16 +580,16 @@ where
577580
578581 let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
579582 tcx. start_query ( job. id , diagnostics, |tcx| {
580- if Q :: EVAL_ALWAYS {
583+ if query . eval_always {
581584 tcx. dep_graph ( ) . with_eval_always_task (
582585 dep_node,
583586 tcx,
584587 key,
585- Q :: compute,
586- Q :: hash_result,
588+ query . compute ,
589+ query . hash_result ,
587590 )
588591 } else {
589- tcx. dep_graph ( ) . with_task ( dep_node, tcx, key, Q :: compute, Q :: hash_result)
592+ tcx. dep_graph ( ) . with_task ( dep_node, tcx, key, query . compute , query . hash_result )
590593 }
591594 } )
592595 } ) ;
@@ -684,7 +687,7 @@ where
684687 #[ cfg( parallel_compiler) ]
685688 TryGetJob :: JobCompleted ( _) => return ,
686689 } ;
687- force_query_with_job :: < Q , _ > ( tcx, key, job, dep_node) ;
690+ force_query_with_job ( tcx, key, job, dep_node, & Q :: VTABLE ) ;
688691 } ,
689692 ) ;
690693}
0 commit comments