-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Can't disable new struct_field_names
lint
#12093
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
I'm pretty sure that this is "expected" behavior with how lint tables are implemented. The order in which cargo passes lint level arguments for the same priority is arbitrary if I remember the RFC right, so pedantic = { priority = -1, level = "deny" } |
@y21 yes, it works, but why it works for other rules without |
Quoting the reference level explanation:
If I sort your lint table in reverse alphabetical order I get: So, due to this unstable ordering that cargo currently uses, We can verify that this is true by running
(as you can see this is not just struct_field_names: The default priority is 0, which is why using a priority of -1 for the pedantic group forces it to be in front of all the default lints. FWIW, there's an open PR that implements a lint that should hopefully help with this confusion to some degree: #11832 |
Description
New lint
struct_field_names
can't be disabled, while other rules are disabled fine when runningcargo clippy --fix --allow-dirty
.Workspace root
Cargo.toml
:Actual behavior:
Warning:
Expected
No warnings when
struct_field_names = "allow"
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: