Replace error-pattern with annotation; remove unreachable line

This commit is contained in:
Samrat Man Singh 2020-04-27 15:34:42 +05:30
parent ae9796b9d8
commit 73f258c451

View file

@ -1,8 +1,5 @@
#![feature(rustc_private)]
extern crate libc;
// error-pattern: scalar size mismatch
fn main() {
extern "C" {
// Use the wrong type(ie. not the pointer width) for the `size`
@ -15,7 +12,6 @@ fn main() {
}
unsafe {
let p1 = malloc(42);
libc::free(p1);
let _p1 = malloc(42); //~ ERROR Undefined Behavior: scalar size mismatch
};
}