about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-03-26 16:18:30 +0200
committerUrgau <urgau@numericable.fr>2023-05-10 19:36:01 +0200
commitd36e390d8176babedcf326581959958d447170cd (patch)
treeea5b730bbc57f6a0a9e3c08ddd4052755a0a7714 /library/std/src
parentf7b831ac8a897273f78b9f47165cf8e54066ce4b (diff)
downloadrust-d36e390d8176babedcf326581959958d447170cd.tar.gz
rust-d36e390d8176babedcf326581959958d447170cd.zip
Remove and fix useless drop of reference
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/sgx/waitqueue/mod.rs2
-rw-r--r--library/std/src/sys/unix/fs.rs2
-rw-r--r--library/std/src/thread/tests.rs4
3 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/sys/sgx/waitqueue/mod.rs b/library/std/src/sys/sgx/waitqueue/mod.rs
index 61bb11d9a6f..ca649ebd9d5 100644
--- a/library/std/src/sys/sgx/waitqueue/mod.rs
+++ b/library/std/src/sys/sgx/waitqueue/mod.rs
@@ -207,7 +207,7 @@ impl WaitQueue {
                 let mut entry_guard = entry.lock();
                 let tcs = entry_guard.tcs;
                 entry_guard.wake = true;
-                drop(entry);
+                drop(entry_guard);
                 Ok(WaitGuard { mutex_guard: Some(guard), notified_tcs: NotifiedTcs::Single(tcs) })
             } else {
                 Err(guard)
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index 22d2ae39713..09db5b11dbf 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -1210,7 +1210,7 @@ impl File {
                 // Redox doesn't appear to support `UTIME_OMIT`.
                 // ESP-IDF and HorizonOS do not support `futimens` at all and the behavior for those OS is therefore
                 // the same as for Redox.
-                drop(times);
+                let _ = times;
                 Err(io::const_io_error!(
                     io::ErrorKind::Unsupported,
                     "setting file times not supported",
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
index 6c9ce6fa0dd..b65e2572cc5 100644
--- a/library/std/src/thread/tests.rs
+++ b/library/std/src/thread/tests.rs
@@ -375,7 +375,9 @@ fn test_scoped_threads_nll() {
     // this is mostly a *compilation test* for this exact function:
     fn foo(x: &u8) {
         thread::scope(|s| {
-            s.spawn(|| drop(x));
+            s.spawn(|| match x {
+                _ => (),
+            });
         });
     }
     // let's also run it for good measure