Skip to content

Commit

Permalink
Add long error explanation for E0587
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 23, 2019
1 parent f466f52 commit 76b8fd8
Showing 1 changed file with 19 additions and 1 deletion.
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 @@ -5073,7 +5092,6 @@ the future, [RFC 2091] prohibits their implementation without a follow-up RFC.
// 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

0 comments on commit 76b8fd8

Please sign in to comment.