From 73f258c451a36294587e48166f72fdae01217891 Mon Sep 17 00:00:00 2001 From: Samrat Man Singh Date: Mon, 27 Apr 2020 15:34:42 +0530 Subject: [PATCH] Replace error-pattern with annotation; remove unreachable line --- tests/compile-fail/shim_arg_size.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/compile-fail/shim_arg_size.rs b/tests/compile-fail/shim_arg_size.rs index a31461fdbf48..dd8d6dac51de 100644 --- a/tests/compile-fail/shim_arg_size.rs +++ b/tests/compile-fail/shim_arg_size.rs @@ -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 }; }