Skip to content

Commit 9687cad

Browse files
roypatbonzini
authored andcommitted
fix: mark endian types as repr(transparent)
Without this, the impl of `ByteValued` was technically undefined, although we had some const asserts that ensured rustc didn't muck us over by adding padding or anything. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent deb8871 commit 9687cad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/endian.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ macro_rules! endian_type {
4949
///
5050
/// See module level documentation for examples.
5151
#[derive(Copy, Clone, Eq, PartialEq, Debug, Default)]
52+
#[repr(transparent)]
5253
pub struct $new_type($old_type);
5354

5455
impl $new_type {

0 commit comments

Comments
 (0)