Rules / TAU-E003

Explicit discards of results need a reason

decided by Clippy kernel deny core deny edge deny
Applies to tests: no Exceptions: #[expect] + reason

Why

let _ = fallible() is visible but still loses the failure. In library code that is rarely right; in tests it is the normal idiom for best-effort cleanup, so tests are exempt.

Fix

Handle or propagate the result. If discarding is correct, say why: #[expect(clippy::let_underscore_must_use, reason = "best-effort cleanup")].

What it checks

Lints: clippy::let_underscore_must_use

Seen in fixtures

rej-let-underscore/src/lib.rs core

//! A result discarded with `let _` and no reason. /// Why saving failed.#[derive(Debug)]pub enum SaveError {    /// Out of space.    Full,} /// Saves a value.////// # Errors/// `SaveError::Full` when there is no space.pub const fn save(x: u8) -> Result<(), SaveError> {    if x == 0 { Err(SaveError::Full) } else { Ok(()) }} /// Saves and ignores the outcome.pub fn save_quietly(x: u8) {    let _ = save(x);}

$ cargo tauten check

error[TAU-E003]: non-binding `let` on an expression with `#[must_use]` type  --> rej-let-underscore/src/lib.rs:20:5 (core crate `rej-let-underscore`)  = rule: Explicit discards of results need a reason (decided by Clippy)  = fix: Handle or propagate the result. If discarding is correct, say why: `#[expect(clippy::let_underscore_must_use, reason = "best-effort cleanup")]`.
Fixture rej-let-underscore (core) expects TAU-E003. Output captured at 0200db3.

In the terminal

cargo tauten explain TAU-E003

$ cargo tauten explain TAU-E003

TAU-E003: Explicit discards of results need a reason Why: `let _ = fallible()` is visible but still loses the failure. In library code that is rarely right; in tests it is the normal idiom for best-effort cleanup, so tests are exempt. Fix: Handle or propagate the result. If discarding is correct, say why: `#[expect(clippy::let_underscore_must_use, reason = "best-effort cleanup")]`. Decided by: ClippyDecides: No `let _ =` discard of a `#[must_use]` value.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 denyLints: clippy::let_underscore_must_use