File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -153,21 +153,16 @@ impl QueryContext for QueryCtxt<'_> {
153153 }
154154
155155 fn depth_limit_error ( self , job : QueryJobId ) {
156- let mut span = None ;
157- let mut note = None ;
158- if let Some ( ( info, depth) ) = job. try_find_dep_kind_root ( self . collect_active_jobs ( ) ) {
159- span = Some ( info. job . span ) ;
160- note = Some ( QueryOverflowNote { desc : info. query . description , depth } ) ;
161- }
156+ let ( info, depth) = job. find_dep_kind_root ( self . collect_active_jobs ( ) ) ;
162157
163158 let suggested_limit = match self . recursion_limit ( ) {
164159 Limit ( 0 ) => Limit ( 2 ) ,
165160 limit => limit * 2 ,
166161 } ;
167162
168163 self . sess . dcx ( ) . emit_fatal ( QueryOverflow {
169- span,
170- note,
164+ span : info . job . span ,
165+ note : QueryOverflowNote { desc : info . query . description , depth } ,
171166 suggested_limit,
172167 crate_name : self . crate_name ( LOCAL_CRATE ) ,
173168 } ) ;
Original file line number Diff line number Diff line change @@ -82,9 +82,9 @@ pub(crate) struct IncrementCompilation {
8282#[ diag( query_system_query_overflow) ]
8383pub struct QueryOverflow {
8484 #[ primary_span]
85- pub span : Option < Span > ,
85+ pub span : Span ,
8686 #[ subdiagnostic]
87- pub note : Option < QueryOverflowNote > ,
87+ pub note : QueryOverflowNote ,
8888 pub suggested_limit : Limit ,
8989 pub crate_name : Symbol ,
9090}
Original file line number Diff line number Diff line change @@ -136,18 +136,18 @@ impl QueryJobId {
136136
137137 #[ cold]
138138 #[ inline( never) ]
139- pub fn try_find_dep_kind_root ( & self , query_map : QueryMap ) -> Option < ( QueryJobInfo , usize ) > {
139+ pub fn find_dep_kind_root ( & self , query_map : QueryMap ) -> ( QueryJobInfo , usize ) {
140140 let mut depth = 1 ;
141141 let info = query_map. get ( & self ) . unwrap ( ) ;
142142 let dep_kind = info. query . dep_kind ;
143143 let mut current_id = info. job . parent ;
144- let mut last_layout = Some ( ( info. clone ( ) , depth) ) ;
144+ let mut last_layout = ( info. clone ( ) , depth) ;
145145
146146 while let Some ( id) = current_id {
147147 let info = query_map. get ( & id) . unwrap ( ) ;
148148 if info. query . dep_kind == dep_kind {
149149 depth += 1 ;
150- last_layout = Some ( ( info. clone ( ) , depth) ) ;
150+ last_layout = ( info. clone ( ) , depth) ;
151151 }
152152 current_id = info. job . parent ;
153153 }
You can’t perform that action at this time.
0 commit comments