]>
git.proxmox.com Git - rustc.git/blob - tests/ui/deriving/deriving-with-repr-packed.rs
2 // check that derive on a packed struct does not call field
3 // methods with a misaligned field.
11 fn check_align(ptr
: *const Aligned
) {
12 assert_eq
!(ptr
as usize % mem
::align_of
::<Aligned
>(),
16 impl PartialEq
for Aligned
{
17 fn eq(&self, other
: &Self) -> bool
{
25 #[derive(Copy, Clone, PartialEq)]
26 struct Packed(Aligned
, Aligned
);
30 struct Dealigned
<T
>(u8, T
);
33 let d1
= Dealigned(0, Packed(Aligned(1), Aligned(2)));