Closed
Description
This is another non-ICE panic revealed by #49891:
$ rustc +dev1 src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs -Z borrowck=mir -Z two-phase-borrows -Z two-phase-beyond-autoref
error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
--> src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs:46:9
|
41 | let shared = &vec;
| ---- immutable borrow occurs here
...
46 | delay = &mut vec;
| ^^^^^^^^^^^^^^^^ mutable borrow occurs here
...
50 | shared[0];
| ------ borrow later used here
thread 'main' panicked at 'assertion failed: match borrow.kind {{
BorrowKind::Shared => false,
BorrowKind::Unique | BorrowKind::Mut {{ .. }} => true,
}}', librustc_mir/borrow_check/mod.rs:1252:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error
For more information about this error, try `rustc --explain E0502`.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
cuviper commentedon Apr 20, 2018
I'm not sure if
should-fail
is supposed to catch compiler panics, but I doubt it.sapphire-arches commentedon Apr 24, 2018
Anything involving
two-phase-borrow-beyond-autoref
is likely completely broken right now. We're not exactly sure if we're ever going to enable it (see #49434 for some context). That test variant should have been disabled, either you can go ahead and do it (by removingnll_beyond
from this line) or I'll submit a PR doing exactly that.cuviper commentedon Apr 24, 2018
@bobtwinkles thanks, I added a commit to #49891 removing the bit you suggested.
pnkfelix commentedon Dec 19, 2018
Re-triaging for #56754. Seems like PR #49891 addressed this. Closing as "fixed."