diff options
| author | bors <bors@rust-lang.org> | 2022-08-08 08:28:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-08 08:28:06 +0000 |
| commit | 97a0cf2de2367187c1f9eb9d9f6d333cb8bc8b8f (patch) | |
| tree | ec0149050d8e9fd120164c730d806dc59e8580a1 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs | |
| parent | 5721ca9a13562f5168c6ba9f43dc19bb76c6f7bb (diff) | |
| parent | aa0b0af3ba170ab6d502ae19ce64124a4ee70017 (diff) | |
| download | rust-97a0cf2de2367187c1f9eb9d9f6d333cb8bc8b8f.tar.gz rust-97a0cf2de2367187c1f9eb9d9f6d333cb8bc8b8f.zip | |
Auto merge of #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. (#9072)
I agree `@kpreid` (https://github.com/rust-lang/rust-clippy/issues/8987#issuecomment-1207464440) that this should be back-ported before the lint hits stable.
changelog: Move `significant_drop_in_scrutinee` into `nursey`
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs')
0 files changed, 0 insertions, 0 deletions
