@@ -195,13 +195,15 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
195
195
// failed (so the return value of this method should not be used)
196
196
fn process_errors ( & self , errors : & Vec < RegionResolutionError > )
197
197
-> Vec < RegionResolutionError > {
198
+ debug ! ( "process_errors()" ) ;
198
199
let mut var_origins = Vec :: new ( ) ;
199
200
let mut trace_origins = Vec :: new ( ) ;
200
201
let mut same_regions = Vec :: new ( ) ;
201
202
let mut processed_errors = Vec :: new ( ) ;
202
203
for error in errors. iter ( ) {
203
204
match * error {
204
205
ConcreteFailure ( origin, sub, sup) => {
206
+ debug ! ( "processing ConcreteFailure" )
205
207
let trace = match origin {
206
208
infer:: Subtype ( trace) => Some ( trace) ,
207
209
_ => None ,
@@ -218,6 +220,7 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
218
220
}
219
221
}
220
222
SubSupConflict ( var_origin, _, sub_r, _, sup_r) => {
223
+ debug ! ( "processing SubSupConflict" )
221
224
match free_regions_from_same_fn ( self . tcx , sub_r, sup_r) {
222
225
Some ( ref same_frs) => {
223
226
var_origins. push ( var_origin) ;
@@ -237,10 +240,13 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
237
240
// declaration, we want to make sure that they are, in fact,
238
241
// from the same scope
239
242
if sr. scope_id != common_scope_id {
243
+ debug ! ( "returning empty result from process_errors because
244
+ {} != {}" , sr. scope_id, common_scope_id) ;
240
245
return vec ! ( ) ;
241
246
}
242
247
}
243
248
let pe = ProcessedErrors ( var_origins, trace_origins, same_regions) ;
249
+ debug ! ( "errors processed: {:?}" , pe) ;
244
250
processed_errors. push ( pe) ;
245
251
}
246
252
return processed_errors;
@@ -256,6 +262,7 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
256
262
sub : Region ,
257
263
sup : Region )
258
264
-> Option < FreeRegionsFromSameFn > {
265
+ debug ! ( "free_regions_from_same_fn(sub={:?}, sup={:?})" , sub, sup) ;
259
266
let ( scope_id, fr1, fr2) = match ( sub, sup) {
260
267
( ReFree ( fr1) , ReFree ( fr2) ) => {
261
268
if fr1. scope_id != fr2. scope_id {
@@ -284,7 +291,10 @@ impl<'a> ErrorReporting for InferCtxt<'a> {
284
291
} ,
285
292
_ => None
286
293
} ,
287
- None => None
294
+ None => {
295
+ debug ! ( "no parent node of scope_id {}" , scope_id)
296
+ None
297
+ }
288
298
}
289
299
}
290
300
0 commit comments