@@ -79,14 +79,15 @@ impl QueryContext for QueryCtxt<'_> {
7979 tls:: with_related_context ( self . tcx , |icx| icx. query )
8080 }
8181
82- fn collect_active_jobs ( self ) -> QueryMap {
82+ fn collect_active_jobs ( self ) -> ( QueryMap , bool ) {
8383 let mut jobs = QueryMap :: default ( ) ;
84+ let mut complete = true ;
8485
8586 for collect in super :: TRY_COLLECT_ACTIVE_JOBS . iter ( ) {
86- collect ( self . tcx , & mut jobs) ;
87+ collect ( self . tcx , & mut jobs, & mut complete ) ;
8788 }
8889
89- jobs
90+ ( jobs, complete )
9091 }
9192
9293 // Interactions with on_disk_cache
@@ -139,7 +140,8 @@ impl QueryContext for QueryCtxt<'_> {
139140 }
140141
141142 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 ) ;
143145
144146 let suggested_limit = match self . recursion_limit ( ) {
145147 Limit ( 0 ) => Limit ( 2 ) ,
@@ -677,7 +679,7 @@ macro_rules! define_queries {
677679 }
678680 }
679681
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 ) {
681683 let make_query = |tcx, key| {
682684 let kind = rustc_middle:: dep_graph:: dep_kinds:: $name;
683685 let name = stringify!( $name) ;
@@ -692,6 +694,7 @@ macro_rules! define_queries {
692694 // don't `unwrap()` here, just manually check for `None` and do best-effort error
693695 // reporting.
694696 if res. is_none( ) {
697+ * complete = false ;
695698 tracing:: warn!(
696699 "Failed to collect active jobs for query with name `{}`!" ,
697700 stringify!( $name)
@@ -756,7 +759,7 @@ macro_rules! define_queries {
756759
757760 // These arrays are used for iteration and can't be indexed by `DepKind`.
758761
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 ) ] =
760763 & [ $( query_impl:: $name:: try_collect_active_jobs) ,* ] ;
761764
762765 const ALLOC_SELF_PROFILE_QUERY_STRINGS : & [
0 commit comments