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