Skip to content

Commit

Permalink
Rollup merge of #68894 - JohnTitor:update-e0565, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Update E0565 examples

Fixes #68892

r? @GuillaumeGomez
  • Loading branch information
Dylan-DPC authored Feb 6, 2020
2 parents 0e294cf + 64450ac commit 7ef5b89
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/librustc_error_codes/error_codes/E0565.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ A literal was used in a built-in attribute that doesn't support literals.

Erroneous code example:

```ignore (compile_fail not working here; see Issue #43707)
#[inline("always")] // error: unsupported literal
pub fn something() {}
```compile_fail,E0565
#[repr("C")] // error: meta item in `repr` must be an identifier
struct Repr {}
fn main() {}
```

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

```
#[inline(always)]
pub fn something() {}
#[repr(C)] // ok!
struct Repr {}
fn main() {}
```

0 comments on commit 7ef5b89

Please sign in to comment.