@@ -15,11 +15,12 @@ use super::{
1515 ext:: { AsObject , PyResult } ,
1616 payload:: PyObjectPayload ,
1717} ;
18+ #[ cfg( not( feature = "gc" ) ) ]
19+ use crate :: common:: refcount:: RefCount ;
1820use crate :: common:: {
1921 atomic:: { OncePtr , PyAtomic , Radium } ,
2022 linked_list:: { Link , LinkedList , Pointers } ,
2123 lock:: { PyMutex , PyMutexGuard , PyRwLock } ,
22- refcount:: RefCount ,
2324} ;
2425#[ cfg( feature = "gc" ) ]
2526use crate :: object:: gc:: { GcHeader , GcObjPtr , GcStatus , GcTrace , TracerFn } ;
@@ -455,7 +456,7 @@ impl WeakRefList {
455456 }
456457
457458 unsafe fn dealloc ( ptr : NonNull < PyMutex < WeakListInner > > ) {
458- Box :: from_raw ( ptr. as_ptr ( ) ) ;
459+ drop ( Box :: from_raw ( ptr. as_ptr ( ) ) ) ;
459460 }
460461
461462 fn get_weak_references ( & self ) -> Vec < PyRef < PyWeak > > {
@@ -524,7 +525,7 @@ pub struct PyWeak {
524525
525526#[ cfg( feature = "gc" ) ]
526527impl crate :: object:: gc:: GcTrace for PyWeak {
527- fn trace ( & self , tracer_fn : & mut crate :: object:: gc:: TracerFn ) {
528+ fn trace ( & self , _tracer_fn : & mut crate :: object:: gc:: TracerFn ) {
528529 // PyWeak doesn't own the object by define
529530 // FIXME(discord9): confirm this and test
530531 }
0 commit comments