rust/src/test/compile-fail/liveness-move-in-while.rs

12 lines
261 B
Rust
Raw Normal View History

fn main() {
2011-07-27 07:19:39 -05:00
let y: int = 42;
let mut x: int;
loop {
log(debug, y);
while true { while true { while true { x <- y; copy x; } } }
//~^ ERROR use of moved variable: `y`
//~^^ NOTE move of variable occurred here
}
}