Relax A: Clone
bound for rc::Weak::into_raw_and_alloc
This commit is contained in:
parent
9adafa7f8d
commit
255a1e9554
@ -3029,13 +3029,10 @@ pub fn into_raw(self) -> *const T {
|
||||
/// [`as_ptr`]: Weak::as_ptr
|
||||
#[inline]
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
pub fn into_raw_and_alloc(self) -> (*const T, A)
|
||||
where
|
||||
A: Clone,
|
||||
{
|
||||
let result = self.as_ptr();
|
||||
let alloc = self.alloc.clone();
|
||||
mem::forget(self);
|
||||
pub fn into_raw_and_alloc(self) -> (*const T, A) {
|
||||
let rc = mem::ManuallyDrop::new(self);
|
||||
let result = rc.as_ptr();
|
||||
let alloc = unsafe { ptr::read(&rc.alloc) };
|
||||
(result, alloc)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user