@@ -20,6 +20,7 @@ use rustc_data_structures::thin_vec::ThinVec;
20
20
use rustc_errors:: { Diagnostic , FatalError } ;
21
21
use rustc_span:: Span ;
22
22
use std:: collections:: hash_map:: Entry ;
23
+ use std:: fmt:: Debug ;
23
24
use std:: hash:: { Hash , Hasher } ;
24
25
use std:: mem;
25
26
use std:: num:: NonZeroU32 ;
@@ -425,7 +426,8 @@ where
425
426
return v;
426
427
}
427
428
} ;
428
- return force_query_with_job ( tcx, key, job, * dep_node, query) . 0 ;
429
+ let ( result, dep_node_index) = force_query_with_job ( tcx, key, job. id , * dep_node, query) ;
430
+ return job. complete ( result, dep_node_index) ;
429
431
} ;
430
432
431
433
let job = match job {
@@ -442,7 +444,8 @@ where
442
444
// expensive for some `DepKind`s.
443
445
if !tcx. dep_graph ( ) . is_fully_enabled ( ) {
444
446
let null_dep_node = DepNode :: new_no_params ( DepKind :: NULL ) ;
445
- return force_query_with_job ( tcx, key, job, null_dep_node, query) . 0 ;
447
+ let ( result, dep_node_index) = force_query_with_job ( tcx, key, job. id , null_dep_node, query) ;
448
+ return job. complete ( result, dep_node_index) ;
446
449
}
447
450
448
451
if query. anon {
@@ -492,7 +495,8 @@ where
492
495
}
493
496
}
494
497
495
- let ( result, dep_node_index) = force_query_with_job ( tcx, key, job, dep_node, query) ;
498
+ let ( result, dep_node_index) = force_query_with_job ( tcx, key, job. id , dep_node, query) ;
499
+ let result = job. complete ( result, dep_node_index) ;
496
500
tcx. dep_graph ( ) . read_index ( dep_node_index) ;
497
501
result
498
502
}
@@ -586,15 +590,15 @@ fn incremental_verify_ich<CTX, K, V>(
586
590
}
587
591
588
592
#[ inline( always) ]
589
- fn force_query_with_job < C , CTX > (
593
+ fn force_query_with_job < CTX , K , V > (
590
594
tcx : CTX ,
591
- key : C :: Key ,
592
- job : JobOwner < ' _ , CTX :: DepKind , CTX :: Query , C > ,
595
+ key : K ,
596
+ job_id : QueryJobId < CTX :: DepKind > ,
593
597
dep_node : DepNode < CTX :: DepKind > ,
594
- query : & QueryVtable < CTX , C :: Key , C :: Value > ,
595
- ) -> ( C :: Stored , DepNodeIndex )
598
+ query : & QueryVtable < CTX , K , V > ,
599
+ ) -> ( V , DepNodeIndex )
596
600
where
597
- C : QueryCache ,
601
+ K : Eq + Clone + Debug ,
598
602
CTX : QueryContext ,
599
603
{
600
604
// If the following assertion triggers, it can have two reasons:
@@ -614,7 +618,7 @@ where
614
618
let prof_timer = tcx. profiler ( ) . query_provider ( ) ;
615
619
616
620
let ( ( result, dep_node_index) , diagnostics) = with_diagnostics ( |diagnostics| {
617
- tcx. start_query ( job . id , diagnostics, |tcx| {
621
+ tcx. start_query ( job_id , diagnostics, |tcx| {
618
622
if query. eval_always {
619
623
tcx. dep_graph ( ) . with_eval_always_task (
620
624
dep_node,
@@ -637,8 +641,6 @@ where
637
641
}
638
642
}
639
643
640
- let result = job. complete ( result, dep_node_index) ;
641
-
642
644
( result, dep_node_index)
643
645
}
644
646
0 commit comments