summary refs log tree commit diff
path: root/src/test/compile-fail/tstate-while-cond.rs
blob: afc77fa42c63d141ea9746c6c01a15ac264c7cbb (plain)
1
2
3
4
5
6
7
pure fn is_even(i: int) -> bool { (i%2) == 0 }
fn even(i: int) : is_even(i) -> int { i }

fn main() {
    let x: int = 4;
    while even(x) != 0 { } //~ ERROR unsatisfied precondition
}