Skip to content

Commit 34d36c0

Browse files
committed
mir-borrowck: Add borrow data parameter to report_illegal_mutation_of_borrowed()
1 parent 1c4510a commit 34d36c0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc_mir/borrow_check.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
412412
WriteKind::StorageDead |
413413
WriteKind::Mutate =>
414414
this.report_illegal_mutation_of_borrowed(
415-
context, lvalue_span),
415+
context, lvalue_span, borrow),
416416
WriteKind::Move =>
417417
this.report_move_out_while_borrowed(
418418
context, lvalue_span, borrow),
@@ -975,7 +975,10 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
975975
err.emit();
976976
}
977977

978-
fn report_illegal_mutation_of_borrowed(&mut self, _: Context, (lvalue, span): (&Lvalue, Span)) {
978+
fn report_illegal_mutation_of_borrowed(&mut self,
979+
_: Context,
980+
(lvalue, span): (&Lvalue, Span),
981+
loan: &BorrowData) {
979982
let mut err = self.tcx.cannot_assign_to_borrowed(
980983
span, &self.describe_lvalue(lvalue), Origin::Mir);
981984
// FIXME: add span labels for borrow and assignment points

0 commit comments

Comments
 (0)