Skip to content

Commit 61c01f6

Browse files
authored
Merge pull request #4 from thomaseizinger/feat/implement-partial-ord
feat: implement `PartialOrd` & `Ord` for alignments
2 parents 40c863a + d7a60dd commit 61c01f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/alignment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/// Zero-sized type (ZST) to enforce 8-byte memory alignment
22
#[repr(align(8))]
3-
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
3+
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
44
pub struct Align8;
55

66
/// Zero-sized type (ZST) to enforce 16-byte memory alignment
77
#[repr(align(16))]
8-
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
8+
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
99
pub struct Align16;
1010

1111
/// Zero-sized type (ZST) to enforce 32-byte memory alignment
1212
#[repr(align(32))]
13-
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
13+
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
1414
pub struct Align32;
1515

1616
/// Zero-sized type (ZST) to enforce 64-byte memory alignment
1717
#[repr(align(64))]
18-
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
18+
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
1919
pub struct Align64;
2020

2121
/// Zero-sized type (ZST) to enforce 128-byte memory alignment
2222
#[repr(align(128))]
23-
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
23+
#[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Debug)]
2424
pub struct Align128;

0 commit comments

Comments
 (0)