Skip to content

Commit

Permalink
Apply a suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Huss <eric@huss.org>
  • Loading branch information
JohnTitor and ehuss committed Aug 15, 2022
1 parent 341005b commit 7df6275
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/other-reprs.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ compiled as normal.)

## repr(transparent)

This can only be used on structs with a single non-zero-sized field
or enums with only one non-zero-sized field (there may be additional zero-sized fields).
`#[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).
The effect is that the layout and ABI of the whole struct/enum is guaranteed to be the same as that one field.

> NOTE: There's a `transparent_unions` nightly feature to apply `repr(transparent)` to unions,
Expand Down

0 comments on commit 7df6275

Please sign in to comment.