For the following snippet:
let mut v = vec![1, 2, 3, 4, 5]; // immutable borrow occurs here. let first = &v; // mutable borrow occurs here. v.push(6);
According to rust reference and borrow rules, this snippet should not compile, but actually compile successfully with rustc 1.35.
Can someone explain why ?