Skip to content

Commit bb6f6d9

Browse files
committed
refactor(test_runner): address the drop_non_drop clippy lint
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#95035
1 parent 159ab9b commit bb6f6d9

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/r3_test_runner/src/targets/kflash.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ impl DebugProbe for KflashDebugProbe {
207207
})
208208
.await
209209
.map_err(RunError::Communication)?;
210-
drop(serial_m);
211210

212211
// Program the executable image
213212
for (i, region) in regions.iter().enumerate() {

0 commit comments

Comments
 (0)