rust/tests/ui/consts/dangling_raw_ptr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
150 B
Rust
Raw Normal View History

const FOO: *const u32 = { //~ ERROR encountered dangling pointer in final value of constant
let x = 42;
&x
};
fn main() {
let x = FOO;
}