rust/src/test/ui/liveness/liveness-move-in-loop.rs

18 lines
328 B
Rust
Raw Normal View History

2015-01-07 20:53:58 -06:00
#![feature(box_syntax)]
fn main() {
let y: Box<isize> = box 42;
let mut x: Box<isize>;
loop {
2014-10-14 20:07:11 -05:00
println!("{}", y);
loop {
loop {
loop {
x = y; //~ ERROR use of moved value
2013-07-02 14:47:32 -05:00
x.clone();
}
}
}
}
}