Add test to verify arg size mismatch throws UB
Also: bump up `rust-version`
This commit is contained in:
parent
97ae5b6d87
commit
da86c81e39
@ -1 +1 @@
|
||||
14b15521c52549ebbb113173b4abecd124b5a823
|
||||
e83f7563495dbe2629b0cbc738afb0808c4482e1
|
||||
|
15
tests/compile-fail/shim_arg_size.rs
Normal file
15
tests/compile-fail/shim_arg_size.rs
Normal 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);
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user