1 // compile-flags: -Z borrowck=mir -Z two-phase-borrows
3 // This is similar to two-phase-reservation-sharing-interference.rs
4 // in that it shows a reservation that overlaps with a shared borrow.
6 // Currently, this test fails with lexical lifetimes, but succeeds
7 // with non-lexical lifetimes. (The reason is because the activation
8 // of the mutable borrow ends up overlapping with a lexically-scoped
9 // shared borrow; but a non-lexical shared borrow can end before the
10 // activation occurs.)
12 // So this test is just making a note of the current behavior.
14 #![feature(rustc_attrs)]
17 fn main() { //~ ERROR compilation successful
18 let mut v = vec![0, 1, 2];
23 assert_eq!(v, [0, 1, 2, 3]);