about summary refs log tree commit diff
path: root/src/test/compile-fail/while-loop-pred-constraints.rs
blob: bf761b31199820f2b0a0d6d45ee7a46e9dcaf15c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// error-pattern: Unsatisfied precondition constraint (for example, even(y

fn print_even(y: int) : even(y) { log y; }

pure fn even(y: int) -> bool { true }

fn main() {

    let y: int = 42;
    let x: int = 1;
    check (even(y));
    while true {
        print_even(y);
        while true { while true { while true { y += x; } } }
    }
}