Skip to content

Commit 9d777d8

Browse files
committed
add test for caller ABI check
1 parent b38dc83 commit 9d777d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/compile-fail/check_arg_abi.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn main() {
2+
extern "Rust" {
3+
fn malloc(size: usize) -> *mut std::ffi::c_void;
4+
}
5+
6+
unsafe {
7+
let _ = malloc(0); //~ ERROR calling a function with ABI C using caller ABI Rust
8+
};
9+
}

0 commit comments

Comments
 (0)