]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | A literal was used in a built-in attribute that doesn't support literals. |
2 | ||
3 | Erroneous code example: | |
4 | ||
74b04a01 XL |
5 | ```compile_fail,E0565 |
6 | #[repr("C")] // error: meta item in `repr` must be an identifier | |
7 | struct Repr {} | |
8 | ||
9 | fn main() {} | |
60c5eb7d XL |
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 | ``` | |
74b04a01 XL |
17 | #[repr(C)] // ok! |
18 | struct Repr {} | |
19 | ||
20 | fn main() {} | |
60c5eb7d | 21 | ``` |