@@ -198,7 +198,7 @@ where
198198/// need to be cleaned again.
199199pub ( super ) fn mark_clean < T > ( allocation : & PyInner < T > )
200200where
201- T : Traverse + Send + Sync + ? Sized ,
201+ T : Traverse + Send + Sync + Sized ,
202202{
203203 DUMPSTER . with ( |dumpster| {
204204 if dumpster
@@ -357,7 +357,7 @@ impl GarbageTruck {
357357/// # Safety
358358///
359359/// `ptr` must have been created as a pointer to a `PyInner<T>`.
360- unsafe fn dfs < T : Traverse + Send + Sync + ? Sized > (
360+ unsafe fn dfs < T : Traverse + Send + Sync > (
361361 ptr : Erased ,
362362 ref_graph : & mut HashMap < AllocationId , AllocationInfo > ,
363363) {
@@ -384,8 +384,7 @@ unsafe fn dfs<T: Traverse + Send + Sync + ?Sized>(
384384 } ) ;
385385
386386 if box_ref
387- . value
388- . accept ( & mut Dfs {
387+ . traverse ( & mut Dfs {
389388 ref_graph,
390389 current_id : starting_id,
391390 } )
@@ -412,13 +411,13 @@ struct Dfs<'a> {
412411impl < ' a > Visitor for Dfs < ' a > {
413412 fn visit_sync < T > ( & mut self , gc : & PyObjectRef )
414413 where
415- T : Traverse + Send + Sync + ? Sized ,
414+ T : Traverse + Send + Sync + Sized ,
416415 {
417416 // must not use deref operators since we don't want to update the generation
418417 let ptr = unsafe {
419418 // SAFETY: This is the same as the deref implementation, but avoids
420419 // incrementing the generation count.
421- ( * gc. ptr . get ( ) ) . unwrap ( )
420+ ( * gc. ptr . read ( ) ) . unwrap ( )
422421 } ;
423422 let box_ref = unsafe {
424423 // SAFETY: same as above.
@@ -509,7 +508,7 @@ fn mark(root: AllocationId, graph: &mut HashMap<AllocationId, AllocationInfo>) {
509508/// # Safety
510509///
511510/// `ptr` must have been created from a pointer to a `PyInner<T>`.
512- unsafe fn destroy_erased < T : Traverse + Send + Sync + ? Sized > (
511+ unsafe fn destroy_erased < T : Traverse + Send + Sync > (
513512 ptr : Erased ,
514513 graph : & HashMap < AllocationId , AllocationInfo > ,
515514) {
@@ -523,7 +522,7 @@ unsafe fn destroy_erased<T: Traverse + Send + Sync + ?Sized>(
523522 impl Visitor for PrepareForDestruction < ' _ > {
524523 fn visit_sync < T > ( & mut self , gc : & PyObjectRef )
525524 where
526- T : Traverse + Send + Sync + ? Sized ,
525+ T : Traverse + Send + Sync + Sized ,
527526 {
528527 let id = AllocationId :: from ( unsafe {
529528 // SAFETY: This is the same as dereferencing the GC.
@@ -538,16 +537,15 @@ unsafe fn destroy_erased<T: Traverse + Send + Sync + ?Sized>(
538537 unsafe {
539538 // SAFETY: The GC is unreachable,
540539 // so the GC will never be dereferenced again.
541- gc. ptr . get ( ) . write ( ( * gc. ptr . get ( ) ) . as_null ( ) ) ;
540+ gc. ptr . write ( ( * gc. ptr . read ( ) ) . as_null ( ) ) ;
542541 }
543542 }
544543 }
545544 }
546545
547546 let specified = ptr. specify :: < PyInner < T > > ( ) . as_mut ( ) ;
548547 specified
549- . value
550- . accept ( & mut PrepareForDestruction { graph } )
548+ . traverse ( & mut PrepareForDestruction { graph } )
551549 . expect ( "allocation assumed to be unreachable but somehow was accessed" ) ;
552550 let layout = Layout :: for_value ( specified) ;
553551 drop_in_place ( specified) ;
@@ -560,7 +558,7 @@ unsafe fn destroy_erased<T: Traverse + Send + Sync + ?Sized>(
560558/// # Safety
561559///
562560/// `ptr` must have been created as a pointer to a `PyInner<T>`.
563- unsafe fn drop_weak_zero < T : Traverse + Send + Sync + ? Sized > ( ptr : Erased ) {
561+ unsafe fn drop_weak_zero < T : Traverse + Send + Sync > ( ptr : Erased ) {
564562 let mut specified = ptr. specify :: < PyInner < T > > ( ) ;
565563 assert_eq ! ( specified. as_ref( ) . ref_count. weak. load( Ordering :: Relaxed ) , 0 ) ;
566564 assert_eq ! ( specified. as_ref( ) . ref_count. strong. load( Ordering :: Relaxed ) , 0 ) ;
@@ -575,7 +573,7 @@ unsafe impl Sync for AllocationId {}
575573
576574impl < T > From < & PyInner < T > > for AllocationId
577575where
578- T : Traverse + Send + Sync + ? Sized ,
576+ T : Traverse + Send + Sync ,
579577{
580578 fn from ( value : & PyInner < T > ) -> Self {
581579 AllocationId ( NonNull :: from ( value) . cast ( ) )
@@ -584,7 +582,7 @@ where
584582
585583impl < T > From < NonNull < PyInner < T > > > for AllocationId
586584where
587- T : Traverse + Send + Sync + ? Sized ,
585+ T : Traverse + Send + Sync ,
588586{
589587 fn from ( value : NonNull < PyInner < T > > ) -> Self {
590588 AllocationId ( value. cast ( ) )
0 commit comments