@@ -82,14 +82,15 @@ impl QueryContext for QueryCtxt<'_> {
82
82
tls:: with_related_context ( self . tcx , |icx| icx. query )
83
83
}
84
84
85
- fn collect_active_jobs ( self ) -> QueryMap {
85
+ fn collect_active_jobs ( self ) -> ( QueryMap , bool ) {
86
86
let mut jobs = QueryMap :: default ( ) ;
87
+ let mut complete = true ;
87
88
88
89
for collect in super :: TRY_COLLECT_ACTIVE_JOBS . iter ( ) {
89
- collect ( self . tcx , & mut jobs) ;
90
+ collect ( self . tcx , & mut jobs, & mut complete ) ;
90
91
}
91
92
92
- jobs
93
+ ( jobs, complete )
93
94
}
94
95
95
96
// Interactions with on_disk_cache
@@ -155,7 +156,8 @@ impl QueryContext for QueryCtxt<'_> {
155
156
}
156
157
157
158
fn depth_limit_error ( self , job : QueryJobId ) {
158
- let ( info, depth) = job. find_dep_kind_root ( self . collect_active_jobs ( ) ) ;
159
+ // FIXME: `collect_active_jobs` expects no locks to be held, which doesn't hold for this call.
160
+ let ( info, depth) = job. find_dep_kind_root ( self . collect_active_jobs ( ) . 0 ) ;
159
161
160
162
let suggested_limit = match self . recursion_limit ( ) {
161
163
Limit ( 0 ) => Limit ( 2 ) ,
@@ -693,7 +695,7 @@ macro_rules! define_queries {
693
695
}
694
696
}
695
697
696
- pub ( crate ) fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap ) {
698
+ pub ( crate ) fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap , complete : & mut bool ) {
697
699
let make_query = |tcx, key| {
698
700
let kind = rustc_middle:: dep_graph:: dep_kinds:: $name;
699
701
let name = stringify!( $name) ;
@@ -708,6 +710,7 @@ macro_rules! define_queries {
708
710
// don't `unwrap()` here, just manually check for `None` and do best-effort error
709
711
// reporting.
710
712
if res. is_none( ) {
713
+ * complete = false ;
711
714
tracing:: warn!(
712
715
"Failed to collect active jobs for query with name `{}`!" ,
713
716
stringify!( $name)
@@ -772,7 +775,7 @@ macro_rules! define_queries {
772
775
773
776
// These arrays are used for iteration and can't be indexed by `DepKind`.
774
777
775
- const TRY_COLLECT_ACTIVE_JOBS : & [ for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap ) ] =
778
+ const TRY_COLLECT_ACTIVE_JOBS : & [ for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap , & mut bool ) ] =
776
779
& [ $( query_impl:: $name:: try_collect_active_jobs) ,* ] ;
777
780
778
781
const ALLOC_SELF_PROFILE_QUERY_STRINGS : & [
0 commit comments