2017-06-04 12:43:31 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 13;
|
|
|
|
let y = &x;
|
|
|
|
let z = &y as *const &i32 as *const usize;
|
|
|
|
let ptr_bytes = unsafe { *z }; // the actual deref is fine, because we read the entire pointer at once
|
2018-08-14 13:00:18 -05:00
|
|
|
let _ = ptr_bytes / 432; //~ ERROR constant evaluation error
|
2018-05-09 10:45:16 -05:00
|
|
|
//~^ NOTE tried to access part of a pointer value as raw bytes
|
2017-06-04 12:43:31 -05:00
|
|
|
}
|