about summary refs log tree commit diff
path: root/src/test/compile-fail/liveness-if-with-else.rs
blob: dbb3e6b164546f48b072034aaa0b95948a874d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
fn foo(x: int) { log(debug, x); }

fn main() {
    let x: int;
    if 1 > 2 {
        #debug("whoops");
    } else {
        x = 10;
    }
    foo(x); //! ERROR use of possibly uninitialized variable: `x`
}