Closed
Description
You can trigger both errors by using #[repr(packed)]
on an enum with no variants.
#[repr(packed)]
enum Void {}
The errors given out are:
Compiling playground v0.0.1 (file:///playground)
error[E0517]: attribute should be applied to struct or union
--> src/main.rs:1:1
|
1 | #[repr(packed)]
| ^^^^^^^^^^^^^^^ requires a struct or union
error[E0084]: unsupported representation for zero-variant enum
--> src/main.rs:2:1
|
2 | enum Void {}
| ^^^^^^^^^^^^ unsupported enum representation
error: aborting due to 2 previous errors
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
E0517 shows the attribute, but does not show the enum. E0084 shows the enum, but does not show the attribute. Both errors should show both.