rust/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
2023-01-11 09:32:08 +00:00

24 lines
351 B
Rust

#![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() {}