M0013 rust-version-set¶
Rule: Every crate declares its minimum Rust version.
| Code | M0013 (stable, never reused) |
| Id | rust-version-set |
| Category | manifest |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | warn |
the MSRV is declared so it can be checked |
| big | deny |
the MSRV is declared so it can be checked |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
The minimum supported Rust version is a promise only when it is written down: rust-version lets cargo refuse an older compiler with a clear message, and lets a lint or CI job check the code really builds on it.
How to fix¶
Add rust-version = "1.88" (the oldest compiler the code is checked with), or rust-version.workspace = true.
Configure¶
Allow one finding in the code with // spirit-level: allow(rust-version-set) <reason> (waivers); the code works there too, as in [lints.M0013].