Clippy · Correctness
C-like enum discriminant overflowing 32-bit targets
clippy::enum_clike_unportable_variant
Give the enum a fixed-width repr such as u64, or keep every discriminant within 32 bits.
- Category
- Correctness
- Default level
- warn
- Tier
- P1
- Producer
- Clippy
- Diff scope
- line
Not a defect when
The crate refuses to build on 32-bit targets (a compile_error! or cfg on target_pointer_width), so the discriminant always fits isize or usize.
What it reads
Clippy, with the compiler behind it. The only pass that compiles.
Tier
Serious: worth interrupting other work for.
The tier bounds how severe a rule may be; its category bounds the tier.Diff scope
The changed line itself.
What--scope contextual looks at to decide whether a change caused the finding.Change it
Turn it off, or make it blocking, without touching the code it flags:
rust-doctor --rule clippy::enum_clike_unportable_variant=off .
rust-doctor --rule clippy::enum_clike_unportable_variant=error .