Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add long error explanation for E0693 #69993

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.