rust/src/test/compile-fail/liveness-break-uninit.rs

15 lines
240 B
Rust
Raw Normal View History

fn foo() -> int {
let x: int;
loop {
break;
x = 0; //! WARNING unreachable statement
}
log(debug, x); //! ERROR use of possibly uninitialized variable: `x`
ret 17;
}
fn main() { log(debug, foo()); }