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

8 lines
155 B
Rust
Raw Normal View History

fn f() -> int {
let mut x: int;
while 1 == 1 { x = 10; }
2012-08-01 19:30:05 -05:00
return x; //~ ERROR use of possibly uninitialized variable: `x`
}
fn main() { f(); }