rust/tests/compile-fail/zst1.rs
2019-06-23 20:19:26 +02:00

6 lines
170 B
Rust

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