Skip to content

Commit

Permalink
Rollup merge of rust-lang#65563 - GuillaumeGomez:long-err-explanation…
Browse files Browse the repository at this point in the history
…-E0587, r=Dylan-DPC

Add long error explanation for E0587

Part of rust-lang#61137.

r? @kinnison
  • Loading branch information
JohnTitor authored Oct 28, 2019
2 parents 7ba2aa8 + 42a805e commit 84cb9af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
20 changes: 19 additions & 1 deletion src/librustc_typeck/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3891,6 +3891,25 @@ details.
[issue #33685]: https://github.com/rust-lang/rust/issues/33685
"##,

E0587: r##"
A type has both `packed` and `align` representation hints.
Erroneous code example:
```compile_fail,E0587
#[repr(packed, align(8))] // error!
struct Umbrella(i32);
```
You cannot use `packed` and `align` hints on a same type. If you want to pack a
type to a given size, you should provide a size to packed:
```
#[repr(packed)] // ok!
struct Umbrella(i32);
```
"##,

E0588: r##"
A type with `packed` representation hint has a field with `align`
representation hint.
Expand Down Expand Up @@ -5097,7 +5116,6 @@ struct B<const X: A>; // ok!
// E0563, // cannot determine a type for this `impl Trait` removed in 6383de15
// E0564, // only named lifetimes are allowed in `impl Trait`,
// but `{}` was found in the type `{}`
E0587, // type has conflicting packed and align representation hints
// E0611, // merged into E0616
// E0612, // merged into E0609
// E0613, // Removed (merged with E0609)
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/conflicting-repr-hints.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ LL | | }

error: aborting due to 8 previous errors

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

0 comments on commit 84cb9af

Please sign in to comment.