summary refs log tree commit diff
path: root/src/test/compile-fail/impure-pred.rs
blob: aef5080e3ae196cc20ea0e8195118402969b1c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// -*- 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));
}