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