]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0565.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / 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 ```