fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0502]: cannot borrow `vec` as immutable because it is also borrowed as mutable 2 --> $DIR/suggest-local-var-for-vector.rs:3:9 3 | 4LL | vec[vec.len() - 1] = 123; 5 | ----^^^----------- 6 | | || 7 | | |immutable borrow occurs here 8 | | mutable borrow later used here 9 | mutable borrow occurs here 10 | 11help: try adding a local storing this... 12 --> $DIR/suggest-local-var-for-vector.rs:3:9 13 | 14LL | vec[vec.len() - 1] = 123; 15 | ^^^^^^^^^ 16help: ...and then using that local here 17 --> $DIR/suggest-local-var-for-vector.rs:3:8 18 | 19LL | vec[vec.len() - 1] = 123; 20 | ^^^^^^^^^^^^^^^ 21 22error: aborting due to previous error 23 24For more information about this error, try `rustc --explain E0502`.