Skip to content

Commit c708c64

Browse files
committed
Remove and fix useless drop of reference
1 parent 4a56973 commit c708c64

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

std/src/sys/sgx/waitqueue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl WaitQueue {
207207
let mut entry_guard = entry.lock();
208208
let tcs = entry_guard.tcs;
209209
entry_guard.wake = true;
210-
drop(entry);
210+
drop(entry_guard);
211211
Ok(WaitGuard { mutex_guard: Some(guard), notified_tcs: NotifiedTcs::Single(tcs) })
212212
} else {
213213
Err(guard)

std/src/sys/unix/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ impl File {
12101210
// Redox doesn't appear to support `UTIME_OMIT`.
12111211
// ESP-IDF and HorizonOS do not support `futimens` at all and the behavior for those OS is therefore
12121212
// the same as for Redox.
1213-
drop(times);
1213+
let _ = times;
12141214
Err(io::const_io_error!(
12151215
io::ErrorKind::Unsupported,
12161216
"setting file times not supported",

std/src/thread/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,9 @@ fn test_scoped_threads_nll() {
375375
// this is mostly a *compilation test* for this exact function:
376376
fn foo(x: &u8) {
377377
thread::scope(|s| {
378-
s.spawn(|| drop(x));
378+
s.spawn(|| match x {
379+
_ => (),
380+
});
379381
});
380382
}
381383
// let's also run it for good measure

0 commit comments

Comments
 (0)