From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/consts/const-eval/ub-nonnull.rs | 3 +-- 1 file changed, 1 insertion(+), 2 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 777c6d988..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! -- cgit v1.2.3