@@ -394,10 +394,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
394
394
& mut self , name : & String , _scope_tree : & Rc < ScopeTree > , _borrow : & BorrowData < ' tcx > ,
395
395
drop_span : Span , borrow_span : Span , _proper_span : Span , end_span : Option < Span >
396
396
) {
397
- let mut err = self . tcx . path_does_not_live_long_enough ( drop_span ,
397
+ let mut err = self . tcx . path_does_not_live_long_enough ( borrow_span ,
398
398
& format ! ( "`{}`" , name) ,
399
399
Origin :: Mir ) ;
400
- err. span_label ( borrow_span, "borrow occurs here " ) ;
400
+ err. span_label ( borrow_span, "borrowed value does not live long enough " ) ;
401
401
err. span_label ( drop_span, format ! ( "`{}` dropped here while still borrowed" , name) ) ;
402
402
if let Some ( end) = end_span {
403
403
err. span_label ( end, "borrowed value needs to live until here" ) ;
@@ -407,12 +407,12 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
407
407
408
408
fn report_scoped_temporary_value_does_not_live_long_enough (
409
409
& mut self , _scope_tree : & Rc < ScopeTree > , _borrow : & BorrowData < ' tcx > ,
410
- drop_span : Span , borrow_span : Span , proper_span : Span , end_span : Option < Span >
410
+ drop_span : Span , _borrow_span : Span , proper_span : Span , end_span : Option < Span >
411
411
) {
412
- let mut err = self . tcx . path_does_not_live_long_enough ( borrow_span ,
412
+ let mut err = self . tcx . path_does_not_live_long_enough ( proper_span ,
413
413
"borrowed value" ,
414
414
Origin :: Mir ) ;
415
- err. span_label ( proper_span, "temporary value created here " ) ;
415
+ err. span_label ( proper_span, "temporary value does not live long enough " ) ;
416
416
err. span_label ( drop_span, "temporary value dropped here while still borrowed" ) ;
417
417
err. note ( "consider using a `let` binding to increase its lifetime" ) ;
418
418
if let Some ( end) = end_span {
@@ -428,7 +428,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
428
428
let mut err = self . tcx . path_does_not_live_long_enough ( borrow_span,
429
429
& format ! ( "`{}`" , name) ,
430
430
Origin :: Mir ) ;
431
- err. span_label ( borrow_span, "does not live long enough" ) ;
431
+ err. span_label ( borrow_span, "borrowed value does not live long enough" ) ;
432
432
err. span_label ( drop_span, "borrowed value only lives until here" ) ;
433
433
self . tcx . note_and_explain_region ( scope_tree, & mut err,
434
434
"borrowed value must be valid for " ,
@@ -443,7 +443,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
443
443
let mut err = self . tcx . path_does_not_live_long_enough ( proper_span,
444
444
"borrowed value" ,
445
445
Origin :: Mir ) ;
446
- err. span_label ( proper_span, "does not live long enough" ) ;
446
+ err. span_label ( proper_span, "temporary value does not live long enough" ) ;
447
447
err. span_label ( drop_span, "temporary value only lives until here" ) ;
448
448
self . tcx . note_and_explain_region ( scope_tree, & mut err,
449
449
"borrowed value must be valid for " ,
0 commit comments