rust/tests/fail/shims/shim_arg_size.rs
2022-08-31 17:32:39 +02:00

11 lines
307 B
Rust

fn main() {
extern "C" {
// Use the wrong type (ie. not `i32`) for the `c` argument.
fn memchr(s: *const std::ffi::c_void, c: u8, n: usize) -> *mut std::ffi::c_void;
}
unsafe {
memchr(std::ptr::null(), 0, 0); //~ ERROR: Undefined Behavior: scalar size mismatch
};
}