File tree 1 file changed +30
-1
lines changed
1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,36 @@ For more information about the cfg attribute, read:
93
93
https://doc.rust-lang.org/reference.html#conditional-compilation
94
94
"## ,
95
95
96
+ E0538 : r##"
97
+ Attribute contains multiple of the same meta item.
98
+
99
+ Erroneous code example:
100
+
101
+ ```compile_fail,E0538
102
+ #[deprecated(
103
+ since="1.0.0",
104
+ note="First deprecation note.",
105
+ note="Second deprecation note." // error: multiple same meta item
106
+ )]
107
+ fn deprecated_function() {}
108
+ ```
109
+
110
+ Meta items are the key-value pairs inside of an attribute. Each key may only be
111
+ used once in each attribute.
112
+
113
+ To fix the problem, remove all but one of the meta items with the same key.
114
+
115
+ Example:
116
+
117
+ ```
118
+ #[deprecated(
119
+ since="1.0.0",
120
+ note="First deprecation note."
121
+ )]
122
+ fn deprecated_function() {}
123
+ ```
124
+ "## ,
125
+
96
126
E0541 : r##"
97
127
An unknown meta item was used.
98
128
@@ -347,7 +377,6 @@ and likely to change in the future.
347
377
}
348
378
349
379
register_diagnostics ! {
350
- E0538 , // multiple [same] items
351
380
E0539 , // incorrect meta item
352
381
E0540 , // multiple rustc_deprecated attributes
353
382
E0542 , // missing 'since'
You can’t perform that action at this time.
0 commit comments