Summary
Newly on nightly (playground clippy 2026-02-22 c78a294 or local clippy 3c9faa0 2026-02-16) but not stable (1.93.1), clippy is producing false unfulfilled_lint_expectations diagnostics for multiple lints. A cfg seems to be needed to provoke the bug.
Lint Name
module_name_repetitions, exhaustive_structs
Reproducer
I tried this code:
#![warn(clippy::module_name_repetitions)]
#![warn(clippy::exhaustive_structs)]
pub mod logging {
#[derive(Debug)]
#[expect(clippy::module_name_repetitions)]
#[expect(clippy::exhaustive_structs)]
pub struct LoggingArgs {
#[cfg(false)]
x: i32,
}
}
I saw this happen:
warning: this lint expectation is unfulfilled
--> src/lib.rs:7:14
|
7 | #[expect(clippy::module_name_repetitions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: this lint expectation is unfulfilled
--> src/lib.rs:8:14
|
8 | #[expect(clippy::exhaustive_structs)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `playground` (lib) generated 2 warnings
I expected to see this happen: No warnings
Version
rustc 1.95.0-nightly (3c9faa0d0 2026-02-16)
binary: rustc
commit-hash: 3c9faa0d037b9eecda4a440cc482ff7f960fb8a5
commit-date: 2026-02-16
host: aarch64-apple-darwin
release: 1.95.0-nightly
LLVM version: 22.1.0
Additional Labels
No response
Summary
Newly on nightly (playground clippy 2026-02-22 c78a294 or local clippy 3c9faa0 2026-02-16) but not stable (1.93.1), clippy is producing false
unfulfilled_lint_expectationsdiagnostics for multiple lints. Acfgseems to be needed to provoke the bug.Lint Name
module_name_repetitions, exhaustive_structs
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen: No warnings
Version
Additional Labels
No response