forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#9302 - Jarcho:sig_drop_nursery, r=flip1995
Move `significant_drop_in_scrutinee` into `nursey` 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. ```rust match x.lock().foo { .. } // some stuff let y = x.lock(); ``` 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. (rust-lang#9072) I agree `@kpreid` (rust-lang/rust-clippy#8987 (comment)) that this should be back-ported before the lint hits stable. changelog: Move `significant_drop_in_scrutinee` into `nursey`
- Loading branch information
Showing
4 changed files
with
2 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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