-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Move significant_drop_in_scrutinee
into nursey
#9302
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
The But yeah the suggestion of just moving it in front of the loop/match has other deadlock potential. This should probably be addressed by scoping the match block. That it warns even if the mutex is not used inside the loop/match was intentional, but maybe should also be revisited. But moving it back to nursery SGTM. Beta was already branched though. I try to backport it anyway. @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
…Simulacrum [stable] 1.63.0 release Includes cherry picks of: * rust-lang#100207 * rust-lang/rust-clippy#9302 * Avoid ICE in rustdoc when using Fn bounds rust-lang#100205 r? `@Mark-Simulacrum`
…mulacrum [beta] 1.64.0 branching Includes cherry picks of: * rust-lang#100207 * rust-lang/rust-clippy#9302 * rust-lang/rust@49b1904 (explicit_auto_deref into nursery) * Avoid ICE in rustdoc when using Fn bounds rust-lang#100205 r? `@Mark-Simulacrum`
The current suggestion of extending the lifetime of every sub-expression is not great and doesn't fix the error given in the lint's example, though it does make the potential deadlock easier to see, but it can also cause it's own issues by delaying the drop of the lock guard.
e.g.
The suggestion would create a deadlock at the second
x.lock()
call.This also lints even when a significant drop type isn't created as a temporary. (#9072)
I agree @kpreid (#8987 (comment)) that this should be back-ported before the lint hits stable.
changelog: Move
significant_drop_in_scrutinee
intonursey