rust/tests/ui/borrowck/suggest-storing-local-var-for-vector.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

5 lines
161 B
Rust
Raw Normal View History

fn main() {
let mut vec = vec![0u32; 420];
vec[vec.len() - 1] = 123; //~ ERROR cannot borrow `vec` as immutable because it is also borrowed as mutable
}