1 // compile-flags: -Zunleash-the-miri-inside-of-you
4 use std::cell::UnsafeCell;
6 // a test demonstrating what things we could allow with a smarter const qualification
8 static FOO: &&mut u32 = &&mut 42;
10 static BAR: &mut () = &mut ();
14 static BOO: &mut Foo<()> = &mut Foo(());
17 x: &'static UnsafeCell<i32>,
20 unsafe impl Sync for Meh {}
22 static MEH: Meh = Meh {
23 x: &UnsafeCell::new(42),
26 static OH_YES: &mut i32 = &mut 42;
30 *MEH.x.get() = 99; //~ WARN skipping const checks
31 //~^ WARN skipping const checks
33 *OH_YES = 99; //~ ERROR cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item
34 //~^ WARN skipping const checks