You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This assertion passes with rustc but not with Miri:
use std::mem;#[repr(packed,C)]structPackedSized{f:u8,d:[u32;4],}#[repr(packed,C)]structPackedUnsized{f:u8,d:[u32],}implPackedSized{fnunsize(&self) -> &PackedUnsized{// We can't unsize via a generic type since then we get the error// that packed structs with unsized tail don't work if the tail// might need dropping.let len = 4usize;unsafe{ mem::transmute((self, len))}}}fnmain(){unsafe{let p = PackedSized{f:0,d:[1,2,3,4]};let p = p.unsize()as*constPackedUnsized;let d = std::ptr::addr_of!((*p).d);assert_eq!(d.cast::<u32>().read_unaligned(),1);}}