]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/consts/const-eval/const_raw_ptr_ops2.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / const_raw_ptr_ops2.rs
index c6a623b29327699971454ae03676a2bf090e8e8d..11f6a58be360ce96550a973884a357396f2006af 100644 (file)
@@ -1,16 +1,12 @@
-#![feature(const_raw_ptr_to_usize_cast, const_raw_ptr_deref)]
+#![feature(const_raw_ptr_deref)]
 
 fn main() {}
 
-// unconst and fine
-const Y: usize = unsafe { 42usize as *const i32 as usize + 1 };
-// unconst and bad, will thus error in miri
-const Y2: usize = unsafe { &1 as *const i32 as usize + 1 }; //~ ERROR any use of this
-//~| WARN this was previously accepted by the compiler but is being phased out
-// unconst and fine
+// fine
 const Z: i32 = unsafe { *(&1 as *const i32) };
-// unconst and bad, will thus error in miri
-const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR any use of this value will cause
-//~| WARN this was previously accepted by the compiler but is being phased out
-const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR any use of this value will cause
-//~| WARN this was previously accepted by the compiler but is being phased out
+
+// bad, will thus error in miri
+const Z2: i32 = unsafe { *(42 as *const i32) }; //~ ERROR evaluation of constant value failed
+//~| is not a valid pointer
+const Z3: i32 = unsafe { *(44 as *const i32) }; //~ ERROR evaluation of constant value failed
+//~| is not a valid pointer