RS.CLIPPY.ALLOW_ATTRIBUTES_WITHOUT_REASON

Ensures that all `allow` and `expect` attributes have a reason

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: allow_attributes_without_reason. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for attributes that allow lints without a reason.

Why restrict this?

Justifying each allow helps readers understand the reasoning, and may allow removing allow attributes if their purpose is obsolete.

Example

#![allow(clippy::some_lint)]

Use instead:

#![allow(clippy::some_lint, reason = "False positive rust-lang/rust-clippy#1002020")]

Configuration

  • msrv: The minimum rust version that the project supports. Defaults to the rust-version field in Cargo.toml

    (default: current version)