rust/src/test/ui/issues/issue-52023-array-size-pointer-cast.rs

5 lines
170 B
Rust
Raw Normal View History

fn main() {
let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants
//~^ ERROR it is undefined behavior to use this value
}