rust/src/test/ui/borrowck/borrowck-reinit.rs
2018-12-25 21:08:33 -07:00

11 lines
270 B
Rust

// compile-flags: -Z borrowck=compare
fn main() {
let mut x = Box::new(0);
let _u = x; // error shouldn't note this move
x = Box::new(1);
drop(x);
let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
//~^ ERROR use of moved value: `x` (Mir)
}