about summary refs log tree commit diff
path: root/tests/ui/consts/const-address-of-interior-mut.rs
blob: 450f1c4a94ebd21da8f1625bd439636625da1673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@check-pass
use std::cell::Cell;

const A: () = { let x = Cell::new(2); &raw const x; };

static B: () = { let x = Cell::new(2); &raw const x; };

static mut C: () = { let x = Cell::new(2); &raw const x; };

const fn foo() {
    let x = Cell::new(0);
    let y = &raw const x;
}

fn main() {}