@@ -31,7 +31,7 @@ use crate::{
3131} ;
3232use indexmap:: { IndexMap , map:: Entry } ;
3333use itertools:: Itertools ;
34- use std:: { borrow:: Borrow , collections:: HashSet , fmt , ops:: Deref , pin:: Pin , ptr:: NonNull } ;
34+ use std:: { borrow:: Borrow , collections:: HashSet , ops:: Deref , pin:: Pin , ptr:: NonNull } ;
3535
3636#[ pyclass( module = false , name = "type" , traverse = "manual" ) ]
3737pub struct PyType {
@@ -69,6 +69,9 @@ pub struct HeapTypeExt {
6969
7070pub struct PointerSlot < T > ( NonNull < T > ) ;
7171
72+ unsafe impl < T > Sync for PointerSlot < T > { }
73+ unsafe impl < T > Send for PointerSlot < T > { }
74+
7275impl < T > PointerSlot < T > {
7376 pub unsafe fn borrow_static ( & self ) -> & ' static T {
7477 unsafe { self . 0 . as_ref ( ) }
@@ -126,14 +129,14 @@ unsafe impl Traverse for PyAttributes {
126129 }
127130}
128131
129- impl fmt:: Display for PyType {
130- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
131- fmt:: Display :: fmt ( & self . name ( ) , f)
132+ impl std :: fmt:: Display for PyType {
133+ fn fmt ( & self , f : & mut std :: fmt:: Formatter < ' _ > ) -> std :: fmt:: Result {
134+ std :: fmt:: Display :: fmt ( & self . name ( ) , f)
132135 }
133136}
134137
135- impl fmt:: Debug for PyType {
136- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
138+ impl std :: fmt:: Debug for PyType {
139+ fn fmt ( & self , f : & mut std :: fmt:: Formatter < ' _ > ) -> std :: fmt:: Result {
137140 write ! ( f, "[PyType {}]" , & self . name( ) )
138141 }
139142}
@@ -908,7 +911,7 @@ impl Constructor for PyType {
908911 let __dict__ = identifier ! ( vm, __dict__) ;
909912 attributes. entry ( __dict__) . or_insert_with ( || {
910913 vm. ctx
911- . new_getset (
914+ . new_static_getset (
912915 "__dict__" ,
913916 vm. ctx . types . type_type ,
914917 subtype_get_dict,
0 commit comments