From 7df62756a17fe5605ab437fd27ba8b69bb885e59 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 16 Aug 2022 07:01:41 +0900 Subject: [PATCH] Apply a suggestion Co-authored-by: Eric Huss --- src/other-reprs.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/other-reprs.md b/src/other-reprs.md index c17f0ac..228b22b 100644 --- a/src/other-reprs.md +++ b/src/other-reprs.md @@ -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,