main()1 fn main() {
2     extern "C" {
3         // Use the wrong type(ie. not the pointer width) for the `size`
4         // argument.
5         #[cfg(target_pointer_width="64")]
6         fn malloc(size: u32) -> *mut std::ffi::c_void;
7 
8         #[cfg(target_pointer_width="32")]
9         fn malloc(size: u16) -> *mut std::ffi::c_void;
10     }
11 
12     unsafe {
13         let _p1 = malloc(42); //~ ERROR Undefined Behavior: scalar size mismatch
14     };
15 }
16