rust/tests/ui/consts/issue-18294.rs

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

6 lines
164 B
Rust
Raw Normal View History

fn main() {
const X: u32 = 1;
2021-07-10 11:03:35 +00:00
const Y: usize = unsafe { &X as *const u32 as usize }; //~ ERROR pointers cannot be cast to integers
println!("{}", Y);
}