Uh oh!
There was an error while loading. Please reload this page.
MIR borrowck: move span_label to borrowck_errors.rs - #44922
Conversation
… inside `borrowck_errors.rs`
…owed()` inside `borrowck_errors.rs`
…tween AST and MIR borrowck
rust-highfive
commented
Sep 29, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
| println!("{}", f[&s]); | ||
| //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable | ||
| //[ast]~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable | ||
| //[mir]~^^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable (Ast) |
There was a problem hiding this comment.
You can use ~| here instead of ~^^
| f[&s] = 10; | ||
| //~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable | ||
| //[ast]~^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable | ||
| //[mir]~^^ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable (Ast) |
There was a problem hiding this comment.
you can use ~| here instead of ~^^
| _iter.node = & //~ ERROR cannot assign to immutable field | ||
| _iter.node = & //[ast]~ ERROR cannot assign to immutable field | ||
| //[mir]~^ ERROR cannot assign to immutable field `_iter.node` (Ast) | ||
| // FIXME Error for MIR |
There was a problem hiding this comment.
ooh looks like a new mir-borrowck unsoundness bug we need to file
| s[2] = 20; | ||
| //~^ ERROR cannot assign to immutable indexed content | ||
| //[ast]~^ ERROR cannot assign to immutable indexed content | ||
| //[mir]~^^ ERROR cannot assign to immutable indexed content |
There was a problem hiding this comment.
Is there no "(Ast)" suffix emitted here? If so, then it might be the case that the error being generated here is not the responsibility of mir-borrowck. (This is part of a broad category of things that need investigation, the cases where the emitted error is missing its "(Origin)" annotation and thus it is unclear which component is actually detecting the error when we run under -Z borrowck-mir.
pnkfelix
commented
Oct 2, 2017
The refactoring looks fine to me. I had some nits that I noted above, but I don't think any of them are worth blocking landing this PR. |
pnkfelix
commented
Oct 2, 2017
@bors r+ |
bors
commented
Oct 2, 2017
📌 Commit d328d26 has been approved by |
bors
commented
Oct 2, 2017
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
bors
commented
Oct 2, 2017
💔 Test failed - status-appveyor |
@bors retry For the record @nagisa has previously pointed out that this may be evidence of a spurious test failure, see also #44906 (comment) |
nikomatsakis
commented
Oct 3, 2017
r? @pnkfelix |
aidanhs
commented
Oct 3, 2017
Spurious failure issue: #43402 |
pnkfelix
commented
Oct 3, 2017
@bors retry |
bors
commented
Oct 3, 2017
MIR borrowck: move span_label to `borrowck_errors.rs` The calls to `span_label` are moved and factorized for: * E0503 (`cannot_use_when_mutably_borrowed()`) * E0506 (`cannot_assign_to_borrowed()`) Additionnally, the error E0594 (`cannot_assign_static()`) has been factorized between `check_loan.rs` and `borrowc_check.rs`. Part of #44596
bors
commented
Oct 3, 2017
☀️ Test successful - status-appveyor, status-travis |
The calls to
span_labelare moved and factorized for:cannot_use_when_mutably_borrowed())cannot_assign_to_borrowed())Additionnally, the error E0594 (
cannot_assign_static()) has been factorized betweencheck_loan.rsandborrowc_check.rs.Part of #44596