@@ -166,15 +166,13 @@ macro_rules! pyobject_type_info_type_hint(
166166#[ doc( hidden) ]
167167#[ macro_export]
168168macro_rules! pyobject_native_type_info(
169- ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr, $module: expr, $layout : path $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
169+ ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr, $module: expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
170170 // SAFETY: macro caller has upheld the safety contracts
171171 unsafe impl <$( $generics, ) * > $crate:: type_object:: PyTypeInfo for $name {
172172 const NAME : & ' static str = stringify!( $name) ;
173173 const MODULE : :: std:: option:: Option <& ' static str > = $module;
174174 $crate:: pyobject_type_info_type_hint!( $type_hint_module, $type_hint_name) ;
175175
176- type Layout <T : $crate:: impl_:: pyclass:: PyClassImpl > = $layout;
177-
178176 #[ inline]
179177 #[ allow( clippy:: redundant_closure_call) ]
180178 fn type_object_raw( py: $crate:: Python <' _>) -> * mut $crate:: ffi:: PyTypeObject {
@@ -206,15 +204,15 @@ macro_rules! pyobject_native_type_info(
206204#[ doc( hidden) ]
207205#[ macro_export]
208206macro_rules! pyobject_native_type_core {
209- ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr, #module=$module: expr, #layout=$layout : path $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
207+ ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr, #module=$module: expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
210208 $crate:: pyobject_native_type_named!( $name $( ; $generics) * ) ;
211- $crate:: pyobject_native_type_info!( $name, $typeobject, $type_hint_module, $type_hint_name, $module, $layout $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
209+ $crate:: pyobject_native_type_info!( $name, $typeobject, $type_hint_module, $type_hint_name, $module $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
212210 } ;
213211 ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr, #module=$module: expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
214- $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module, $type_hint_name, #module=$module, #layout=$crate :: impl_ :: pycell :: PyStaticClassObject < T > $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
212+ $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module, $type_hint_name, #module=$module $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
215213 } ;
216214 ( $name: ty, $typeobject: expr, $type_hint_module: expr, $type_hint_name: expr $( , #checkfunction=$checkfunction: path) ? $( ; $generics: ident) * ) => {
217- $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module, $type_hint_name, #module=:: std:: option:: Option :: Some ( "builtins" ) , #layout=$crate :: impl_ :: pycell :: PyStaticClassObject < T > $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
215+ $crate:: pyobject_native_type_core!( $name, $typeobject, $type_hint_module, $type_hint_name, #module=:: std:: option:: Option :: Some ( "builtins" ) $( , #checkfunction=$checkfunction) ? $( ; $generics) * ) ;
218216 } ;
219217}
220218
@@ -228,6 +226,7 @@ macro_rules! pyobject_subclassable_native_type {
228226 type BaseNativeType = $name;
229227 type Initializer = $crate:: impl_:: pyclass_init:: PyNativeTypeInitializer <Self >;
230228 type PyClassMutability = $crate:: pycell:: impl_:: ImmutableClass ;
229+ type Layout <T : $crate:: impl_:: pyclass:: PyClassImpl > = $crate:: impl_:: pycell:: PyStaticClassObject <T >;
231230 }
232231 }
233232}
0 commit comments