Move significant_drop_in_scrutinee into nursey#9302
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 8, 2022
Merged
Conversation
|
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
Member
|
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+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This was referenced Aug 8, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 8, 2022
…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`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 9, 2022
…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`
|
I still find this lint very useful, as demonstrated here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_scrutineeintonursey