Closed
Description
Summary
disallowed_types
is valid on use
items.
Lint Name
useless_attribute
Reproducer
With this clippy.toml
:
[[disallowed-types]]
path = "std::io::Stdout"
reason = "Use my_crate::StdoutSafe"
I tried this code:
#[allow(clippy::disallowed_types)]
use std::io::Stdout;
I saw this happen:
error: useless lint attribute
--> src/stdout.rs:5:1
|
5 | #[allow(clippy::disallowed_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(clippy::disallowed_types)]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
= note: `#[deny(clippy::useless_attribute)]` on by default
I expected to see this happen: (no failing lints)
Version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
binary: rustc
commit-hash: 25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04
commit-date: 2024-04-09
host: aarch64-apple-darwin
release: 1.77.2
LLVM version: 17.0.6