rust/tests/compile-fail/function_calls/check_callback_abi.rs
2021-05-31 11:15:29 +08:00

16 lines
365 B
Rust

#![feature(core_intrinsics)]
extern "C" fn try_fn(_: *mut u8) {
unreachable!();
}
fn main() {
unsafe {
std::intrinsics::r#try( //~ ERROR calling a function with ABI C using caller ABI Rust
std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
std::ptr::null_mut(),
|_, _| unreachable!(),
);
}
}