Skip to content

Commit 4675c25

Browse files
committed
Update now that cenum_impl_drop_cast is a hard error
cenum_impl_drop_cast has been changed to a hard error in rust-lang/rust#135964
1 parent 2b37679 commit 4675c25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/expressions/operator-expr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ halfway between two floating point numbers.
586586
r[expr.as.enum]
587587
#### Enum cast
588588

589+
r[expr.as.enum.discriminant]
589590
Casts an enum to its discriminant, then uses a numeric cast if needed.
590591
Casting is limited to the following kinds of enumerations:
591592

@@ -599,8 +600,8 @@ assert_eq!(Enum::B as i32, 1);
599600
assert_eq!(Enum::C as i32, 2);
600601
```
601602

602-
> [!WARNING]
603-
> By default [enum casts are not allowed for enums which implement `Drop`][cenum_impl_drop_cast].
603+
r[expr.as.enum.no-drop]
604+
Casting is not allowed if the enum implements [`Drop`].
604605

605606
r[expr.as.bool-char-as-int]
606607
#### Primitive to integer cast
@@ -882,7 +883,6 @@ Like assignment expressions, compound assignment expressions always produce [the
882883
[undefined behavior]: ../behavior-considered-undefined.md
883884
[unit]: ../types/tuple.md
884885
[Unit-only enums]: ../items/enumerations.md#unit-only-enum
885-
[cenum_impl_drop_cast]: https://github.com/rust-lang/rust/issues/73333
886886
[value expression]: ../expressions.md#place-expressions-and-value-expressions
887887
[temporary value]: ../expressions.md#temporaries
888888
[this test]: https://github.com/rust-lang/rust/blob/1.58.0/src/test/ui/expr/compound-assignment/eval-order.rs

0 commit comments

Comments
 (0)