@@ -66,7 +66,7 @@ impl QueryContext for QueryCtxt<'_> {
66
66
tls:: with_related_context ( * * self , |icx| icx. query )
67
67
}
68
68
69
- fn try_collect_active_jobs ( & self ) -> Option < QueryMap > {
69
+ fn try_collect_active_jobs ( & self ) -> Option < QueryMap < DepKind > > {
70
70
self . queries . try_collect_active_jobs ( * * self )
71
71
}
72
72
@@ -195,7 +195,7 @@ impl<'tcx> QueryCtxt<'tcx> {
195
195
196
196
#[ derive( Clone , Copy ) ]
197
197
pub ( crate ) struct QueryStruct < ' tcx > {
198
- pub try_collect_active_jobs : fn ( QueryCtxt < ' tcx > , & mut QueryMap ) -> Option < ( ) > ,
198
+ pub try_collect_active_jobs : fn ( QueryCtxt < ' tcx > , & mut QueryMap < DepKind > ) -> Option < ( ) > ,
199
199
pub alloc_self_profile_query_strings : fn ( TyCtxt < ' tcx > , & mut QueryKeyStringCache ) ,
200
200
pub encode_query_results :
201
201
Option < fn ( QueryCtxt < ' tcx > , & mut CacheEncoder < ' _ , ' tcx > , & mut EncodedDepNodeIndex ) > ,
@@ -313,7 +313,7 @@ pub(crate) fn create_query_frame<
313
313
key : K ,
314
314
kind : DepKind ,
315
315
name : & ' static str ,
316
- ) -> QueryStackFrame {
316
+ ) -> QueryStackFrame < DepKind > {
317
317
// Disable visible paths printing for performance reasons.
318
318
// Showing visible path instead of any path is not that important in production.
319
319
let description = ty:: print:: with_no_visible_paths!(
@@ -346,7 +346,7 @@ pub(crate) fn create_query_frame<
346
346
} ;
347
347
let ty_adt_id = key. ty_adt_id ( ) ;
348
348
349
- QueryStackFrame :: new ( name , description, span, def_id, def_kind, ty_adt_id, hash)
349
+ QueryStackFrame :: new ( description, span, def_id, def_kind, kind , ty_adt_id, hash)
350
350
}
351
351
352
352
fn try_load_from_on_disk_cache < ' tcx , Q > ( tcx : TyCtxt < ' tcx > , dep_node : DepNode )
@@ -378,7 +378,7 @@ fn force_from_dep_node<'tcx, Q>(tcx: TyCtxt<'tcx>, dep_node: DepNode) -> bool
378
378
where
379
379
Q : QueryConfig < QueryCtxt < ' tcx > > ,
380
380
Q :: Key : DepNodeParams < TyCtxt < ' tcx > > ,
381
- Q :: Value : Value < TyCtxt < ' tcx > > ,
381
+ Q :: Value : Value < TyCtxt < ' tcx > , DepKind > ,
382
382
{
383
383
// We must avoid ever having to call `force_from_dep_node()` for a
384
384
// `DepNode::codegen_unit`:
@@ -402,7 +402,7 @@ where
402
402
#[ cfg( debug_assertions) ]
403
403
let _guard = tracing:: span!( tracing:: Level :: TRACE , stringify!( $name) , ?key) . entered ( ) ;
404
404
let tcx = QueryCtxt :: from_tcx ( tcx) ;
405
- force_query :: < Q , _ > ( tcx, key, dep_node) ;
405
+ force_query :: < Q , _ , DepKind > ( tcx, key, dep_node) ;
406
406
true
407
407
} else {
408
408
false
@@ -480,7 +480,7 @@ macro_rules! define_queries {
480
480
type Cache = query_storage:: $name<' tcx>;
481
481
482
482
#[ inline( always) ]
483
- fn query_state<' a>( tcx: QueryCtxt <' tcx>) -> & ' a QueryState <Self :: Key >
483
+ fn query_state<' a>( tcx: QueryCtxt <' tcx>) -> & ' a QueryState <Self :: Key , crate :: dep_graph :: DepKind >
484
484
where QueryCtxt <' tcx>: ' a
485
485
{
486
486
& tcx. queries. $name
@@ -587,9 +587,10 @@ macro_rules! define_queries {
587
587
use $crate:: plumbing:: { QueryStruct , QueryCtxt } ;
588
588
use $crate:: profiling_support:: QueryKeyStringCache ;
589
589
use rustc_query_system:: query:: QueryMap ;
590
+ use rustc_middle:: dep_graph:: DepKind ;
590
591
591
592
pub ( super ) const fn dummy_query_struct<' tcx>( ) -> QueryStruct <' tcx> {
592
- fn noop_try_collect_active_jobs( _: QueryCtxt <' _>, _: & mut QueryMap ) -> Option <( ) > {
593
+ fn noop_try_collect_active_jobs( _: QueryCtxt <' _>, _: & mut QueryMap < DepKind > ) -> Option <( ) > {
593
594
None
594
595
}
595
596
fn noop_alloc_self_profile_query_strings( _: TyCtxt <' _>, _: & mut QueryKeyStringCache ) { }
@@ -675,7 +676,8 @@ macro_rules! define_queries_struct {
675
676
$(
676
677
$( #[ $attr] ) *
677
678
$name: QueryState <
678
- <queries:: $name<' tcx> as QueryConfig <QueryCtxt <' tcx>>>:: Key
679
+ <queries:: $name<' tcx> as QueryConfig <QueryCtxt <' tcx>>>:: Key ,
680
+ rustc_middle:: dep_graph:: DepKind ,
679
681
>,
680
682
) *
681
683
}
@@ -684,7 +686,7 @@ macro_rules! define_queries_struct {
684
686
pub ( crate ) fn try_collect_active_jobs(
685
687
& ' tcx self ,
686
688
tcx: TyCtxt <' tcx>,
687
- ) -> Option <QueryMap > {
689
+ ) -> Option <QueryMap <rustc_middle :: dep_graph :: DepKind > > {
688
690
let tcx = QueryCtxt { tcx, queries: self } ;
689
691
let mut jobs = QueryMap :: default ( ) ;
690
692
@@ -718,7 +720,7 @@ macro_rules! define_queries_struct {
718
720
mode: QueryMode ,
719
721
) -> Option <query_stored:: $name<' tcx>> {
720
722
let qcx = QueryCtxt { tcx, queries: self } ;
721
- get_query:: <queries:: $name<' tcx>, _>( qcx, span, key, mode)
723
+ get_query:: <queries:: $name<' tcx>, _, rustc_middle :: dep_graph :: DepKind >( qcx, span, key, mode)
722
724
} ) *
723
725
}
724
726
} ;
0 commit comments