diff options
| -rw-r--r-- | library/alloc/src/rc.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index de7b36c922c..18fb1e24f22 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1379,7 +1379,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> { let this = mem::ManuallyDrop::new(this); let ptr = Self::as_ptr(&this); // Safety: `this` is ManuallyDrop so the allocator will not be double-dropped - let alloc = unsafe { ptr::read(Self::allocator(&this)) }; + let alloc = unsafe { ptr::read(&this.alloc) }; (ptr, alloc) } @@ -3061,7 +3061,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> { let this = mem::ManuallyDrop::new(self); let result = this.as_ptr(); // Safety: `this` is ManuallyDrop so the allocator will not be double-dropped - let alloc = unsafe { ptr::read(this.allocator()) }; + let alloc = unsafe { ptr::read(&this.alloc) }; (result, alloc) } diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 0df94e9e2ca..d4b7be8762c 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1520,7 +1520,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> { let this = mem::ManuallyDrop::new(this); let ptr = Self::as_ptr(&this); // Safety: `this` is ManuallyDrop so the allocator will not be double-dropped - let alloc = unsafe { ptr::read(Self::allocator(&this)) }; + let alloc = unsafe { ptr::read(&this.alloc) }; (ptr, alloc) } @@ -2803,7 +2803,7 @@ impl<T: ?Sized, A: Allocator> Weak<T, A> { let this = mem::ManuallyDrop::new(self); let result = this.as_ptr(); // Safety: `this` is ManuallyDrop so the allocator will not be double-dropped - let alloc = unsafe { ptr::read(Self::allocator(&this)) }; + let alloc = unsafe { ptr::read(&this.alloc) }; (result, alloc) } |
