-
Notifications
You must be signed in to change notification settings - Fork 1.6k
False positive unfulfilled_lint_expectations
for enum_glob_use
with --all-targets
or --tests
#13358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The lint emission is gated behind the compilation unit NOT behind a test harness generation, it shouldn't be. rust-clippy/clippy_lints/src/wildcard_imports.rs Lines 119 to 121 in fb9913e
|
Same issue with both
with this code: #![deny(clippy::missing_docs_in_private_items)]
#[expect(clippy::missing_docs_in_private_items)]
const WHO_AM_I: () = (); |
It's worth noting that in the case of |
Also facing the same issue with #[expect(clippy::wildcard_imports, reason = "mre")]
use crate::internal::*;
mod internal {
pub fn fn1() {}
}
fn main() {
fn1();
} $ cargo clippy --all-targets
warning: this lint expectation is unfulfilled
--> src/main.rs:1:10
|
1 | #[expect(clippy::wildcard_imports, reason = "mre")]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: mre
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: `reproduce` (bin "reproduce" test) generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s
Versions $ rustc --version && cargo --version && cargo clippy --version
rustc 1.85.1 (4eb161250 2025-03-15)
cargo 1.85.1 (d73d2caf9 2024-12-31)
clippy 0.1.85 (4eb161250e 2025-03-15) |
Summary
unfulfilled_lint_expectations
seems to trigger forenum_glob_use
when either--all-targets
or--tests
is used. Yet other lints, likeunreadable_literal
don't behave that way.rust-lang/rust#130021
rust-lang/rust-analyzer#17685
Lint Name
enum_glob_use
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: