Skip to content

Commit f9ec1d2

Browse files
committed
Be less struct-centric
1 parent 377c524 commit f9ec1d2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/type-layout.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,17 @@ Informally, this representation is also called the `rust` representation.
166166
The only data layout guarantees made by this representation are those required
167167
for soundness. They are:
168168

169-
1. The fields of the struct are properly aligned.
169+
1. The fields are properly aligned.
170170
2. The fields do not overlap.
171-
3. The minimum alignment of the struct is at least the maximum alignment of its
171+
3. The minimum alignment of the type is at least the maximum alignment of its
172172
fields.
173173

174-
Formally, the first guarantee means that the offset of any field in the struct
175-
is divisible by that field's alignment. The second guarantee means that the
176-
fields can be ordered such that the offset plus the size of any field is less
177-
than or equal to the offset of the next field in the ordering. The ordering does
178-
not have to be the same as the order in which the fields are specified in the
179-
declaration of the struct.
174+
Formally, the first guarantee means that the offset of any field is divisible by
175+
that field's alignment. The second guarantee means that the fields can be
176+
ordered such that the offset plus the size of any field is less than or equal to
177+
the offset of the next field in the ordering. The ordering does not have to be
178+
the same as the order in which the fields are specified in the declaration of
179+
the type.
180180

181181
Be aware that the second guarantee does not imply that the fields have distinct
182182
addresses: zero-sized types may have the same address as other fields in the

0 commit comments

Comments
 (0)