Skip to content

Commit 5ee8ee1

Browse files
authored
Merge pull request #1713 from ickk/doc-cenum_impl_drop_cast
doc `cenum_impl_drop_cast`
2 parents 4249fb4 + 4675c25 commit 5ee8ee1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/expressions/operator-expr.md

+4
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,6 +600,9 @@ assert_eq!(Enum::B as i32, 1);
599600
assert_eq!(Enum::C as i32, 2);
600601
```
601602

603+
r[expr.as.enum.no-drop]
604+
Casting is not allowed if the enum implements [`Drop`].
605+
602606
r[expr.as.bool-char-as-int]
603607
#### Primitive to integer cast
604608

0 commit comments

Comments
 (0)