about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example/std_example.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-18 13:23:35 +0000
committerbors <bors@rust-lang.org>2023-02-18 13:23:35 +0000
commit85d4b5ac4855433fdb7584285db4f0af65805041 (patch)
tree340b6dd4fb68099abeaa19ade08c77115ae2d787 /compiler/rustc_codegen_gcc/example/std_example.rs
parente1da00210a19817636e3e4c2ebe4844d0b704f61 (diff)
parent75189695011c0c047db3d2eacfbfeb7fb0836aa2 (diff)
downloadrust-85d4b5ac4855433fdb7584285db4f0af65805041.tar.gz
rust-85d4b5ac4855433fdb7584285db4f0af65805041.zip
Auto merge of #10368 - c410-f3r:lock-1, r=xFrednet
[significant_drop_tightening] Evaluate the return expression of a block

For whatever reason, the return expression of a block is not contained inside the slice of statements and because of that the lint wasn't evaluating things that could potentially block the release of a lock.

```rust
pub fn example() -> i32 {
    let mutex = Mutex::new(1);
    let lock = mutex.lock().unwrap();
    let _ = *lock;
    let _ = *lock;
   do_heavy_computation_that_takes_time_and_returns_i32()
}
```

---

changelog: none
<!-- changelog_checked -->
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions