Skip to content

Commit 842326a

Browse files
authored
Merge pull request #2162 from rust-lang/TC/non_exhaustive-same-crate
Remove exception WRT same-crate `non_exhaustive` reads
2 parents c6be577 + d2faa48 commit 842326a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/types/closure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ c();
334334
```
335335

336336
r[type.closure.capture.precision.discriminants.non_exhaustive]
337-
If [`#[non_exhaustive]`][attributes.type-system.non_exhaustive] is applied to an enum defined in an external crate, the enum is treated as having multiple variants for the purpose of deciding whether a read occurs, even if it actually has only one variant.
337+
If [`#[non_exhaustive]`][attributes.type-system.non_exhaustive] is applied to an enum, the enum is treated as having multiple variants for the purpose of deciding whether a read occurs, even if it actually has only one variant.
338338

339339
r[type.closure.capture.precision.discriminants.uninhabited-variants]
340340
Even if all variants but the one being matched against are uninhabited, making the pattern [irrefutable][patterns.refutable], the discriminant is still read if it otherwise would be.

0 commit comments

Comments
 (0)