]> git.lizzy.rs Git - rust.git/blobdiff - tests/compile-fail/execute_memory.rs
Auto merge of #1308 - RalfJung:miri, r=RalfJung
[rust.git] / tests / compile-fail / execute_memory.rs
index 413c6602114ba37ef6f39fd2cde84c211d838519..2e6b58a753cd9d8f01eda654fba5a67664f53ba0 100644 (file)
@@ -1,10 +1,12 @@
+// Validation makes this fail in the wrong place
+// compile-flags: -Zmiri-disable-validation
+
 #![feature(box_syntax)]
 
 fn main() {
-    //FIXME: this span is wrong
-    let x = box 42; //~ ERROR: tried to treat a memory pointer as a function pointer
+    let x = box 42;
     unsafe {
         let f = std::mem::transmute::<Box<i32>, fn()>(x);
-        f()
+        f() //~ ERROR function pointer but it does not point to a function
     }
 }