File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,20 @@ A literal was used in a built-in attribute that doesn't support literals.
2
2
3
3
Erroneous code example:
4
4
5
- ``` ignore (compile_fail not working here; see Issue #43707)
6
- #[inline("always")] // error: unsupported literal
7
- pub fn something() {}
5
+ ``` compile_fail,E0565
6
+ #[repr("C")] // error: meta item in `repr` must be an identifier
7
+ struct Repr {}
8
+
9
+ fn main() {}
8
10
```
9
11
10
12
Literals in attributes are new and largely unsupported in built-in attributes.
11
13
Work to support literals where appropriate is ongoing. Try using an unquoted
12
14
name instead:
13
15
14
16
```
15
- #[inline(always)]
16
- pub fn something() {}
17
+ #[repr(C)] // ok!
18
+ struct Repr {}
19
+
20
+ fn main() {}
17
21
```
You can’t perform that action at this time.
0 commit comments