aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/impure-pred.rs
blob: 17a651cad7a67f40c2afd409874b4c4575263916 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// xfail-stage0
// -*- rust -*-

// error-pattern: impure function used in constraint

fn f(int a, int b) : lt(a,b) {
}

impure fn lt(int a, int b) -> bool {
  let port[int] p = port();
  let chan[int] c = chan(p);
  c <| 10;
  ret true;
}

fn main() {
  let int a = 10;
  let int b = 23;
  check lt(a,b);
  f(a,b);
}