@@ -72,12 +72,12 @@ use ty::error::TypeError;
7272use syntax:: ast:: DUMMY_NODE_ID ;
7373use syntax_pos:: { Pos , Span } ;
7474use errors:: { DiagnosticBuilder , DiagnosticStyledString } ;
75+
7576mod note;
7677
7778mod need_type_info;
7879mod named_anon_conflict;
7980
80-
8181impl < ' a , ' gcx , ' tcx > TyCtxt < ' a , ' gcx , ' tcx > {
8282 pub fn note_and_explain_region ( self ,
8383 err : & mut DiagnosticBuilder ,
@@ -265,40 +265,34 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
265265 // together into a `ProcessedErrors` group:
266266 let errors = self . process_errors ( errors) ;
267267
268- debug ! ( "report_region_errors: {} errors after preprocessing" ,
269- errors. len( ) ) ;
268+ debug ! ( "report_region_errors: {} errors after preprocessing" , errors. len( ) ) ;
270269
271270 for error in errors {
272-
273271 debug ! ( "report_region_errors: error = {:?}" , error) ;
274272
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+ }
302296 }
303297 }
304298 }
0 commit comments