rust/src/test/compile-fail/borrowck-wg-move-base-2.rs

12 lines
183 B
Rust
Raw Normal View History

fn foo(x: &mut int) {
let mut a = 3;
let mut _y = &mut *x;
let _z = &mut *_y;
_y = &mut a; //~ ERROR assigning to mutable local variable prohibited
}
fn main() {
}