Skip to content

Commit da86c81

Browse files
committed
Add test to verify arg size mismatch throws UB
Also: bump up `rust-version`
1 parent 97ae5b6 commit da86c81

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14b15521c52549ebbb113173b4abecd124b5a823
1+
e83f7563495dbe2629b0cbc738afb0808c4482e1

tests/compile-fail/shim_arg_size.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(rustc_private)]
2+
3+
extern crate libc;
4+
5+
// error-pattern: scalar size mismatch
6+
fn main() {
7+
extern "C" {
8+
fn malloc(size: u32) -> *mut std::ffi::c_void;
9+
}
10+
11+
unsafe {
12+
let p1 = malloc(42);
13+
libc::free(p1);
14+
};
15+
}

0 commit comments

Comments
 (0)