Open
Description
Code
#[repr(isize)]
enum Uninhabited {}
Current output
error[E0084]: unsupported representation for zero-variant enum
--> src/lib.rs:1:1
|
1 | #[repr(isize)]
| ^^^^^^^^^^^^^^
2 | enum Uninhabited {}
| ---------------- zero-variant enum
Desired output
error[E0084]: zero-variant enums do not support `#[repr]`
--> src/lib.rs:1:1
|
1 | #[repr(isize)]
| ^^^^^^^^^^^^^^
2 | enum Uninhabited {}
| ---------------- zero-variant enum
Rationale and extra context
The current output leaves the user questioning whether there may be some valid repr while not being told which ones are valid options. The diagnostic should probably be more clear about the fact that the attribute is generally not supported on zero-variant enums
Other cases
Rust Version
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-pc-windows-msvc
release: 1.86.0
LLVM version: 19.1.7
Anything else?
No response