about summary refs log tree commit diff
path: root/src/test/compile-fail/liveness-break-uninit-2.rs
blob: 30038dbe96ebd047bbc20a3c6edc9e6229737ae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn foo() -> int {
    let x: int;
    let i: int;

    while 1 != 2  {
        i = 0;
        break;
        x = 0; //! WARNING unreachable statement
    }

    log(debug, x); //! ERROR use of possibly uninitialized variable: `x`

    ret 17;
}

fn main() { log(debug, foo()); }