]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-address-of-mut.rs
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[rust.git] / src / test / ui / consts / const-address-of-mut.rs
1 #![feature(raw_ref_op)]
2
3 const A: () = { let mut x = 2; &raw mut x; };           //~ ERROR `&raw mut` is not allowed
4
5 static B: () = { let mut x = 2; &raw mut x; };          //~ ERROR `&raw mut` is not allowed
6
7 static mut C: () = { let mut x = 2; &raw mut x; };      //~ ERROR `&raw mut` is not allowed
8
9 const fn foo() {
10     let mut x = 0;
11     let y = &raw mut x;                                 //~ ERROR `&raw mut` is not allowed
12 }
13
14 fn main() {}