]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/shims/shim_arg_size.rs
Auto merge of #100865 - compiler-errors:parent-substs-still, r=cjgillot
[rust.git] / src / tools / miri / tests / fail / shims / shim_arg_size.rs
1 fn main() {
2     extern "C" {
3         // Use the wrong type (ie. not `i32`) for the `c` argument.
4         fn memchr(s: *const std::ffi::c_void, c: u8, n: usize) -> *mut std::ffi::c_void;
5     }
6
7     unsafe {
8         memchr(std::ptr::null(), 0, 0); //~ ERROR: Undefined Behavior: scalar size mismatch
9     };
10 }