Skip to content

Commit 9296d77

Browse files
authored
Rollup merge of #69998 - ayushmishra2005:doc/61137-add-long-error-code-e0634, r=Dylan-DPC,GuillaumeGomez
Add long error explanation for E0634 Add long explanation for the E0634 error code Part of #61137 r? @GuillaumeGomez
2 parents 56c60f2 + 2974685 commit 9296d77

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/librustc_error_codes/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ E0626: include_str!("./error_codes/E0626.md"),
351351
E0627: include_str!("./error_codes/E0627.md"),
352352
E0631: include_str!("./error_codes/E0631.md"),
353353
E0633: include_str!("./error_codes/E0633.md"),
354+
E0634: include_str!("./error_codes/E0634.md"),
354355
E0635: include_str!("./error_codes/E0635.md"),
355356
E0636: include_str!("./error_codes/E0636.md"),
356357
E0637: include_str!("./error_codes/E0637.md"),
@@ -589,7 +590,6 @@ E0748: include_str!("./error_codes/E0748.md"),
589590
E0630,
590591
E0632, // cannot provide explicit generic arguments when `impl Trait` is
591592
// used in argument position
592-
E0634, // type has conflicting packed representaton hints
593593
E0640, // infer outlives requirements
594594
// E0645, // trait aliases not finished
595595
E0657, // `impl Trait` can only capture lifetimes bound at the fn level
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
A type has conflicting `packed` representation hints.
2+
3+
Erroneous code examples:
4+
5+
```compile_fail,E0634
6+
#[repr(packed, packed(2))] // error!
7+
struct Company(i32);
8+
9+
#[repr(packed(2))] // error!
10+
#[repr(packed)]
11+
struct Company(i32);
12+
```
13+
14+
You cannot use conflicting `packed` hints on a same type. If you want to pack a
15+
type to a given size, you should provide a size to packed:
16+
17+
```
18+
#[repr(packed)] // ok!
19+
struct Company(i32);
20+
```

src/test/ui/conflicting-repr-hints.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ LL | | }
7676

7777
error: aborting due to 10 previous errors
7878

79-
Some errors have detailed explanations: E0566, E0587.
79+
Some errors have detailed explanations: E0566, E0587, E0634.
8080
For more information about an error, try `rustc --explain E0566`.

0 commit comments

Comments
 (0)