@@ -79,14 +79,15 @@ impl QueryContext for QueryCtxt<'_> {
79
79
tls:: with_related_context ( self . tcx , |icx| icx. query )
80
80
}
81
81
82
- fn collect_active_jobs ( self ) -> QueryMap {
82
+ fn collect_active_jobs ( self ) -> ( QueryMap , bool ) {
83
83
let mut jobs = QueryMap :: default ( ) ;
84
+ let mut complete = true ;
84
85
85
86
for collect in super :: TRY_COLLECT_ACTIVE_JOBS . iter ( ) {
86
- collect ( self . tcx , & mut jobs) ;
87
+ collect ( self . tcx , & mut jobs, & mut complete ) ;
87
88
}
88
89
89
- jobs
90
+ ( jobs, complete )
90
91
}
91
92
92
93
// Interactions with on_disk_cache
@@ -139,7 +140,8 @@ impl QueryContext for QueryCtxt<'_> {
139
140
}
140
141
141
142
fn depth_limit_error ( self , job : QueryJobId ) {
142
- let ( info, depth) = job. find_dep_kind_root ( self . collect_active_jobs ( ) ) ;
143
+ // FIXME: `collect_active_jobs` expects no locks to be held, which doesn't hold for this call.
144
+ let ( info, depth) = job. find_dep_kind_root ( self . collect_active_jobs ( ) . 0 ) ;
143
145
144
146
let suggested_limit = match self . recursion_limit ( ) {
145
147
Limit ( 0 ) => Limit ( 2 ) ,
@@ -677,7 +679,7 @@ macro_rules! define_queries {
677
679
}
678
680
}
679
681
680
- pub ( crate ) fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap ) {
682
+ pub ( crate ) fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap , complete : & mut bool ) {
681
683
let make_query = |tcx, key| {
682
684
let kind = rustc_middle:: dep_graph:: dep_kinds:: $name;
683
685
let name = stringify!( $name) ;
@@ -692,6 +694,7 @@ macro_rules! define_queries {
692
694
// don't `unwrap()` here, just manually check for `None` and do best-effort error
693
695
// reporting.
694
696
if res. is_none( ) {
697
+ * complete = false ;
695
698
tracing:: warn!(
696
699
"Failed to collect active jobs for query with name `{}`!" ,
697
700
stringify!( $name)
@@ -756,7 +759,7 @@ macro_rules! define_queries {
756
759
757
760
// These arrays are used for iteration and can't be indexed by `DepKind`.
758
761
759
- const TRY_COLLECT_ACTIVE_JOBS : & [ for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap ) ] =
762
+ const TRY_COLLECT_ACTIVE_JOBS : & [ for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap , & mut bool ) ] =
760
763
& [ $( query_impl:: $name:: try_collect_active_jobs) ,* ] ;
761
764
762
765
const ALLOC_SELF_PROFILE_QUERY_STRINGS : & [
0 commit comments