From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/consts/const-eval/ub-nonnull.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/ui/consts/const-eval/ub-nonnull.rs') diff --git a/src/test/ui/consts/const-eval/ub-nonnull.rs b/src/test/ui/consts/const-eval/ub-nonnull.rs index 259707b80..d22a99cd0 100644 --- a/src/test/ui/consts/const-eval/ub-nonnull.rs +++ b/src/test/ui/consts/const-eval/ub-nonnull.rs @@ -1,6 +1,6 @@ // stderr-per-bitwidth #![feature(rustc_attrs)] -#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here +#![allow(invalid_value)] // make sure we cannot allow away the errors tested here use std::mem; use std::ptr::NonNull; @@ -12,7 +12,6 @@ const NON_NULL_PTR: NonNull = unsafe { mem::transmute(&1) }; const NULL_PTR: NonNull = unsafe { mem::transmute(0usize) }; //~^ ERROR it is undefined behavior to use this value -#[deny(const_err)] // this triggers a `const_err` so validation does not even happen const OUT_OF_BOUNDS_PTR: NonNull = { 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! @@ -31,7 +30,8 @@ union MaybeUninit { init: T, } const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init }; -//~^ ERROR it is undefined behavior to use this value +//~^ ERROR evaluation of constant value failed +//~| uninitialized // Also test other uses of rustc_layout_scalar_valid_range_start -- cgit v1.2.3