]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/consts/const-eval/ub-nonnull.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / ub-nonnull.rs
index 75c02a8da194fdc2904dbcdca00a620a633a31a4..259707b8028da33ed0b6288655850180741b233a 100644 (file)
@@ -16,8 +16,7 @@ const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
 const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
     let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
     // Use address-of-element for pointer arithmetic. This could wrap around to null!
-    let out_of_bounds_ptr = &ptr[255]; //~ ERROR any use of this value will cause an error
-    //~| WARN this was previously accepted by the compiler but is being phased out
+    let out_of_bounds_ptr = &ptr[255]; //~ ERROR evaluation of constant value failed
     mem::transmute(out_of_bounds_ptr)
 } };