Commit 73f1417
committed
Auto merge of rust-lang#10774 - c410-f3r:lock-1, r=Jarcho
[significant_drop_tightening] Fix rust-lang#10413
Fix rust-lang#10413
This is quite a rewrite that unfortunately took a large amount of time. I tried my best to comment what is going on to easy review but feel free to ask any question.
The problem basically is that the current algorithm is only taking into consideration single blocks which means that things like the following don't work or show unpredictable results.
```rust
let mutex = Mutex::new(1);
{
let lock = mutex.lock().unwrap();
{
let _ = *lock;
}
}
```
The solve the issue, each path that refers a lock is now being tracked individually.
```
changelog: [`significant_drop_tightening`]: Lift the restriction of only considerate single blocks
```File tree
4 files changed
+334
-281
lines changed- clippy_lints/src
- tests/ui
4 files changed
+334
-281
lines changed
0 commit comments