Skip to content

Commit d086375

Browse files
committed
Update non_exhaustive for attribute template changes
1 parent 52b46bd commit d086375

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/attributes/type_system.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ r[attributes.type-system]
33

44
The following [attributes] are used for changing how a type can be used.
55

6+
<!-- template:attributes -->
67
r[attributes.type-system.non_exhaustive]
78
## The `non_exhaustive` attribute
89

@@ -39,19 +40,19 @@ The *`non_exhaustive` [attribute][attributes]* indicates that a type or variant
3940
> ```
4041
4142
r[attributes.type-system.non_exhaustive.syntax]
42-
The `non_exhaustive` attribute uses the [MetaWord] syntax and thus does not take any inputs.
43+
The `non_exhaustive` attribute uses the [MetaWord] syntax.
4344
4445
r[attributes.type-system.non_exhaustive.allowed-positions]
4546
The `non_exhaustive` attribute may only be applied to [`struct`s][struct], [`enum`s][enum], and `enum` variants.
4647
4748
> [!NOTE]
48-
> `rustc` currently warns in some other positions, but this may be rejected in the future.
49+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
4950
5051
r[attributes.type-system.non_exhaustive.duplicates]
51-
Duplicate instances of the `non_exhaustive` attribute have no effect.
52+
The `non_exhaustive` attribute may be used any number of times on a form.
5253
5354
> [!NOTE]
54-
> `rustc` warns on subsequent duplicate `non_exhaustive` attributes.
55+
> `rustc` lints against any use following the first.
5556
5657
r[attributes.type-system.non_exhaustive.same-crate]
5758
Within the defining crate, `non_exhaustive` has no effect.

0 commit comments

Comments
 (0)