]> git.lizzy.rs Git - rust.git/commitdiff
Replace error-pattern with annotation; remove unreachable line
authorSamrat Man Singh <samratmansingh@gmail.com>
Mon, 27 Apr 2020 10:04:42 +0000 (15:34 +0530)
committerSamrat Man Singh <samratmansingh@gmail.com>
Mon, 27 Apr 2020 10:04:42 +0000 (15:34 +0530)
tests/compile-fail/shim_arg_size.rs

index a31461fdbf48dd9acb6f88f56d6ed3f25b9edb88..dd8d6dac51de882fc5d8ad2db13d67b34bb21db1 100644 (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
     };
 }