rust/src/test/compile-fail/purity-infer-fail.rs
2012-09-26 18:02:07 -07:00

7 lines
165 B
Rust

fn something(f: pure fn()) { f(); }
fn main() {
let mut x = ~[];
something(|| x.push(0) ); //~ ERROR access to impure function prohibited in pure context
}