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]
33
44The following [ attributes] are used for changing how a type can be used.
55
6+ <!-- template:attributes -->
67r[ 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
4142r [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
4445r [attributes . type - system . non_exhaustive. allowed- positions ]
4546The `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
5051r[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
5657r[attributes. type - system. non_exhaustive. same- crate ]
5758Within the defining crate , `non_exhaustive` has no effect.
You can’t perform that action at this time.
0 commit comments