Skip to content

Commit

Permalink
Add long error explanation for E0693 #61137
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush Kumar Mishra committed Mar 14, 2020
1 parent 3dbade6 commit 1c88052
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ E0689: include_str!("./error_codes/E0689.md"),
E0690: include_str!("./error_codes/E0690.md"),
E0691: include_str!("./error_codes/E0691.md"),
E0692: include_str!("./error_codes/E0692.md"),
E0693: include_str!("./error_codes/E0693.md"),
E0695: include_str!("./error_codes/E0695.md"),
E0697: include_str!("./error_codes/E0697.md"),
E0698: include_str!("./error_codes/E0698.md"),
Expand Down Expand Up @@ -594,7 +595,6 @@ E0748: include_str!("./error_codes/E0748.md"),
E0667, // `impl Trait` in projections
E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax
E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
E0693, // incorrect `repr(align)` attribute format
// E0694, // an unknown tool name found in scoped attributes
E0696, // `continue` pointing to a labeled block
// E0702, // replaced with a generic attribute input check
Expand Down
19 changes: 19 additions & 0 deletions src/librustc_error_codes/error_codes/E0693.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
`align` representation hint was incorrectly declared.

Erroneous code examples:

```compile_fail,E0693
#[repr(align=8)] // error!
struct Align8(i8);
#[repr(align="8")] // error!
struct Align8(i8);
```

This is a syntax error at the level of attribute declarations. The proper
syntax for `align` representation hint is the following:

```
#[repr(align(8))] // ok!
struct Align8(i8);
```
1 change: 1 addition & 0 deletions src/test/ui/repr/repr-align-assign.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ LL | #[repr(align="8")]

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0693`.

0 comments on commit 1c88052

Please sign in to comment.