File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ r[attributes.type-system]
3
3
4
4
The following [ attributes] are used for changing how a type can be used.
5
5
6
+ <!-- template:attributes -->
6
7
r[ attributes.type-system.non_exhaustive]
7
8
## The ` non_exhaustive ` attribute
8
9
@@ -39,19 +40,19 @@ The *`non_exhaustive` [attribute][attributes]* indicates that a type or variant
39
40
> ```
40
41
41
42
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 .
43
44
44
45
r [attributes . type - system . non_exhaustive. allowed- positions ]
45
46
The `non_exhaustive ` attribute may only be applied to [`struct `s ][struct ], [`enum `s ][enum ], and `enum ` variants .
46
47
47
48
> [! 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.
49
50
50
51
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 .
52
53
53
54
> [! NOTE ]
54
- > `rustc ` warns on subsequent duplicate ` non_exhaustive ` attributes .
55
+ > `rustc` lints against any use following the first .
55
56
56
57
r[attributes. type - system. non_exhaustive. same- crate ]
57
58
Within the defining crate , `non_exhaustive` has no effect.
You can’t perform that action at this time.
0 commit comments