]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_borrowck/borrowck/check_loans.rs
Auto merge of #35856 - phimuemue:master, r=brson
[rust.git] / src / librustc_borrowck / borrowck / check_loans.rs
index 9cae270984f0047cce5f873e6004b5c47fe6722b..e86fa9a05f372c4eb1e2503a5a996a6855ac74c8 100644 (file)
@@ -126,7 +126,7 @@ fn borrow(&mut self,
               borrow_id: ast::NodeId,
               borrow_span: Span,
               cmt: mc::cmt<'tcx>,
-              loan_region: ty::Region,
+              loan_region: &'tcx ty::Region,
               bk: ty::BorrowKind,
               loan_cause: euv::LoanCause)
     {
@@ -647,10 +647,13 @@ fn check_for_copy_of_frozen_path(&self,
                 struct_span_err!(self.bccx, span, E0503,
                                  "cannot use `{}` because it was mutably borrowed",
                                  &self.bccx.loan_path_to_string(copy_path))
-                    .span_note(loan_span,
+                    .span_label(loan_span,
                                &format!("borrow of `{}` occurs here",
                                        &self.bccx.loan_path_to_string(&loan_path))
                                )
+                    .span_label(span,
+                               &format!("use of borrowed `{}`",
+                                        &self.bccx.loan_path_to_string(&loan_path)))
                     .emit();
             }
         }