rust/tests/ui/liveness/liveness-move-in-loop.rs

18 lines
308 B
Rust
Raw Normal View History

fn main() {
let y: Box<isize> = 42.into();
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();
}
}
}
}
}