From 76b8fd81e299498266923f1470c216f553b2927b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 18 Oct 2019 19:00:09 +0200 Subject: [PATCH 1/2] Add long error explanation for E0587 --- src/librustc_typeck/error_codes.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/error_codes.rs b/src/librustc_typeck/error_codes.rs index 3d41c6e09c6bc..6405b77c1054b 100644 --- a/src/librustc_typeck/error_codes.rs +++ b/src/librustc_typeck/error_codes.rs @@ -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. @@ -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) From 42a805e4d2b057f58f5ad72b35afaee1bf8358ef Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 18 Oct 2019 19:00:35 +0200 Subject: [PATCH 2/2] Update ui tests --- src/test/ui/conflicting-repr-hints.stderr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/ui/conflicting-repr-hints.stderr b/src/test/ui/conflicting-repr-hints.stderr index 832f5c3ac2bb7..414c15f93bc18 100644 --- a/src/test/ui/conflicting-repr-hints.stderr +++ b/src/test/ui/conflicting-repr-hints.stderr @@ -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`.