Summary
Enable the clippy::todo lint (deny level) to prevent unfinished todo!() placeholder macros from being merged into production code.
What it catches
clippy::todo flags any use of the todo!() macro. todo!() is meant as a temporary, compile-time-OK placeholder during development — it panics at runtime ("not yet implemented"). When one accidentally survives review and ships, an end user triggers a hard panic instead of real behavior.
Why it improves code quality
- A leftover
todo!() is a latent runtime panic — the compiler accepts it, so nothing catches it without this lint.
- It is exactly the same class of "leftover dev artifact" the crate already guards against with
dbg_macro = "deny". This extends that intent.
- Cost is zero today: the crate currently has no
todo!() usages, so enabling this at deny introduces no violations and no code churn. It is purely a guardrail against future regressions.
It belongs to Clippy's opt-in restriction group, so it is not covered by the pedantic / nursery / cargo groups already enabled in Cargo.toml.
Proposed change
Add to the existing [lints.clippy] table in Cargo.toml, beside dbg_macro:
# Forbid leftover `todo!()` placeholder macros from reaching production
todo = "deny"
A PR implementing this follows.
This issue was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim.
Summary
Enable the
clippy::todolint (deny level) to prevent unfinishedtodo!()placeholder macros from being merged into production code.What it catches
clippy::todoflags any use of thetodo!()macro.todo!()is meant as a temporary, compile-time-OK placeholder during development — it panics at runtime ("not yet implemented"). When one accidentally survives review and ships, an end user triggers a hard panic instead of real behavior.Why it improves code quality
todo!()is a latent runtime panic — the compiler accepts it, so nothing catches it without this lint.dbg_macro = "deny". This extends that intent.todo!()usages, so enabling this atdenyintroduces no violations and no code churn. It is purely a guardrail against future regressions.It belongs to Clippy's opt-in
restrictiongroup, so it is not covered by thepedantic/nursery/cargogroups already enabled inCargo.toml.Proposed change
Add to the existing
[lints.clippy]table inCargo.toml, besidedbg_macro:A PR implementing this follows.
This issue was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim.