@@ -195,13 +195,15 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
195195 // failed (so the return value of this method should not be used)
196196 fn process_errors ( & self , errors : & Vec < RegionResolutionError > )
197197 -> Vec < RegionResolutionError > {
198+ debug ! ( "process_errors()" ) ;
198199 let mut var_origins = Vec :: new ( ) ;
199200 let mut trace_origins = Vec :: new ( ) ;
200201 let mut same_regions = Vec :: new ( ) ;
201202 let mut processed_errors = Vec :: new ( ) ;
202203 for error in errors. iter ( ) {
203204 match * error {
204205 ConcreteFailure ( origin, sub, sup) => {
206+ debug ! ( "processing ConcreteFailure" )
205207 let trace = match origin {
206208 infer:: Subtype ( trace) => Some ( trace) ,
207209 _ => None ,
@@ -218,6 +220,7 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
218220 }
219221 }
220222 SubSupConflict ( var_origin, _, sub_r, _, sup_r) => {
223+ debug ! ( "processing SubSupConflict" )
221224 match free_regions_from_same_fn ( self . tcx , sub_r, sup_r) {
222225 Some ( ref same_frs) => {
223226 var_origins. push ( var_origin) ;
@@ -237,10 +240,13 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
237240 // declaration, we want to make sure that they are, in fact,
238241 // from the same scope
239242 if sr. scope_id != common_scope_id {
243+ debug ! ( "returning empty result from process_errors because
244+ {} != {}" , sr. scope_id, common_scope_id) ;
240245 return vec ! ( ) ;
241246 }
242247 }
243248 let pe = ProcessedErrors ( var_origins, trace_origins, same_regions) ;
249+ debug ! ( "errors processed: {:?}" , pe) ;
244250 processed_errors. push ( pe) ;
245251 }
246252 return processed_errors;
@@ -256,6 +262,7 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
256262 sub : Region ,
257263 sup : Region )
258264 -> Option < FreeRegionsFromSameFn > {
265+ debug ! ( "free_regions_from_same_fn(sub={:?}, sup={:?})" , sub, sup) ;
259266 let ( scope_id, fr1, fr2) = match ( sub, sup) {
260267 ( ReFree ( fr1) , ReFree ( fr2) ) => {
261268 if fr1. scope_id != fr2. scope_id {
@@ -284,7 +291,10 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
284291 } ,
285292 _ => None
286293 } ,
287- None => None
294+ None => {
295+ debug ! ( "no parent node of scope_id {}" , scope_id)
296+ None
297+ }
288298 }
289299 }
290300
0 commit comments