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/other-reprs.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -56,8 +56,7 @@ compiled as normal.)
56
56
57
57
## repr(transparent)
58
58
59
-
This can only be used on structs with a single non-zero-sized field
60
-
or enums with only one non-zero-sized field (there may be additional zero-sized fields).
59
+
`#[repr(transparent)]` can only be used on a struct or single-variant enum that has a single non-zero-sized field (there may be additional zero-sized fields).
61
60
The effect is that the layout and ABI of the whole struct/enum is guaranteed to be the same as that one field.
62
61
63
62
> NOTE: There's a `transparent_unions` nightly feature to apply `repr(transparent)` to unions,
0 commit comments