rust/src/test/compile-fail/borrowck-mut-boxed-vec.rs

8 lines
118 B
Rust
Raw Normal View History

fn main() {
let v = @mut [ 1, 2, 3 ];
for v.each |_x| { //~ ERROR illegal borrow
v[1] = 4;
}
}