Commit bb6f6d9
committed
refactor(test_runner): address the
This `drop` call is intended to cut short the borrow `'a` maintained by
a reference-containing `Mutex<&'a mut _>`, but actually it's unnecessary
because `Mutex`'s contained data (`&'a mut _`) is not subject to [drop
check][1], hence the borrow is allowed to expire before the containing
`Mutex` is dropped.
As for the `drop_non_drop` lint, I would say it's a false-positive
because not every target supported by `std` has a trivial destructor for
`Mutex`. This lint started to trigger only recently because
[rust-lang/rust#95035][2] replaced the `Mutex` implementation with a
futex-based one on Linux.
[1]: https://doc.rust-lang.org/nomicon/dropck.html
[2]: rust-lang/rust#95035drop_non_drop clippy lint1 parent 159ab9b commit bb6f6d9
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
| |||
0 commit comments