Skip to content

Commit a0628ef

Browse files
authored
Update diagnostics.rs
1 parent 8c90046 commit a0628ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,13 +1641,13 @@ impl Foo {
16411641
These attributes do not work on typedefs, since typedefs are just aliases.
16421642
16431643
Representations like `#[repr(u8)]`, `#[repr(i64)]` are for selecting the
1644-
discriminant size for C-like enums (when there is no associated data, e.g.
1644+
discriminant size for enums with no data fields on any of the variants, e.g.
16451645
`enum Color {Red, Blue, Green}`), effectively setting the size of the enum to
16461646
the size of the provided type. Such an enum can be cast to a value of the same
16471647
type as well. In short, `#[repr(u8)]` makes the enum behave like an integer
16481648
with a constrained set of allowed values.
16491649
1650-
Only C-like enums can be cast to numerical primitives, so this attribute will
1650+
Only field-less enums can be cast to numerical primitives, so this attribute will
16511651
not apply to structs.
16521652
16531653
`#[repr(packed)]` reduces padding to make the struct size smaller. The

0 commit comments

Comments
 (0)