Add test to verify arg size mismatch throws UB

Also: bump up `rust-version`
This commit is contained in:
Samrat Man Singh 2020-04-27 09:35:19 +05:30
parent 97ae5b6d87
commit da86c81e39
2 changed files with 16 additions and 1 deletions

View File

@ -1 +1 @@
14b15521c52549ebbb113173b4abecd124b5a823
e83f7563495dbe2629b0cbc738afb0808c4482e1

View File

@ -0,0 +1,15 @@
#![feature(rustc_private)]
extern crate libc;
// error-pattern: scalar size mismatch
fn main() {
extern "C" {
fn malloc(size: u32) -> *mut std::ffi::c_void;
}
unsafe {
let p1 = malloc(42);
libc::free(p1);
};
}