1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
const unsafe extern "C" fn foo() -> usize {
5
}
const unsafe extern "C-unwind" fn bar() -> usize {
5
}
fn main() {
let a: [u8; foo()];
//~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
foo();
//~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
let b: [u8; bar()];
//~^ ERROR call to unsafe function `bar` is unsafe and requires unsafe function or block
bar();
//~^ ERROR call to unsafe function `bar` is unsafe and requires unsafe function or block
}
|