Skip to content

Commit a333dec

Browse files
committed
Clarify layout of tuples when last field is unsized
1 parent 5b3ca00 commit a333dec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/type-layout.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ r[layout.tuple.unit]
121121
The exception to this is the unit tuple (`()`), which is guaranteed as a
122122
zero-sized type to have a size of 0 and an alignment of 1.
123123

124+
> [!NOTE]
125+
> It is not guaranteed that the last field of a tuple is stored at the end. For example, this means that `(i32, [u8; 10])` and `(i32; [u8])` might *not* have compatible layouts.
126+
124127
r[layout.trait-object]
125128
## Trait Object Layout
126129

0 commit comments

Comments
 (0)