error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable --> src/main.rs:4:9 | 3 | for value in &vec { | ---- | | | immutable borrow occurs here | immutable borrow later used here 4 | vec.push(*value); | ^^^^^^^^^^^^^^^^ mutable borrow occurs here