add alignment specific packed repr tests

This commit is contained in:
Tanner Rogalsky 2020-05-19 16:01:41 -04:00 committed by David Tolnay
parent 1cd10a7d09
commit 7e5701ad2b

View File

@ -1893,4 +1893,16 @@ fn test_packed_struct_can_derive_serialize() {
struct CPacked {
t: f32,
}
#[derive(Copy, Clone, Serialize)]
#[repr(C, packed(2))]
struct CPacked2 {
t: f32,
}
#[derive(Copy, Clone, Serialize)]
#[repr(packed(2), C)]
struct Packed2C {
t: f32,
}
}