We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73bf070 commit 20b55b7Copy full SHA for 20b55b7
src/doc/unstable-book/src/language-features/repr-align-enum.md
@@ -24,3 +24,19 @@ fn main() {
24
assert_eq!(std::mem::align_of::<Aligned>(), 8);
25
}
26
```
27
+
28
+This is equivalent to using an aligned wrapper struct everywhere:
29
30
+```rust
31
+#[repr(align(8))]
32
+struct Aligned(Unaligned);
33
34
+enum Unaligned {
35
+ Foo,
36
+ Bar { value: u32 },
37
+}
38
39
+fn main() {
40
+ assert_eq!(std::mem::align_of::<Aligned>(), 8);
41
42
+```
0 commit comments