From 9d777d84109ab6ef7b36d9ef42c94a1ff6c7d65c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 29 Jan 2021 21:16:17 +0100 Subject: [PATCH] add test for caller ABI check --- tests/compile-fail/check_arg_abi.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/compile-fail/check_arg_abi.rs 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 + }; +}