about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/zst_local_oob.rs
blob: 2bf184c72bae2b2bf450ba139aef0d4d9d97f584 (plain)
1
2
3
4
5
fn main() {
    // make sure ZST locals cannot be accessed
    let x = &() as *const () as *const i8;
    let _val = unsafe { *x }; //~ ERROR: attempting to access 1 byte
}