@@ -1009,11 +1009,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10091009 }
10101010
10111011 err_out_of_scope( super_scope, sub_scope, cause) => {
1012- let ( value_kind, value_msg, is_temporary ) = match err. cmt . cat {
1012+ let ( value_kind, value_msg) = match err. cmt . cat {
10131013 mc:: Categorization :: Rvalue ( _) =>
1014- ( "temporary value" , "temporary value created here" , true ) ,
1014+ ( "temporary value" , "temporary value created here" ) ,
10151015 _ =>
1016- ( "borrowed value" , "does not live long enough" , false )
1016+ ( "borrowed value" , "borrow occurs here" )
10171017 } ;
10181018
10191019 let is_closure = match cause {
@@ -1026,14 +1026,14 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10261026 Some ( primary) => {
10271027 db. span = MultiSpan :: from_span ( s) ;
10281028 db. span_label ( primary, & format ! ( "capture occurs here" ) ) ;
1029- db. span_label ( s, & value_msg ) ;
1029+ db. span_label ( s, & "does not live long enough" ) ;
10301030 true
10311031 }
10321032 None => false
10331033 }
10341034 }
10351035 _ => {
1036- db. span_label ( error_span, & value_msg ) ;
1036+ db. span_label ( error_span, & "does not live long enough" ) ;
10371037 false
10381038 }
10391039 } ;
@@ -1043,11 +1043,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10431043
10441044 match ( sub_span, super_span) {
10451045 ( Some ( s1) , Some ( s2) ) if s1 == s2 => {
1046- if !is_temporary && ! is_closure {
1046+ if !is_closure {
10471047 db. span = MultiSpan :: from_span ( s1) ;
1048- db. span_label ( error_span, & format ! ( "borrow occurs here" ) ) ;
1048+ db. span_label ( error_span, & value_msg ) ;
10491049 let msg = match opt_loan_path ( & err. cmt ) {
1050- None => "borrowed value" . to_string ( ) ,
1050+ None => value_kind . to_string ( ) ,
10511051 Some ( lp) => {
10521052 format ! ( "`{}`" , self . loan_path_to_string( & lp) )
10531053 }
@@ -1060,17 +1060,16 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10601060 db. note ( "values in a scope are dropped in the opposite order \
10611061 they are created") ;
10621062 }
1063- ( Some ( s1) , Some ( s2) ) if !is_temporary && ! is_closure => {
1063+ ( Some ( s1) , Some ( s2) ) if !is_closure => {
10641064 db. span = MultiSpan :: from_span ( s2) ;
1065- db. span_label ( error_span, & format ! ( "borrow occurs here" ) ) ;
1065+ db. span_label ( error_span, & value_msg ) ;
10661066 let msg = match opt_loan_path ( & err. cmt ) {
1067- None => "borrowed value" . to_string ( ) ,
1067+ None => value_kind . to_string ( ) ,
10681068 Some ( lp) => {
10691069 format ! ( "`{}`" , self . loan_path_to_string( & lp) )
10701070 }
10711071 } ;
1072- db. span_label ( s2,
1073- & format ! ( "{} dropped here while still borrowed" , msg) ) ;
1072+ db. span_label ( s2, & format ! ( "{} dropped here while still borrowed" , msg) ) ;
10741073 db. span_label ( s1, & format ! ( "{} needs to live until here" , value_kind) ) ;
10751074 }
10761075 _ => {
0 commit comments