5
5
use crate :: dep_graph:: { DepKind , DepNode } ;
6
6
use crate :: dep_graph:: { DepNodeIndex , SerializedDepNodeIndex } ;
7
7
use crate :: query:: caches:: QueryCache ;
8
- use crate :: query:: config:: QueryDescription ;
8
+ use crate :: query:: config:: { QueryDescription , QueryVtable , QueryVtableExt } ;
9
9
use crate :: query:: job:: { QueryInfo , QueryJob , QueryJobId , QueryJobInfo , QueryShardJobId } ;
10
10
use crate :: query:: QueryContext ;
11
11
@@ -406,7 +406,7 @@ where
406
406
// expensive for some `DepKind`s.
407
407
if !tcx. dep_graph ( ) . is_fully_enabled ( ) {
408
408
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 ;
410
410
}
411
411
412
412
if Q :: ANON {
@@ -455,7 +455,7 @@ where
455
455
}
456
456
}
457
457
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 ) ;
459
459
tcx. dep_graph ( ) . read_index ( dep_node_index) ;
460
460
result
461
461
}
@@ -549,14 +549,17 @@ fn incremental_verify_ich<Q, CTX>(
549
549
}
550
550
551
551
#[ inline( always) ]
552
- fn force_query_with_job < Q , CTX > (
552
+ fn force_query_with_job < C , CTX > (
553
553
tcx : CTX ,
554
- key : Q :: Key ,
555
- job : JobOwner < ' _ , CTX , Q :: Cache > ,
554
+ key : C :: Key ,
555
+ job : JobOwner < ' _ , CTX , C > ,
556
556
dep_node : DepNode < CTX :: DepKind > ,
557
- ) -> ( Q :: Stored , DepNodeIndex )
557
+ query : & QueryVtable < CTX , C :: Key , C :: Value > ,
558
+ ) -> ( C :: Stored , DepNodeIndex )
558
559
where
559
- Q : QueryDescription < CTX > ,
560
+ C : QueryCache ,
561
+ C :: Key : Eq + Clone + Debug ,
562
+ C :: Stored : Clone ,
560
563
CTX : QueryContext ,
561
564
{
562
565
// If the following assertion triggers, it can have two reasons:
@@ -577,16 +580,16 @@ where
577
580
578
581
let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
579
582
tcx. start_query ( job. id , diagnostics, |tcx| {
580
- if Q :: EVAL_ALWAYS {
583
+ if query . eval_always {
581
584
tcx. dep_graph ( ) . with_eval_always_task (
582
585
dep_node,
583
586
tcx,
584
587
key,
585
- Q :: compute,
586
- Q :: hash_result,
588
+ query . compute ,
589
+ query . hash_result ,
587
590
)
588
591
} 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 )
590
593
}
591
594
} )
592
595
} ) ;
@@ -684,7 +687,7 @@ where
684
687
#[ cfg( parallel_compiler) ]
685
688
TryGetJob :: JobCompleted ( _) => return ,
686
689
} ;
687
- force_query_with_job :: < Q , _ > ( tcx, key, job, dep_node) ;
690
+ force_query_with_job ( tcx, key, job, dep_node, & Q :: VTABLE ) ;
688
691
} ,
689
692
) ;
690
693
}
0 commit comments