File tree 1 file changed +7
-4
lines changed
reference/src/representation
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,13 @@ alignment 1).
100
100
101
101
### Layout of a fieldless enum
102
102
103
- If there is no ` #[repr] ` attached to a fieldless enum, it is
104
- guaranteed to be represented as an integer of sufficient size to store
105
- the discriminants for all possible variants. The size is selected by
106
- the compiler but must be at least a ` u8 ` .
103
+ If there is no ` #[repr] ` attached to a fieldless enum, the compiler
104
+ will represent it using an integer of sufficient size to store the
105
+ discriminants for all possible variants -- note that if there is only
106
+ one variant, then 0 bits are required, so it is possible that the enum
107
+ may have zero size. In the absence of a ` #[repr] ` annotation, the
108
+ number of bits used by the compiler are not defined and are subject to
109
+ change.
107
110
108
111
When a ` #[repr(Int)] ` -style annotation is attached to a fieldless enum
109
112
(one without any data for its variants), it will cause the enum to be
You can’t perform that action at this time.
0 commit comments