@@ -390,7 +390,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
390
390
None
391
391
} ;
392
392
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) ;
394
395
395
396
self . check_universal_regions (
396
397
infcx, mir, mir_def_id, outlives_requirements. as_mut ( ) , errors_buffer) ;
@@ -480,6 +481,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
480
481
mir : & Mir < ' tcx > ,
481
482
mir_def_id : DefId ,
482
483
mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' gcx > > > ,
484
+ errors_buffer : & mut Vec < Diagnostic > ,
483
485
) {
484
486
let tcx = infcx. tcx ;
485
487
@@ -506,13 +508,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
506
508
if let Some ( lower_bound_region) = lower_bound_region {
507
509
let region_scope_tree = & tcx. region_scope_tree ( mir_def_id) ;
508
510
let type_test_span = type_test. locations . span ( mir) ;
509
- infcx. report_generic_bound_failure (
511
+ infcx. construct_generic_bound_failure (
510
512
region_scope_tree,
511
513
type_test_span,
512
514
None ,
513
515
type_test. generic_kind ,
514
516
lower_bound_region,
515
- ) ;
517
+ ) . buffer ( errors_buffer ) ;
516
518
} else {
517
519
// FIXME. We should handle this case better. It
518
520
// indicates that we have e.g. some region variable
@@ -524,10 +526,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
524
526
// iterating over the universal regions and reporting
525
527
// an error that multiple bounds are required.
526
528
let type_test_span = type_test. locations . span ( mir) ;
527
- tcx. sess . span_err (
529
+ tcx. sess . struct_span_err (
528
530
type_test_span,
529
531
& format ! ( "`{}` does not live long enough" , type_test. generic_kind, ) ,
530
- ) ;
532
+ ) . buffer ( errors_buffer ) ;
531
533
}
532
534
}
533
535
}
0 commit comments