X0016 clippy-restriction¶
Rule: No finding of the restriction clippy lints the project turned on.
| Code | X0016 (stable, never reused) |
| Id | clippy-restriction |
| 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 restriction group holds lints that forbid things which are fine in general but not in this project (unwrap_used, print_stdout). It is off by default: only the lints of it the project turns on in its [lints.clippy] table report, and spirit_level never turns them on itself, so an allow the project wrote always holds. This lint gives those findings a spirit_level level.
How to fix¶
Follow the help of the finding; cargo clippy --explain NAME explains the lint. A place where the lint is wrong gets #[expect(clippy::NAME, reason = "...")].
Configure¶
Allow one finding in the code with // spirit-level: allow(clippy-restriction) <reason> (waivers); the code works there too, as in [lints.X0016].