Skip to content

Commit 86a7347

Browse files
committed
mir-borrowck: Add borrow data parameter to report_use_while_mutably_borrowed()
1 parent 70ef08f commit 86a7347

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_mir/borrow_check.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
419419
self.each_borrow_involving_path(
420420
context, lvalue_span.0, flow_state, |this, _idx, borrow| {
421421
if !borrow.compatible_with(BorrowKind::Shared) {
422-
this.report_use_while_mutably_borrowed(context, lvalue_span);
422+
this.report_use_while_mutably_borrowed(context, lvalue_span, borrow);
423423
Control::Break
424424
} else {
425425
Control::Continue
@@ -914,7 +914,8 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
914914

915915
fn report_use_while_mutably_borrowed(&mut self,
916916
_context: Context,
917-
(lvalue, span): (&Lvalue, Span)) {
917+
(lvalue, span): (&Lvalue, Span),
918+
borrow : &BorrowData) {
918919
let mut err = self.tcx.cannot_use_when_mutably_borrowed(
919920
span, &self.describe_lvalue(lvalue), Origin::Mir);
920921
// FIXME 1: add span_label for "borrow of `()` occurs here"

0 commit comments

Comments
 (0)