rust/src/test/ui/writing-to-immutable-vec.rs
2018-12-25 21:08:33 -07:00

5 lines
131 B
Rust

fn main() {
let v: Vec<isize> = vec![1, 2, 3];
v[1] = 4; //~ ERROR cannot borrow immutable local variable `v` as mutable
}