Skip to content

Commit 838884e

Browse files
authored
Rollup merge of #69993 - ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC
Add long error explanation for E0693 Add long explanation for the E0693 error code Part of #61137 r? @GuillaumeGomez
2 parents 191a796 + 1c88052 commit 838884e

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/librustc_error_codes/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ E0689: include_str!("./error_codes/E0689.md"),
380380
E0690: include_str!("./error_codes/E0690.md"),
381381
E0691: include_str!("./error_codes/E0691.md"),
382382
E0692: include_str!("./error_codes/E0692.md"),
383+
E0693: include_str!("./error_codes/E0693.md"),
383384
E0695: include_str!("./error_codes/E0695.md"),
384385
E0697: include_str!("./error_codes/E0697.md"),
385386
E0698: include_str!("./error_codes/E0698.md"),
@@ -595,7 +596,6 @@ E0748: include_str!("./error_codes/E0748.md"),
595596
E0667, // `impl Trait` in projections
596597
E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax
597598
E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
598-
E0693, // incorrect `repr(align)` attribute format
599599
// E0694, // an unknown tool name found in scoped attributes
600600
E0696, // `continue` pointing to a labeled block
601601
// E0702, // replaced with a generic attribute input check
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
`align` representation hint was incorrectly declared.
2+
3+
Erroneous code examples:
4+
5+
```compile_fail,E0693
6+
#[repr(align=8)] // error!
7+
struct Align8(i8);
8+
9+
#[repr(align="8")] // error!
10+
struct Align8(i8);
11+
```
12+
13+
This is a syntax error at the level of attribute declarations. The proper
14+
syntax for `align` representation hint is the following:
15+
16+
```
17+
#[repr(align(8))] // ok!
18+
struct Align8(i8);
19+
```

src/test/ui/repr/repr-align-assign.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ LL | #[repr(align="8")]
2424

2525
error: aborting due to 4 previous errors
2626

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

0 commit comments

Comments
 (0)