Debian Codegraph @

gcc/testsuite/rust/compile/issue-3667.rs

raw
1 // { dg-options "-w" }
2 #![feature(raw_ref_op)]
3
4 const pq1: () = {
5 let mut x = 2;
6 &raw mut x;
7 }; //~ mutable reference
8
9 static B: () = {
10 let mut x = 2;
11 &raw mut x;
12 }; //~ mutable reference
13
14 static mut C: () = {
15 let mut x = 2;
16 &raw mut x;
17 }; //~ mutable reference
18
19 const fn foo() {
20 let mut x = 0;
21 let y = &raw mut x; //~ mutable reference
22 }
23
24 fn main() {}