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 E0587 #65563

Merged
merged 2 commits into from
Oct 29, 2019
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
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
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`.