What this lint catches
clippy::panic warns on any explicit panic!() call in non-test production code. Panics that reach users produce cryptic crash output and bypass the crate's anyhow-based error propagation. This lint enforces that every failure path is either returned as an Err or, when a code path is genuinely unreachable, expressed with unreachable!() — which is semantically precise and excluded from this lint.
Why it improves code quality
This codebase already forbids dbg! and todo! to prevent debug artefacts from shipping. clippy::panic closes the analogous gap for accidental panics:
- Explicitness —
unreachable!() signals intent (this arm cannot be reached), while panic!() is ambiguous.
- Consistency — matches the existing spirit of
dbg_macro = "deny" and todo = "deny".
- Error hygiene — keeps all error paths routed through
anyhow::Result and out of crash-and-burn territory.
Current state
No violations exist in production code. Test files use panic!() in match fallback arms that are genuinely unreachable; those are fixed by replacing them with unreachable!().
This issue was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim. CC @tupe12334
What this lint catches
clippy::panicwarns on any explicitpanic!()call in non-test production code. Panics that reach users produce cryptic crash output and bypass the crate'sanyhow-based error propagation. This lint enforces that every failure path is either returned as anError, when a code path is genuinely unreachable, expressed withunreachable!()— which is semantically precise and excluded from this lint.Why it improves code quality
This codebase already forbids
dbg!andtodo!to prevent debug artefacts from shipping.clippy::paniccloses the analogous gap for accidental panics:unreachable!()signals intent (this arm cannot be reached), whilepanic!()is ambiguous.dbg_macro = "deny"andtodo = "deny".anyhow::Resultand out of crash-and-burn territory.Current state
No violations exist in production code. Test files use
panic!()in match fallback arms that are genuinely unreachable; those are fixed by replacing them withunreachable!().This issue was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim. CC @tupe12334