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

13 lines
191 B
Rust
Raw Normal View History

2011-05-04 13:32:06 -05:00
// -*- rust -*-
2011-09-12 05:39:38 -05:00
// error-pattern: pure function calls function not known to be pure
2011-05-04 13:32:06 -05:00
2011-07-27 07:19:39 -05:00
fn g() { }
2011-05-04 13:32:06 -05:00
pure fn f(q: int) -> bool { g(); ret true; }
2011-05-04 13:32:06 -05:00
fn main() {
2011-07-27 07:19:39 -05:00
let x = 0;
2011-05-04 13:32:06 -05:00
2011-07-27 07:19:39 -05:00
check (f(x));
}