aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/use-uninit-3.rs
blob: e65454518a3284262afb17fccb761d32f203e9a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// error-pattern:Unsatisfied precondition

fn foo(int x) {
  log x;
}

fn main() {
  let int x;
  if (1 > 2) {
    log "whoops";
  } else {
    x = 10;
  }
  foo(x);
}