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;
9 //~^ WARN: skipping const checks
11 static BAR: &mut () = &mut ();
12 //~^ WARN: skipping const checks
16 static BOO: &mut Foo<()> = &mut Foo(());
17 //~^ WARN: skipping const checks
20 x: &'static UnsafeCell<i32>,
23 unsafe impl Sync for Meh {}
25 static MEH: Meh = Meh {
26 x: &UnsafeCell::new(42),
27 //~^ WARN: skipping const checks
30 static OH_YES: &mut i32 = &mut 42;
31 //~^ WARN: skipping const checks
37 *OH_YES = 99; //~ ERROR cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item