rust/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
351 B
Rust
Raw Normal View History

#![feature(const_extern_fn)]
extern "C" {
fn regular_in_block();
}
const extern "C" fn bar() {
unsafe {
regular_in_block();
2021-12-09 11:10:05 -06:00
//~^ ERROR: cannot call non-const fn
}
}
extern "C" fn regular() {}
const extern "C" fn foo() {
unsafe {
regular();
2021-12-09 11:10:05 -06:00
//~^ ERROR: cannot call non-const fn
}
}
fn main() {}