]> git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / consts / const-extern-fn / const-extern-fn-call-extern-fn.rs
1 #![feature(const_extern_fn)]
2
3 extern "C" {
4 fn regular_in_block();
5 }
6
7 const extern fn bar() {
8 unsafe {
9 regular_in_block();
10 //~^ ERROR: can only call other `const fn` within a `const fn`
11 }
12 }
13
14 extern fn regular() {}
15
16 const extern fn foo() {
17 unsafe {
18 regular();
19 //~^ ERROR: can only call other `const fn` within a `const fn`
20 }
21 }
22
23 fn main() {}