]> git.lizzy.rs Git - rust.git/blobdiff - tests/compile-fail/deref_fn_ptr.rs
Auto merge of #1308 - RalfJung:miri, r=RalfJung
[rust.git] / tests / compile-fail / deref_fn_ptr.rs
index a56df5bce408e81cfaa0bde60280f6411a26a066..e604f96ea16f1c9951b60b8d5f564f5dc1f26e2b 100644 (file)
@@ -1,9 +1,8 @@
 fn f() {}
 
 fn main() {
-    let x: i32 = unsafe {
-        *std::mem::transmute::<fn(), *const i32>(f) //~ ERROR constant evaluation error [E0080]
-        //~^ NOTE tried to dereference a function pointer
+    let x: u8 = unsafe {
+        *std::mem::transmute::<fn(), *const u8>(f) //~ ERROR contains a function
     };
     panic!("this should never print: {}", x);
 }