Skip to content

Commit 7ef5b89

Browse files
authored
Rollup merge of #68894 - JohnTitor:update-e0565, r=Dylan-DPC
Update E0565 examples Fixes #68892 r? @GuillaumeGomez
2 parents 0e294cf + 64450ac commit 7ef5b89

File tree

1 file changed

+9
-5
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+9
-5
lines changed

src/librustc_error_codes/error_codes/E0565.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ A literal was used in a built-in attribute that doesn't support literals.
22

33
Erroneous code example:
44

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() {}
810
```
911

1012
Literals in attributes are new and largely unsupported in built-in attributes.
1113
Work to support literals where appropriate is ongoing. Try using an unquoted
1214
name instead:
1315

1416
```
15-
#[inline(always)]
16-
pub fn something() {}
17+
#[repr(C)] // ok!
18+
struct Repr {}
19+
20+
fn main() {}
1721
```

0 commit comments

Comments
 (0)