2021-05-29 12:36:06 -05:00
|
|
|
#![feature(core_intrinsics)]
|
|
|
|
|
|
|
|
extern "C" fn try_fn(_: *mut u8) {
|
|
|
|
unreachable!();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
2021-05-30 22:05:04 -05:00
|
|
|
// Make sure we check the ABI when Miri itself invokes a function
|
|
|
|
// as part of a shim implementation.
|
2022-06-22 00:56:50 -05:00
|
|
|
std::intrinsics::r#try(
|
2022-07-11 06:44:55 -05:00
|
|
|
//~^ ERROR: calling a function with ABI C using caller ABI Rust
|
2021-05-29 12:36:06 -05:00
|
|
|
std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
|
|
|
|
std::ptr::null_mut(),
|
|
|
|
|_, _| unreachable!(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|