rust/src/test/compile-fail/impure-pred.rs

21 lines
302 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
// -*- 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 {
2010-06-23 23:03:09 -05:00
let port[int] p = port();
let chan[int] c = chan(p);
c <| 10;
ret true;
2010-06-23 23:03:09 -05:00
}
fn main() {
let int a = 10;
let int b = 23;
check lt(a,b);
f(a,b);
}