about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-16 08:47:06 +0200
committerRalf Jung <post@ralfj.de>2023-08-16 08:47:06 +0200
commite7a1e4271d3c65fb707518d89890195faab29efe (patch)
tree9c09b2bd105a033ea04247482e02a17906a08fbb
parent26cfd211fb00f7f9076bf12eb3eef4da341720d3 (diff)
downloadrust-e7a1e4271d3c65fb707518d89890195faab29efe.tar.gz
rust-e7a1e4271d3c65fb707518d89890195faab29efe.zip
use mem::swap instead of ptr::swap_nonoverlapping
-rw-r--r--library/core/src/cell.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index 69d4c3768db..1d572ede9e4 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -450,7 +450,7 @@ impl<T> Cell<T> {
         // either of these `Cell`s. We also excluded shenanigans like partially overlapping `Cell`s,
         // so `swap` will just properly copy two full values of type `T` back and forth.
         unsafe {
-            ptr::swap_nonoverlapping(self.value.get(), other.value.get(), 1);
+            mem::swap(&mut *self.value.get(), &mut *other.value.get());
         }
     }