@@ -31,7 +31,7 @@ use crate::session_diagnostics::{
31
31
} ;
32
32
33
33
use super :: { OutlivesSuggestionBuilder , RegionName } ;
34
- use crate :: region_infer:: BlameConstraint ;
34
+ use crate :: region_infer:: { BlameConstraint , ExtraConstraintInfo } ;
35
35
use crate :: {
36
36
nll:: ConstraintDescription ,
37
37
region_infer:: { values:: RegionElement , TypeTest } ,
@@ -354,12 +354,11 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
354
354
) {
355
355
debug ! ( "report_region_error(fr={:?}, outlived_fr={:?})" , fr, outlived_fr) ;
356
356
357
- let BlameConstraint { category, cause, variance_info, .. } = self
358
- . regioncx
359
- . best_blame_constraint ( fr, fr_origin, |r| {
357
+ let ( blame_constraint, extra_info) =
358
+ self . regioncx . best_blame_constraint ( fr, fr_origin, |r| {
360
359
self . regioncx . provides_universal_region ( r, fr, outlived_fr)
361
- } )
362
- . 0 ;
360
+ } ) ;
361
+ let BlameConstraint { category , cause , variance_info , .. } = blame_constraint ;
363
362
364
363
debug ! ( "report_region_error: category={:?} {:?} {:?}" , category, cause, variance_info) ;
365
364
@@ -468,6 +467,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
468
467
}
469
468
}
470
469
470
+ for extra in extra_info {
471
+ match extra {
472
+ ExtraConstraintInfo :: PlaceholderFromPredicate ( span) => {
473
+ diag. span_note ( span, format ! ( "due to current limitations in the borrow checker, this implies a `'static` lifetime" ) ) ;
474
+ }
475
+ }
476
+ }
477
+
471
478
self . buffer_error ( diag) ;
472
479
}
473
480
@@ -559,6 +566,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
559
566
/// LL | ref_obj(x)
560
567
/// | ^^^^^^^^^^ `x` escapes the function body here
561
568
/// ```
569
+ #[ instrument( level = "debug" , skip( self ) ) ]
562
570
fn report_escaping_data_error (
563
571
& self ,
564
572
errci : & ErrorConstraintInfo < ' tcx > ,
0 commit comments