rust/src/test/compile-fail/impure-pred.rs
2012-05-30 11:26:15 -07:00

15 lines
195 B
Rust

// -*- rust -*-
fn g() { }
pure fn f(_q: int) -> bool {
g(); //! ERROR access to impure function prohibited in pure context
ret true;
}
fn main() {
let x = 0;
check (f(x));
}