]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0565.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0565.md
1 A literal was used in a built-in attribute that doesn't support literals.
2
3 Erroneous code example:
4
5 ```compile_fail,E0565
6 #[repr("C")] // error: meta item in `repr` must be an identifier
7 struct Repr {}
8
9 fn main() {}
10 ```
11
12 Literals in attributes are new and largely unsupported in built-in attributes.
13 Work to support literals where appropriate is ongoing. Try using an unquoted
14 name instead:
15
16 ```
17 #[repr(C)] // ok!
18 struct Repr {}
19
20 fn main() {}
21 ```