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