-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
used_underscore_bindings: respect lint levels on the binding definition #11523
used_underscore_bindings: respect lint levels on the binding definition #11523
Conversation
r? @Jarcho (rustbot has picked a reviewer for you, use r? to override) |
clippy_lints/src/misc.rs
Outdated
Level::Allow => return, | ||
Level::Expect(id) => { | ||
cx.fulfill_expectation(id); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check might miss a second expectation, if there is also one on the statement level. I think in 99.9% of the cases it should be fine, but it might be safer to also check the level at expr
and potentially fulfill a second expectation. :)
Otherwise very nice check :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha makes sense, does the ForceWarn
expectation ever need to be fulfilled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The force warn expectation should be handled exactly the same as a normal one. That one becomes relevant if there is an #[expect]
and the user specifies a --force-warn
in via the console arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I understanding correctly that --force-warn foo
turns all the #[expect(foo)]
s into Level::ForceWarn(Some(_))
?
Personally I would still expect the lint to emit if --force-warn
was passed, but it could probably still fulfill the expectation to not create a new warning/error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sorry, I typed my answer on the go 😅. With --force-warn
the lint should be emitted as normal, that will emit the lint and fulfill the lint expectation IIRC
r? @xFrednet |
c0b5f07
to
32d3387
Compare
LGTM, thank you for the update. I really like the Looking forward to have this fix in the next rustup of Marker :D @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #11520
Fixes #947
Also ignores usages of
PhantomData
changelog: none