about summary refs log tree commit diff
path: root/src/test/compile-fail/while-loop-pred-constraints.rs
blob: 3908004b68879f6d13630a77ac68e71d1ef37b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// xfail-stage0
// error-pattern: Unsatisfied precondition constraint (for example, even(y

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

pred even(int y) -> bool {
  true
}

fn main() {

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