Open palant opened 2 weeks ago
I can now see why this only started happening with 1.80.0-beta.1 for me – I have the lints defined in the workspace, so before https://github.com/rust-lang/rust/commit/fa8f4b88cbf3cfb6bad3076c24d0d11625003295 they weren’t being checked at all. I guess this isn’t a regression after all.
Also, it seems that lint_groups_priority
doesn’t check for conflicting lints at all – it will just flag any lint and any group existing within the same priority. This is unexpected, not sure whether this is intended to work like this. At least the tests use lints that are actually part of the group being flagged.
And technically speaking keyword_idents
is a group, consisting of the lints keyword_idents_2018
and keyword_idents_2024
.
So all of this has an explanation it seems. But the current behavior still doesn’t make much sense to me.
@rustbot label -needs-triage +A-clippy +D-confusing
@rustbot transfer rust-clippy
I believe this was fixed by #12827 (which is not on nightly yet).
I believe this was fixed by #12827 (which is not on nightly yet).
Yes, judging by the code it fixes my specific use case. It will still flag unrelated lints and groups if the level is different however, e.g. here:
[package]
name = "testing"
version = "0.1.0"
edition = "2021"
[lints.clippy]
lint_groups_priority = "warn"
[lints.rust]
keyword_idents = "deny"
macro_use_extern_crate = "warn"
rust_2018_idioms = "deny"
single_use_lifetimes = "allow"
The order shouldn’t matter here because these lints aren’t part of the flagged groups. The code still won’t check that however.
I’m using the following
Cargo.toml
:Running
cargo clippy
produces two warnings here:While making the proposed changes silences the warnings, these look like false positives. According to documentation,
single_use_lifetimes
isn’t part ofrust_2018_idioms
, andkeyword_idents
isn’t a group at all.Meta
rustc --version --verbose
: