-
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
fix [manual_unwrap_or_default
] suggestion ignoring side-effects
#12579
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
497d2e2
to
9cafdbd
Compare
Applicability::MachineApplicable, | ||
Applicability::MaybeIncorrect, |
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.
Would be a shame to lose --fix
in cases where it is appropriate, could set the applicability based on https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/fn.span_contains_comment.html
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.
thanks, forgot that I can do that
(kinda want to do some refractoring, having to put same code in different place everytime (same as #12566) is a little bit annoying lol)
Thanks! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I'm still getting a false positive with this lint with rustc 1.79.0-nightly (88c2f4f 2024-04-02):
|
@jqnatividad This fix is not on nightly yet, since the clippy submodule in the rust-lang/rust repo (where the clippy rustup component is built from) is only updated every 2 weeks. You can also clone the clippy repo locally and run |
fixes: #12569
closes: #12580
change applicability to
MaybeIncorrect
when the expression contains a comment base on suggestion in this zulip discussionchangelog: fix [
manual_unwrap_or_default
] suggestion ignoring side-effects, and adjust its applicability.