We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 158f8d0 commit 81685e9Copy full SHA for 81685e9
library/alloc/src/rc.rs
@@ -2042,7 +2042,7 @@ impl<T: ?Sized> Drop for Weak<T> {
2042
// the strong pointers have disappeared.
2043
if inner.weak() == 0 {
2044
unsafe {
2045
- Global.deallocate(self.ptr.cast(), Layout::for_value(self.ptr.as_ref()));
+ Global.deallocate(self.ptr.cast(), Layout::for_value_raw(self.ptr.as_ptr()));
2046
}
2047
2048
library/alloc/src/sync.rs
@@ -1927,7 +1927,7 @@ impl<T: ?Sized> Drop for Weak<T> {
1927
1928
if inner.weak.fetch_sub(1, Release) == 1 {
1929
acquire!(inner.weak);
1930
- unsafe { Global.deallocate(self.ptr.cast(), Layout::for_value(self.ptr.as_ref())) }
+ unsafe { Global.deallocate(self.ptr.cast(), Layout::for_value_raw(self.ptr.as_ptr())) }
1931
1932
1933
0 commit comments