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

12 lines
261 B
Rust
Raw Normal View History

fn main() {
2011-07-27 14:19:39 +02: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
}
}