summary refs log tree commit diff
path: root/src/test/compile-fail/purity-infer-fail.rs
blob: b7666fa865094eabd7eb7e4809fbd0491201629c (plain)
1
2
3
4
5
6
fn something(f: pure fn()) { f(); }

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