Skip to content

Commit 73bd296

Browse files
committed
Drop unused must-use values immediately
This new warning from Rust 1.64 needs @coolreader18's review.
1 parent 34e09a8 commit 73bd296

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/object/core.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct PyObjVTable {
7878
debug: unsafe fn(&PyObject, &mut fmt::Formatter) -> fmt::Result,
7979
}
8080
unsafe fn drop_dealloc_obj<T: PyObjectPayload>(x: *mut PyObject) {
81-
Box::from_raw(x as *mut PyInner<T>);
81+
drop(Box::from_raw(x as *mut PyInner<T>));
8282
}
8383
unsafe fn debug_obj<T: PyObjectPayload>(x: &PyObject, f: &mut fmt::Formatter) -> fmt::Result {
8484
let x = &*(x as *const PyObject as *const PyInner<T>);
@@ -269,7 +269,7 @@ impl WeakRefList {
269269
}
270270

271271
unsafe fn dealloc(ptr: NonNull<PyMutex<WeakListInner>>) {
272-
Box::from_raw(ptr.as_ptr());
272+
drop(Box::from_raw(ptr.as_ptr()));
273273
}
274274

275275
fn get_weak_references(&self) -> Vec<PyRef<PyWeak>> {

0 commit comments

Comments
 (0)