about summary refs log tree commit diff
path: root/tests/ui/consts/const-address-of.rs
blob: 39ed430e17ea69a2fa3b639c1672a1230370be9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ check-pass

const A: *const i32 = &raw const *&2;
static B: () = { &raw const *&2; };
static mut C: *const i32 = &raw const *&2;
const D: () = { let x = 2; &raw const x; };
static E: () = { let x = 2; &raw const x; };
static mut F: () = { let x = 2; &raw const x; };

const fn const_ptr() {
    let x = 0;
    let ptr = &raw const x;
    let r = &x;
    let ptr2 = &raw const *r;
}

fn main() {}