1
Fork 0

Auto merge of #77692 - PankajChaudhary5:issue-76630, r=davidtwco

Added better error message for shared borrow treated as unique for purposes of lifetimes

Part of Issue #76630

r? `@jyn514`
This commit is contained in:
bors 2020-12-24 07:32:19 +00:00
commit c34c015fe2
8 changed files with 18 additions and 17 deletions

View file

@ -68,9 +68,10 @@ impl<'cx, 'tcx> crate::borrow_check::MirBorrowckCtxt<'cx, 'tcx> {
err.span_label(
new_loan_span,
format!(
"mutable borrow starts here in previous \
iteration of loop{}",
opt_via
"{}{} was mutably borrowed here in the previous iteration of the loop{}",
desc,
via(opt_via),
opt_via,
),
);
if let Some(old_load_end_span) = old_load_end_span {