Skip to content

Commit 350536c

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 350536c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/expressions/operator-expr.md

+3-2
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

0 commit comments

Comments
 (0)