@@ -368,7 +368,7 @@ reference types and `mut` or `const` in pointer types.
368368| Type of ` e ` | ` U ` | Cast performed by ` e as U ` |
369369| -----------------------| -----------------------| ----------------------------------|
370370| Integer or Float type | Integer or Float type | Numeric cast |
371- | [ Unit-only enum ] | Integer type | Enum cast |
371+ | Enumeration | Integer type | Enum cast |
372372| ` bool ` or ` char ` | Integer type | Primitive to integer cast |
373373| ` u8 ` | ` char ` | ` u8 ` to ` char ` cast |
374374| ` *T ` | ` *V ` where ` V: Sized ` \* | Pointer to pointer cast |
@@ -430,6 +430,10 @@ halfway between two floating point numbers.
430430#### Enum cast
431431
432432Casts an enum to its discriminant, then uses a numeric cast if needed.
433+ Casting is limited to the following kinds of enumerations:
434+
435+ * [ Unit-only enums]
436+ * [ Field-less enums] without [ explicit discriminants] , or where only unit-variants have explicit discriminants
433437
434438#### Primitive to integer cast
435439
@@ -632,6 +636,8 @@ See [this test] for an example of using this dependency.
632636
633637[ copies or moves ] : ../expressions.md#moved-and-copied-types
634638[ dropping ] : ../destructors.md
639+ [ explicit discriminants ] : ../items/enumerations.md#explicit-discriminants
640+ [ field-less enums ] : ../items/enumerations.md#field-less-enum
635641[ grouped expression ] : grouped-expr.md
636642[ literal expression ] : literal-expr.md#integer-literal-expressions
637643[ logical and ] : ../types/boolean.md#logical-and
@@ -643,7 +649,7 @@ See [this test] for an example of using this dependency.
643649[ assignee expression ] : ../expressions.md#place-expressions-and-value-expressions
644650[ undefined behavior ] : ../behavior-considered-undefined.md
645651[ unit ] : ../types/tuple.md
646- [ Unit-only enum ] : ../items/enumerations.md#unit-only-enum
652+ [ Unit-only enums ] : ../items/enumerations.md#unit-only-enum
647653[ value expression ] : ../expressions.md#place-expressions-and-value-expressions
648654[ temporary value ] : ../expressions.md#temporaries
649655[ this test ] : https://github.com/rust-lang/rust/blob/1.58.0/src/test/ui/expr/compound-assignment/eval-order.rs
0 commit comments