summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
blob: eccda49db3eb54481ffd581cd0c07b0206c00960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![feature(const_extern_fn)]

extern "C" {
    fn regular_in_block();
}

const extern "C" fn bar() {
    unsafe {
        regular_in_block();
        //~^ ERROR: cannot call non-const fn
    }
}

extern "C" fn regular() {}

const extern "C" fn foo() {
    unsafe {
        regular();
        //~^ ERROR: cannot call non-const fn
    }
}

fn main() {}