Skip to content

Commit

Permalink
Auto merge of rust-lang#10774 - c410-f3r:lock-1, r=Jarcho
Browse files Browse the repository at this point in the history
[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
```
  • Loading branch information
bors committed Jun 30, 2023
2 parents 3d4c536 + fc832f0 commit 73f1417
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 281 deletions.
Loading

0 comments on commit 73f1417

Please sign in to comment.