]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/projection_qualif.rs
Rollup merge of #67102 - Aaron1011:patch-3, r=Mark-Simulacrum
[rust.git] / src / test / ui / consts / projection_qualif.rs
1 // revisions: stock mut_refs
2
3 #![cfg_attr(mut_refs, feature(const_mut_refs))]
4
5 use std::cell::Cell;
6
7 const FOO: &u32 = {
8     let mut a = 42;
9     {
10         let b: *mut u32 = &mut a; //[stock]~ ERROR may only refer to immutable values
11         unsafe { *b = 5; } //~ ERROR dereferencing raw pointers in constants
12         //[stock]~^ contains unimplemented expression
13     }
14     &{a}
15 };
16
17 fn main() {}