Skip to content

Commit 3c5c1c2

Browse files
authored
Merge pull request #2264 from DanielEScherzer/repr-c-no-fields
Guarantee alignment of `repr(C)` structs with no fields
2 parents 78bbc5b + 264aec4 commit 3c5c1c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/type-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ r[layout.repr.c.struct]
198198
#### `#[repr(C)]` Structs
199199

200200
r[layout.repr.c.struct.align]
201-
The alignment of the struct is the alignment of the most-aligned field in it.
201+
The alignment of the struct is the alignment of the most-aligned field in it, or one if there are no fields.
202202

203203
r[layout.repr.c.struct.size-field-offset]
204204
The size and offset of fields is determined by the following algorithm.

0 commit comments

Comments
 (0)