@@ -72,12 +72,12 @@ use ty::error::TypeError;
72
72
use syntax:: ast:: DUMMY_NODE_ID ;
73
73
use syntax_pos:: { Pos , Span } ;
74
74
use errors:: { DiagnosticBuilder , DiagnosticStyledString } ;
75
+
75
76
mod note;
76
77
77
78
mod need_type_info;
78
79
mod named_anon_conflict;
79
80
80
-
81
81
impl < ' a , ' gcx , ' tcx > TyCtxt < ' a , ' gcx , ' tcx > {
82
82
pub fn note_and_explain_region ( self ,
83
83
err : & mut DiagnosticBuilder ,
@@ -265,40 +265,34 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
265
265
// together into a `ProcessedErrors` group:
266
266
let errors = self . process_errors ( errors) ;
267
267
268
- debug ! ( "report_region_errors: {} errors after preprocessing" ,
269
- errors. len( ) ) ;
268
+ debug ! ( "report_region_errors: {} errors after preprocessing" , errors. len( ) ) ;
270
269
271
270
for error in errors {
272
-
273
271
debug ! ( "report_region_errors: error = {:?}" , error) ;
274
272
275
- if !self . try_report_named_anon_conflict ( & error) {
276
-
277
- match error. clone ( ) {
278
- // These errors could indicate all manner of different
279
- // problems with many different solutions. Rather
280
- // than generate a "one size fits all" error, what we
281
- // attempt to do is go through a number of specific
282
- // scenarios and try to find the best way to present
283
- // the error. If all of these fails, we fall back to a rather
284
- // general bit of code that displays the error information
285
- ConcreteFailure ( origin, sub, sup) => {
286
-
287
- self . report_concrete_failure ( origin, sub, sup) . emit ( ) ;
288
- }
289
-
290
- GenericBoundFailure ( kind, param_ty, sub) => {
291
- self . report_generic_bound_failure ( kind, param_ty, sub) ;
292
- }
293
-
294
- SubSupConflict ( var_origin,
295
- sub_origin, sub_r,
296
- sup_origin, sup_r) => {
297
- self . report_sub_sup_conflict ( var_origin,
298
- sub_origin, sub_r,
299
- sup_origin, sup_r) ;
300
- }
301
- }
273
+ if !self . try_report_named_anon_conflict ( & error) {
274
+ match error. clone ( ) {
275
+ // These errors could indicate all manner of different
276
+ // problems with many different solutions. Rather
277
+ // than generate a "one size fits all" error, what we
278
+ // attempt to do is go through a number of specific
279
+ // scenarios and try to find the best way to present
280
+ // the error. If all of these fails, we fall back to a rather
281
+ // general bit of code that displays the error information
282
+ ConcreteFailure ( origin, sub, sup) => {
283
+ self . report_concrete_failure ( origin, sub, sup) . emit ( ) ;
284
+ }
285
+ GenericBoundFailure ( kind, param_ty, sub) => {
286
+ self . report_generic_bound_failure ( kind, param_ty, sub) ;
287
+ }
288
+ SubSupConflict ( var_origin,
289
+ sub_origin, sub_r,
290
+ sup_origin, sup_r) => {
291
+ self . report_sub_sup_conflict ( var_origin,
292
+ sub_origin, sub_r,
293
+ sup_origin, sup_r) ;
294
+ }
295
+ }
302
296
}
303
297
}
304
298
}
0 commit comments