diff options
| author | Ralf Jung <post@ralfj.de> | 2023-08-16 08:47:06 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-08-16 08:47:06 +0200 |
| commit | e7a1e4271d3c65fb707518d89890195faab29efe (patch) | |
| tree | 9c09b2bd105a033ea04247482e02a17906a08fbb | |
| parent | 26cfd211fb00f7f9076bf12eb3eef4da341720d3 (diff) | |
| download | rust-e7a1e4271d3c65fb707518d89890195faab29efe.tar.gz rust-e7a1e4271d3c65fb707518d89890195faab29efe.zip | |
use mem::swap instead of ptr::swap_nonoverlapping
| -rw-r--r-- | library/core/src/cell.rs | 2 |
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()); } } |
