summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/dangling_raw_ptr.rs
blob: ddd1fb1ba76e163124a485ff3643e78114aa6309 (plain)
1
2
3
4
5
6
7
8
const FOO: *const u32 = { //~ ERROR encountered dangling pointer in final constant
    let x = 42;
    &x
};

fn main() {
    let x = FOO;
}