]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0541.md
Merge commit '6f50986667debbfc67776304a8ee23fe0158613f' into libgccjit-codegen
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0541.md
1 An unknown meta item was used.
2
3 Erroneous code example:
4
5 ```compile_fail,E0541
6 #[deprecated(
7     since="1.0.0",
8     // error: unknown meta item
9     reason="Example invalid meta item. Should be 'note'")
10 ]
11 fn deprecated_function() {}
12 ```
13
14 Meta items are the key-value pairs inside of an attribute. The keys provided
15 must be one of the valid keys for the specified attribute.
16
17 To fix the problem, either remove the unknown meta item, or rename it if you
18 provided the wrong name.
19
20 In the erroneous code example above, the wrong name was provided, so changing
21 to a correct one it will fix the error. Example:
22
23 ```
24 #[deprecated(
25     since="1.0.0",
26     note="This is a valid meta item for the deprecated attribute."
27 )]
28 fn deprecated_function() {}
29 ```