diff options
| author | Basile Desloges <basile.desloges@gmail.com> | 2017-09-24 15:25:49 +0200 |
|---|---|---|
| committer | Basile Desloges <basile.desloges@gmail.com> | 2017-09-26 19:09:56 +0200 |
| commit | 34d36c0168e1604adfe1a512fb9c7817c38d507e (patch) | |
| tree | 7e9bddaebdbd071da0de5818877d272c08330912 | |
| parent | 1c4510adc81bd7623bc2993b42ee7d87320f1f2b (diff) | |
| download | rust-34d36c0168e1604adfe1a512fb9c7817c38d507e.tar.gz rust-34d36c0168e1604adfe1a512fb9c7817c38d507e.zip | |
mir-borrowck: Add borrow data parameter to `report_illegal_mutation_of_borrowed()`
| -rw-r--r-- | src/librustc_mir/borrow_check.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_mir/borrow_check.rs b/src/librustc_mir/borrow_check.rs index 9e261d60248..f324e20b26d 100644 --- a/src/librustc_mir/borrow_check.rs +++ b/src/librustc_mir/borrow_check.rs @@ -412,7 +412,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx> WriteKind::StorageDead | WriteKind::Mutate => this.report_illegal_mutation_of_borrowed( - context, lvalue_span), + context, lvalue_span, borrow), WriteKind::Move => this.report_move_out_while_borrowed( context, lvalue_span, borrow), @@ -975,7 +975,10 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx> err.emit(); } - fn report_illegal_mutation_of_borrowed(&mut self, _: Context, (lvalue, span): (&Lvalue, Span)) { + fn report_illegal_mutation_of_borrowed(&mut self, + _: Context, + (lvalue, span): (&Lvalue, Span), + loan: &BorrowData) { let mut err = self.tcx.cannot_assign_to_borrowed( span, &self.describe_lvalue(lvalue), Origin::Mir); // FIXME: add span labels for borrow and assignment points |
