RS.CLIPPY.DOUBLE_MUST_USE
`#[must_use]` attribute on a `#[must_use]`-returning function / method
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: double_must_use. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for a #[must_use] attribute without
further information on functions and methods that return a type already
marked as #[must_use].
Why is this bad?
The attribute isn't needed. Not using the result will already be reported. Alternatively, one can add some text to the attribute to improve the lint message.
Examples
#[must_use]
fn double_must_use() -> Result<(), ()> {
unimplemented!();
}