@@ -82,14 +82,15 @@ impl QueryContext for QueryCtxt<'_> {
8282 tls:: with_related_context ( self . tcx , |icx| icx. query )
8383 }
8484
85- fn collect_active_jobs ( self ) -> QueryMap {
85+ fn collect_active_jobs ( self ) -> ( QueryMap , bool ) {
8686 let mut jobs = QueryMap :: default ( ) ;
87+ let mut complete = true ;
8788
8889 for collect in super :: TRY_COLLECT_ACTIVE_JOBS . iter ( ) {
89- collect ( self . tcx , & mut jobs) ;
90+ collect ( self . tcx , & mut jobs, & mut complete ) ;
9091 }
9192
92- jobs
93+ ( jobs, complete )
9394 }
9495
9596 // Interactions with on_disk_cache
@@ -155,7 +156,8 @@ impl QueryContext for QueryCtxt<'_> {
155156 }
156157
157158 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 ) ;
159161
160162 let suggested_limit = match self . recursion_limit ( ) {
161163 Limit ( 0 ) => Limit ( 2 ) ,
@@ -693,7 +695,7 @@ macro_rules! define_queries {
693695 }
694696 }
695697
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 ) {
697699 let make_query = |tcx, key| {
698700 let kind = rustc_middle:: dep_graph:: dep_kinds:: $name;
699701 let name = stringify!( $name) ;
@@ -708,6 +710,7 @@ macro_rules! define_queries {
708710 // don't `unwrap()` here, just manually check for `None` and do best-effort error
709711 // reporting.
710712 if res. is_none( ) {
713+ * complete = false ;
711714 tracing:: warn!(
712715 "Failed to collect active jobs for query with name `{}`!" ,
713716 stringify!( $name)
@@ -772,7 +775,7 @@ macro_rules! define_queries {
772775
773776 // These arrays are used for iteration and can't be indexed by `DepKind`.
774777
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 ) ] =
776779 & [ $( query_impl:: $name:: try_collect_active_jobs) ,* ] ;
777780
778781 const ALLOC_SELF_PROFILE_QUERY_STRINGS : & [
0 commit comments