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 --- .../miri_unleashed/const_refers_to_static2.rs | 24 ---------------------- 1 file changed, 24 deletions(-) delete mode 100644 src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs (limited to 'src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs') diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs deleted file mode 100644 index 8b8e262fb..000000000 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs +++ /dev/null @@ -1,24 +0,0 @@ -// compile-flags: -Zunleash-the-miri-inside-of-you -// stderr-per-bitwidth -#![allow(const_err)] - -use std::sync::atomic::AtomicUsize; -use std::sync::atomic::Ordering; - -// These only fail during validation (they do not use but just create a reference to a static), -// so they cause an immediate error when *defining* the const. - -const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this value -//~| encountered a reference pointing to a static variable - static FOO: AtomicUsize = AtomicUsize::new(0); - unsafe { &*(&FOO as *const _ as *const usize) } -}; - -// ok some day perhaps -const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value -//~| encountered a reference pointing to a static variable - static FOO: usize = 0; - &FOO -}; - -fn main() {} -- cgit v1.2.3