Skip to content

Commit 45a2381

Browse files
committed
Revise ...discriminants.non_exhaustive rule
Let's clarify some wording in this rule, making it a bit more self-standing, and inline the link target as, when using the rule identifier for this, it's not meaningfully longer than doing it the other way.
1 parent ba8d793 commit 45a2381

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/types/closure.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,7 @@ c();
338338
```
339339

340340
r[type.closure.capture.precision.discriminants.non_exhaustive]
341-
If [the `#[non_exhaustive]` attribute][non_exhaustive] is applied to an enum defined in an external crate, it is considered to have multiple variants, even if only one variant is actually present.
342-
343-
[non_exhaustive]: attributes.type-system.non_exhaustive
341+
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.
344342

345343
r[type.closure.capture.precision.discriminants.uninhabited-variant]
346344
Even if all other variants are uninhabited, the discriminant read still occurs.

0 commit comments

Comments
 (0)