M0007 edition-latest¶
Rule: Every crate is on the current edition.
| Code | M0007 (stable, never reused) |
| Id | edition-latest |
| Category | manifest |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | warn |
new code starts on the current edition |
| small-workspace | warn |
new code starts on the current edition |
| medium | warn |
new code starts on the current edition |
| big | warn |
new code starts on the current edition |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Parameters¶
| Name | Type | Default | Meaning |
|---|---|---|---|
edition |
string | "2024" |
the edition every crate is on |
Why¶
Every crate of a project is on the same, current edition, so code moves between crates without surprises (closure captures, impl Trait capture rules, unsafe extern, let chains).
How to fix¶
Run cargo fix --edition, then set edition (or inherit it from [workspace.package]). The parameter edition names the edition expected.
Configure¶
[lints.edition-latest]
level = "deny"
edition = "2024"
reason = "why this project wants it at this level"
Allow one finding in the code with // spirit-level: allow(edition-latest) <reason> (waivers); the code works there too, as in [lints.M0007].