rust/src/test/ui/borrowck/borrowck-reinit.rs

11 lines
270 B
Rust
Raw Normal View History

// compile-flags: -Z borrowck=compare
2017-11-09 17:46:35 +03:00
fn main() {
let mut x = Box::new(0);
let _u = x; // error shouldn't note this move
x = Box::new(1);
drop(x);
2017-11-20 13:13:27 +01:00
let _ = (1,x); //~ ERROR use of moved value: `x` (Ast)
//~^ ERROR use of moved value: `x` (Mir)
2017-11-09 17:46:35 +03:00
}