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`.