You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/glossary.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,7 @@ A type is zero sized (a ZST) if its size is 0. Such types have at most one possi
223
223
-`repr(Rust)`[structs] with no fields or where all fields are zero-sized (see [layout.repr.rust.struct-zst]).
224
224
-`repr(C)`[structs] with no fields or where all fields are zero-sized (see [layout.repr.c.struct.size-field-offset]).
225
225
-`repr(transparent)`[structs] with no fields or where all fields are zero-sized (see [layout.repr.transparent.layout-abi]).
226
+
-`repr(Rust)`[enums] (without a primitive representation specified) with a single struct-like variant with no fields or where all fields are zero-sized (see [layout.repr.rust.enum-struct-like-zst])
226
227
-[Arrays] of zero-sized types (see [layout.array]).
227
228
-[Arrays] of length zero (see [layout.array]).
228
229
-[Unions] of zero-sized types (see [items.union.common-storage]).
Copy file name to clipboardExpand all lines: src/type-layout.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,6 +183,9 @@ Be aware that this guarantee does not imply that the fields have distinct addres
183
183
r[layout.repr.rust.struct-zst]
184
184
For [structs] with no fields, or where all fields are [zero-sized], it is further guaranteed that the structs are themselves [zero-sized].
185
185
186
+
r[layout.repr.rust.enum-struct-like-zst]
187
+
For [enums] (without a primitive representation specified) with a single struct-like variant with no fields or where all fields are [zero-sized], the enum itself is [zero-sized].
188
+
186
189
r[layout.repr.rust.unspecified]
187
190
There are no other guarantees of data layout made by this representation.
188
191
@@ -559,6 +562,7 @@ Because this representation delegates type layout to another type, it cannot be
0 commit comments