X0012 clippy-correctness¶
Rule: No finding of clippy's correctness group: code that is outright wrong.
| Code | X0012 (stable, never reused) |
| Id | clippy-correctness |
| Category | clippy |
| Source | clippy (run as an executable) |
| Fix | by hand |
| Needs | clippy installed |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | off | |
| big | off | |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
Clippy's correctness group finds code that is outright wrong or useless; clippy denies these by default. It is on by default, so these findings appear without any setup; the project's [lints.clippy] table can change the level of single lints.
How to fix¶
Follow the help of the finding; the finding names the clippy lint, and cargo clippy --explain NAME explains it. A place where the lint is wrong gets #[expect(clippy::NAME, reason = "...")], or a spirit_level waiver of clippy-correctness.
Configure¶
Allow one finding in the code with // spirit-level: allow(clippy-correctness) <reason> (waivers); the code works there too, as in [lints.X0012].