Rollup merge of #68894 - JohnTitor:update-e0565, r=Dylan-DPC

Update E0565 examples

Fixes #68892

r? @GuillaumeGomez
This commit is contained in:
Dylan DPC 2020-02-06 22:38:39 +01:00 committed by GitHub
commit 7ef5b8951f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -2,9 +2,11 @@ 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.
@ -12,6 +14,8 @@ 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() {}
```