Closed
Description
fn main() {
unsafe {
use std::mem::transmute;
let a = 0_u8;
let b = &a as *const u8 as *const u64;
//let _c: &u64 = transmute(b);
let _d = *b;
}
}
makes cast_ptr_alignment
report
error: casting from `*const u8` to a more-strictly-aligned pointer (`*const u64`)
We might want to add a note stating what the alignment of u8
and of u64
is.
Metadata
Metadata
Assignees
Labels
No labels