diff --git a/tests/compile-fail/check_arg_abi.rs b/tests/compile-fail/check_arg_abi.rs new file mode 100644 index 00000000000..5656c7a0e4c --- /dev/null +++ b/tests/compile-fail/check_arg_abi.rs @@ -0,0 +1,9 @@ +fn main() { + extern "Rust" { + fn malloc(size: usize) -> *mut std::ffi::c_void; + } + + unsafe { + let _ = malloc(0); //~ ERROR calling a function with ABI C using caller ABI Rust + }; +}