summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/static-raw-pointer-interning2.rs
blob: 2b915fd7cb3291c64a9fe316479e4fd78c1e3d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass

static mut FOO: Foo = Foo {
    field: &mut [42] as *mut [i32] as *mut i32,
};

struct Foo {
    field: *mut i32,
}

unsafe impl Sync for Foo {}

fn main() {
    assert_eq!(unsafe { *FOO.field = 69; *FOO.field }, 69);
}