Skip to content

Commit b509ff2

Browse files
committed
Update E0517 message to reflect RFC 2195.
1 parent 8d00669 commit b509ff2

File tree

1 file changed

+6
-6
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+6
-6
lines changed

compiler/rustc_error_codes/src/error_codes/E0517.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ impl Foo {
2525
These attributes do not work on typedefs, since typedefs are just aliases.
2626

2727
Representations like `#[repr(u8)]`, `#[repr(i64)]` are for selecting the
28-
discriminant size for enums with no data fields on any of the variants, e.g.
29-
`enum Color {Red, Blue, Green}`, effectively setting the size of the enum to
30-
the size of the provided type. Such an enum can be cast to a value of the same
31-
type as well. In short, `#[repr(u8)]` makes the enum behave like an integer
32-
with a constrained set of allowed values.
28+
discriminant size for enums. For enums with no data fields on any of the
29+
variants, e.g. `enum Color {Red, Blue, Green}`, this effectively sets the size
30+
of the enum to the size of the provided type. Such an enum can be cast to a
31+
value of the same type as well. In short, `#[repr(u8)]` makes a field-less enum
32+
behave like an integer with a constrained set of allowed values.
3333

34-
Only field-less enums can be cast to numerical primitives, so this attribute
34+
Only field-less enums can be cast to numerical primitives. This attribute
3535
will not apply to structs.
3636

3737
`#[repr(packed)]` reduces padding to make the struct size smaller. The

0 commit comments

Comments
 (0)