rust/tests/fail/zst1.rs
2022-07-11 11:48:56 +00:00

6 lines
159 B
Rust

fn main() {
// make sure ZST locals cannot be accessed
let x = &() as *const () as *const i8;
let _val = unsafe { *x }; //~ ERROR: out-of-bounds
}