]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-address-of.rs
Rollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser
[rust.git] / tests / ui / consts / const-address-of.rs
1 // check-pass
2
3 #![feature(raw_ref_op)]
4
5 const A: *const i32 = &raw const *&2;
6 static B: () = { &raw const *&2; };
7 static mut C: *const i32 = &raw const *&2;
8 const D: () = { let x = 2; &raw const x; };
9 static E: () = { let x = 2; &raw const x; };
10 static mut F: () = { let x = 2; &raw const x; };
11
12 const fn const_ptr() {
13     let x = 0;
14     let ptr = &raw const x;
15     let r = &x;
16     let ptr2 = &raw const *r;
17 }
18
19 fn main() {}