mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-02 15:25:38 +00:00
Add tests validating Serialize derivation for packed structs.
This commit is contained in:
parent
8ff11dc234
commit
d5e6436b28
@ -1878,3 +1878,19 @@ fn test_internally_tagged_newtype_variant_containing_unit_struct() {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[deny(safe_packed_borrows)]
|
||||||
|
#[test]
|
||||||
|
fn test_packed_struct_can_derive_serialize() {
|
||||||
|
#[derive(Copy, Clone, Serialize)]
|
||||||
|
#[repr(packed, C)]
|
||||||
|
struct PackedC {
|
||||||
|
t: f32,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Serialize)]
|
||||||
|
#[repr(C, packed)]
|
||||||
|
struct CPacked {
|
||||||
|
t: f32,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user