aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3667.rs
blob: e72069cf6e4f1743335a67ec89b54ff911c69e50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// { dg-options "-w" }
#![feature(raw_ref_op)]

const pq1: () = {
    let mut x = 2;
    &raw mut x;
}; //~ mutable reference

static B: () = {
    let mut x = 2;
    &raw mut x;
}; //~ mutable reference

static mut C: () = {
    let mut x = 2;
    &raw mut x;
}; //~ mutable reference

const fn foo() {
    let mut x = 0;
    let y = &raw mut x; //~ mutable reference
}

fn main() {}