File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 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:
9393https://doc.rust-lang.org/reference.html#conditional-compilation
9494"## ,
9595
96+ E0538 : r##"
97+ Attribute contains same meta item more than once.
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+
96126E0541 : r##"
97127An unknown meta item was used.
98128
@@ -347,7 +377,6 @@ and likely to change in the future.
347377}
348378
349379register_diagnostics ! {
350- E0538 , // multiple [same] items
351380 E0539 , // incorrect meta item
352381 E0540 , // multiple rustc_deprecated attributes
353382 E0542 , // missing 'since'
You can’t perform that action at this time.
0 commit comments