@@ -390,7 +390,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
390390 None
391391 } ;
392392
393- self . check_type_tests ( infcx, mir, mir_def_id, outlives_requirements. as_mut ( ) ) ;
393+ self . check_type_tests (
394+ infcx, mir, mir_def_id, outlives_requirements. as_mut ( ) , errors_buffer) ;
394395
395396 self . check_universal_regions (
396397 infcx, mir, mir_def_id, outlives_requirements. as_mut ( ) , errors_buffer) ;
@@ -480,6 +481,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
480481 mir : & Mir < ' tcx > ,
481482 mir_def_id : DefId ,
482483 mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' gcx > > > ,
484+ errors_buffer : & mut Vec < Diagnostic > ,
483485 ) {
484486 let tcx = infcx. tcx ;
485487
@@ -506,13 +508,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
506508 if let Some ( lower_bound_region) = lower_bound_region {
507509 let region_scope_tree = & tcx. region_scope_tree ( mir_def_id) ;
508510 let type_test_span = type_test. locations . span ( mir) ;
509- infcx. report_generic_bound_failure (
511+ infcx. construct_generic_bound_failure (
510512 region_scope_tree,
511513 type_test_span,
512514 None ,
513515 type_test. generic_kind ,
514516 lower_bound_region,
515- ) ;
517+ ) . buffer ( errors_buffer ) ;
516518 } else {
517519 // FIXME. We should handle this case better. It
518520 // indicates that we have e.g. some region variable
@@ -524,10 +526,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
524526 // iterating over the universal regions and reporting
525527 // an error that multiple bounds are required.
526528 let type_test_span = type_test. locations . span ( mir) ;
527- tcx. sess . span_err (
529+ tcx. sess . struct_span_err (
528530 type_test_span,
529531 & format ! ( "`{}` does not live long enough" , type_test. generic_kind, ) ,
530- ) ;
532+ ) . buffer ( errors_buffer ) ;
531533 }
532534 }
533535 }
0 commit comments