RS.CLIPPY.UNNECESSARY_CLIPPY_CFG
Usage of `cfg_attr(clippy, allow(clippy::lint))` instead of `allow(clippy::lint)`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: unnecessary_clippy_cfg. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for #[cfg_attr(clippy, allow(clippy::lint))]
and suggests to replace it with #[allow(clippy::lint)].
Why is this bad?
There is no reason to put clippy attributes behind a clippy cfg as they are not
run by anything else than clippy.
Example
#![cfg_attr(clippy, allow(clippy::deprecated_cfg_attr))]
Use instead:
#![allow(clippy::deprecated_cfg_attr)]