Open
Description
Summary
In my build script, I generate code. I put attributes on that code to silence lints.
Reproducer
I tried this code:
#![allow(clippy::all, reason = "generated code")]
#![allow(rustc::all, reason = "generated code")]
enum X {
A,
B,
C,
}
impl X {
fn foo(self) {
match self {
X::A => todo!(),
X::B => todo!(),
X::C => todo!(),
}
}
}
I expected to see this happen: no lints triggered
Instead, this happened:
A bunch, such as:
warning: this ident consists of a single char
--> crates/profile/src/lib.rs:4:6
|
4 | enum X {
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#min_ident_chars
= note: `-W clippy::min-ident-chars` implied by `-W clippy::restriction`
= help: to override `-W clippy::restriction` add `#[allow(clippy::min_ident_chars)]`
Version
rustc 1.87.0 (17067e9ac 2025-05-09)
binary: rustc
commit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359
commit-date: 2025-05-09
host: x86_64-unknown-linux-gnu
release: 1.87.0
LLVM version: 20.1.1
Additional Labels
No response