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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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 21:07:11 -04:00
println!("{}", y);
loop {
loop {
loop {
x = y; //~ ERROR use of moved value
2013-07-02 12:47:32 -07:00
x.clone();
}
}
}
}
}