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

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

7 lines
169 B
Rust
Raw Normal View History

static X: usize = unsafe { core::ptr::null::<usize>() as usize };
//~^ ERROR: pointers cannot be cast to integers during const eval
2014-09-29 22:22:29 -05:00
fn main() {
assert_eq!(X, 0);
}