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

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

14 lines
365 B
Rust
Raw Normal View History

fn main() {
let y: Box<isize> = 42.into();
let mut x: Box<isize>;
loop {
println!("{}", y); //~ ERROR borrow of moved value: `y`
2013-07-02 19:47:32 +00:00
while true { while true { while true { x = y; x.clone(); } } }
//~^ WARN denote infinite loops with
//~| WARN denote infinite loops with
//~| WARN denote infinite loops with
}
}