File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1121,10 +1121,12 @@ Mitigation strategies:
1121
1121
1122
1122
Making items [ ` #[non_exhaustive] ` ] [ non_exhaustive ] changes how they may
1123
1123
be used outside the crate where they are defined:
1124
+
1124
1125
- Non-exhaustive structs and enum variants cannot be constructed
1125
1126
using [ struct literal] syntax, including [ functional update syntax] .
1126
- - Pattern matching on non-exhaustive enums always requires
1127
- a wildcard (` _ ` ) arm.
1127
+ - Pattern matching on non-exhaustive structs requires ` .. ` and
1128
+ matching on enums does not count towards exhaustiveness.
1129
+ - Casting enum variants to their discriminant with ` as ` is not allowed.
1128
1130
1129
1131
Structs with private fields cannot be constructed using [ struct literal] syntax
1130
1132
regardless of whether [ ` #[non_exhaustive] ` ] [ non_exhaustive ] is used.
You can’t perform that action at this time.
0 commit comments