Skip to content

Commit 1aab524

Browse files
committed
Update for rust 1.77
1 parent 29d9534 commit 1aab524

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎vm/src/object/core.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,11 @@ impl PyWeak {
364364
fn drop_inner(&self) {
365365
let dealloc = {
366366
let mut guard = unsafe { self.parent.as_ref().lock() };
367-
let offset = memoffset::offset_of!(PyInner<PyWeak>, payload);
368-
let pyinner = (self as *const Self as usize - offset) as *const PyInner<Self>;
367+
let offset = std::mem::offset_of!(PyInner<PyWeak>, payload);
368+
let pyinner = (self as *const Self)
369+
.cast::<u8>()
370+
.wrapping_sub(offset)
371+
.cast::<PyInner<Self>>();
369372
let node_ptr = unsafe { NonNull::new_unchecked(pyinner as *mut Py<Self>) };
370373
// the list doesn't have ownership over its PyRef<PyWeak>! we're being dropped
371374
// right now so that should be obvious!!

0 commit comments

Comments
 (0)