diff options
| author | Kevin Reid <kpreid@switchb.org> | 2024-06-11 10:46:27 -0700 |
|---|---|---|
| committer | Kevin Reid <kpreid@switchb.org> | 2024-06-22 08:08:00 -0700 |
| commit | a9a4830d257cd1563687448b31638b20ebbfba46 (patch) | |
| tree | 09decc7d698e0db87b20219ea31163528fc1507a /library/alloc/src/rc.rs | |
| parent | ec201b8650e5026eadf14b20a5d2fd145d1975ba (diff) | |
| download | rust-a9a4830d257cd1563687448b31638b20ebbfba46.tar.gz rust-a9a4830d257cd1563687448b31638b20ebbfba46.zip | |
Replace `WriteCloneIntoRaw` with `CloneToUninit`.
Diffstat (limited to 'library/alloc/src/rc.rs')
| -rw-r--r-- | library/alloc/src/rc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 2b7ab2f6e25..f3a03698903 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -249,6 +249,8 @@ use std::boxed::Box; use core::any::Any; use core::borrow; use core::cell::Cell; +#[cfg(not(no_global_oom_handling))] +use core::clone::CloneToUninit; use core::cmp::Ordering; use core::fmt; use core::hash::{Hash, Hasher}; @@ -268,8 +270,6 @@ use core::slice::from_raw_parts_mut; #[cfg(not(no_global_oom_handling))] use crate::alloc::handle_alloc_error; -#[cfg(not(no_global_oom_handling))] -use crate::alloc::WriteCloneIntoRaw; use crate::alloc::{AllocError, Allocator, Global, Layout}; use crate::borrow::{Cow, ToOwned}; #[cfg(not(no_global_oom_handling))] @@ -1810,7 +1810,7 @@ impl<T: Clone, A: Allocator + Clone> Rc<T, A> { let mut rc = Self::new_uninit_in(this.alloc.clone()); unsafe { let data = Rc::get_mut_unchecked(&mut rc); - (**this).write_clone_into_raw(data.as_mut_ptr()); + (**this).clone_to_uninit(data.as_mut_ptr()); *this = rc.assume_init(); } } else if Rc::weak_count(this) != 0 { |
