rust/tests/ui/borrowck/borrowck-reinit.rs

8 lines
180 B
Rust
Raw Normal View History

2017-11-09 08:46:35 -06:00
fn main() {
let mut x = Box::new(0);
let _u = x; // error shouldn't note this move
x = Box::new(1);
drop(x);
2019-05-02 17:34:15 -05:00
let _ = (1,x); //~ ERROR use of moved value: `x`
2017-11-09 08:46:35 -06:00
}