Skip to content

Commit f37eb61

Browse files
committed
Add missing inhabited rule name, and clarify
This adds a rule name that was missing for this statement. It also clarifies why this is being said.
1 parent af2345e commit f37eb61

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/attributes/type_system.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ It's also not allowed to use numeric casts (`as`) on enums that contain any non-
204204
> let _ = EnumWithNonExhaustiveVariants::First as u8;
205205
> ```
206206
207-
Non-exhaustive types are always considered inhabited in downstream crates.
207+
r[attributes.type-system.non_exhaustive.inhabited]
208+
Non-exhaustive types are always considered [inhabited] in downstream crates, even though the constructors are not accessible.
208209
209210
[`match`]: ../expressions/match-expr.md
210211
[attributes]: ../attributes.md
211212
[enum]: ../items/enumerations.md
212213
[functional update syntax]: ../expressions/struct-expr.md#functional-update-syntax
213214
[struct]: ../items/structs.md
214215
[visibility]: ../visibility-and-privacy.md
216+
[inhabited]: ../glossary.md#inhabited

0 commit comments

Comments
 (0)