We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 75d2d5d + a28f858 commit 01a12f2Copy full SHA for 01a12f2
src/type-layout.md
@@ -524,6 +524,10 @@ assert_eq!(std::mem::size_of::<Enum16>(), 4);
524
The `align` and `packed` modifiers can be used to respectively raise or lower
525
the alignment of `struct`s and `union`s. `packed` may also alter the padding
526
between fields (although it will not alter the padding inside of any field).
527
+On their own, `align` and `packed` do not provide guarantees about the order
528
+of fields in the layout of a struct or the layout of an enum variant, although
529
+they may be combined with representations (such as `C`) which do provide such
530
+guarantees.
531
532
The alignment is specified as an integer parameter in the form of
533
`#[repr(align(x))]` or `#[repr(packed(x))]`. The alignment value must be a
0 commit comments