summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-78192.rs
blob: b5c3001599ad71de33f32f8011ab8787013be915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass

#![allow(unused_assignments)]

fn main() {
    let a = 1u32;
    let b = 2u32;

    let mut c: *const u32 = &a;
    let d: &u32 = &b;

    let x = unsafe { &*c };
    c = d;
    let z = *x;

    assert_eq!(1, z);
}