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