@@ -93,6 +93,38 @@ For more information about the cfg attribute, read:
9393https://doc.rust-lang.org/reference.html#conditional-compilation
9494"## ,
9595
96+ E0541 : r##"
97+ An unknown meta item was used.
98+
99+ Erroneous code example:
100+
101+ ```compile_fail,E0541
102+ #[deprecated(
103+ since="1.0.0",
104+ // error: unknown meta item
105+ reason="Example invalid meta item. Should be 'note'")
106+ ]
107+ fn deprecated_function() {}
108+ ```
109+
110+ Meta items are the key-value pairs inside of an attribute. The keys provided
111+ must be one of the valid keys for the specified attribute.
112+
113+ To fix the problem, either remove the unknown meta item, or rename it if you
114+ provided the wrong name.
115+
116+ In the erroneous code example above, the wrong name was provided, so changing
117+ to a correct one it will fix the error. Example:
118+
119+ ```
120+ #[deprecated(
121+ since="1.0.0",
122+ note="This is a valid meta item for the deprecated attribute."
123+ )]
124+ fn deprecated_function() {}
125+ ```
126+ "## ,
127+
96128E0552 : r##"
97129A unrecognized representation attribute was used.
98130
@@ -318,7 +350,6 @@ register_diagnostics! {
318350 E0538 , // multiple [same] items
319351 E0539 , // incorrect meta item
320352 E0540 , // multiple rustc_deprecated attributes
321- E0541 , // unknown meta item
322353 E0542 , // missing 'since'
323354 E0543 , // missing 'reason'
324355 E0544 , // multiple stability levels
0 commit comments