@@ -207,19 +207,25 @@ pub fn generate(
207207
208208 let rust_struct_name_rust = qobject_names. rust_struct . rust_unqualified ( ) ;
209209
210- result
211- . cxx_qt_mod_contents
212- . append ( & mut vec ! [ parse_quote_spanned! {
213- qobject_name_rust. span( ) => // TODO! Improve this span
214- impl :: cxx_qt:: ConstructorDeclared for #qobject_name_rust_qualified { }
215- } ] ) ;
216-
217210 for ( index, constructor) in constructors. iter ( ) . enumerate ( ) {
211+ let mut arguments = TokenStream :: new ( ) ;
212+ for elem in & constructor. arguments {
213+ arguments. extend ( quote ! ( #elem, ) ) ;
214+ }
215+
218216 let lifetime = constructor. lifetime . as_ref ( ) . map ( |lifetime| {
219217 quote ! {
220218 < #lifetime >
221219 }
222220 } ) ;
221+
222+ result
223+ . cxx_qt_mod_contents
224+ . append ( & mut vec ! [ parse_quote_spanned! {
225+ constructor. imp. span( ) => // TODO! Improve this span
226+ impl #lifetime :: cxx_qt:: ConstructorDeclared <( #arguments) > for #qobject_name_rust_qualified { }
227+ } ] ) ;
228+
223229 let arguments_lifetime =
224230 lifetime_of_arguments ( & constructor. lifetime , & constructor. arguments ) ?;
225231 let base_lifetime =
@@ -610,7 +616,7 @@ mod tests {
610616 assert_tokens_eq (
611617 & blocks. cxx_qt_mod_contents [ 0 ] ,
612618 quote ! {
613- impl :: cxx_qt:: ConstructorDeclared for qobject:: MyObject { }
619+ impl :: cxx_qt:: ConstructorDeclared < ( ) > for qobject:: MyObject { }
614620 } ,
615621 ) ;
616622
@@ -741,6 +747,13 @@ mod tests {
741747
742748 assert_tokens_eq (
743749 & blocks. cxx_qt_mod_contents [ 4 ] ,
750+ quote ! {
751+ impl <' lifetime> :: cxx_qt:: ConstructorDeclared <( * const QObject , ) > for qobject:: MyObject { }
752+ } ,
753+ ) ;
754+
755+ assert_tokens_eq (
756+ & blocks. cxx_qt_mod_contents [ 5 ] ,
744757 quote ! {
745758 #[ doc( hidden) ]
746759 pub fn route_arguments_MyObject_1<' lifetime>( arg0: * const QObject ) -> qobject:: CxxQtConstructorArgumentsMyObject1 <' lifetime>
@@ -768,7 +781,7 @@ mod tests {
768781 } ,
769782 ) ;
770783 assert_tokens_eq (
771- & blocks. cxx_qt_mod_contents [ 5 ] ,
784+ & blocks. cxx_qt_mod_contents [ 6 ] ,
772785 quote ! {
773786 #[ doc( hidden) ]
774787 #[ allow( unused_variables) ]
@@ -782,7 +795,7 @@ mod tests {
782795 } ,
783796 ) ;
784797 assert_tokens_eq (
785- & blocks. cxx_qt_mod_contents [ 6 ] ,
798+ & blocks. cxx_qt_mod_contents [ 7 ] ,
786799 quote ! {
787800 #[ doc( hidden) ]
788801 #[ allow( unused_variables) ]
@@ -821,7 +834,7 @@ mod tests {
821834 ] ) ;
822835
823836 assert_eq ! ( blocks. cxx_mod_contents. len( ) , 10 ) ;
824- assert_eq ! ( blocks. cxx_qt_mod_contents. len( ) , 7 ) ;
837+ assert_eq ! ( blocks. cxx_qt_mod_contents. len( ) , 8 ) ;
825838
826839 let namespace_attr = quote ! {
827840 #[ namespace = "qobject::cxx_qt_MyObject" ]
0 commit comments