Rules / TAU-P002
No explicit panics
decided by Clippy kernel deny core deny edge warn
Applies to tests: no
Exceptions:
#[expect] + reasonWhy
A panic is an untyped, unrecoverable failure that callers cannot see in the signature.
Fix
Return a typed error variant. If the state is truly impossible, restructure the types so it cannot be represented.
What it checks
Lints: clippy::panic, clippy::unreachable
Seen in fixtures
rej-panic/src/lib.rs core
//! An explicit panic in library code. /// Rejects big values by panicking.#[must_use]pub fn small(x: u8) -> u8 { if x > 3 { panic!("too big"); } x}$ cargo tauten check
error[TAU-P002]: `panic` should not be present in production code --> rej-panic/src/lib.rs:7:9 (core crate `rej-panic`) = rule: No explicit panics (decided by Clippy) = fix: Return a typed error variant. If the state is truly impossible, restructure the types so it cannot be represented.rej-panic (core) expects TAU-P002. Output captured at 0200db3.In the terminal
cargo tauten explain TAU-P002$ cargo tauten explain TAU-P002
TAU-P002: No explicit panics Why: A panic is an untyped, unrecoverable failure that callers cannot see in the signature. Fix: Return a typed error variant. If the state is truly impossible, restructure the types so it cannot be represented. Decided by: ClippyDecides: No `panic!`/`unreachable!` in linted code.Sees: resolved; complete: yesDoes not see: Code expanded from macros defined in other crates (clippy skips it); code disabled by `cfg`; build scripts.Applies to tests: noExceptions allowed: with #[expect(.., reason)] kernel deny core deny edge warnLints: clippy::panic, clippy::unreachable