]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/pointer_byte_read.rs
Auto merge of #852 - lzutao:rustup, r=RalfJung
[rust.git] / tests / compile-fail / pointer_byte_read.rs
1 fn main() {
2     let x = 13;
3     let y = &x;
4     let z = &y as *const &i32 as *const u8;
5     // the deref fails, because we are reading only a part of the pointer
6     let _val = unsafe { *z }; //~ ERROR tried to access part of a pointer value as raw bytes
7 }