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:
11211121
11221122Making items [ ` #[non_exhaustive] ` ] [ non_exhaustive ] changes how they may
11231123be used outside the crate where they are defined:
1124+
11241125- Non-exhaustive structs and enum variants cannot be constructed
11251126 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.
11281130
11291131Structs with private fields cannot be constructed using [ struct literal] syntax
11301132regardless of whether [ ` #[non_exhaustive] ` ] [ non_exhaustive ] is used.
You can’t perform that action at this time.
0 commit comments