File tree Expand file tree Collapse file tree 2 files changed +277
-25
lines changed
itest/rust/src/object_tests Expand file tree Collapse file tree 2 files changed +277
-25
lines changed Original file line number Diff line number Diff line change @@ -44,26 +44,24 @@ pub fn attribute_godot_dyn(input_decl: venial::Item) -> ParseResult<TokenStream>
4444 associated_types. push ( quote ! { #type_name = #type_expr } )
4545 }
4646
47- let associated_impl = if associated_types. is_empty ( ) {
48- None
47+ let assoc_type_constraints = if associated_types. is_empty ( ) {
48+ TokenStream :: new ( )
4949 } else {
50- Some ( quote ! { <#( #associated_types, ) * > } )
50+ quote ! { < #( #associated_types) , * > }
5151 } ;
5252
5353 let class_path = & decl. self_ty ;
5454 let prv = quote ! { :: godot:: private } ;
5555
56- //let dynify_fn = format_ident!("__dynify_{}", class_name);
57-
5856 let new_code = quote ! {
5957 #decl
6058
61- impl :: godot:: obj:: AsDyn <dyn #trait_path #associated_impl > for #class_path {
62- fn dyn_upcast( & self ) -> & ( dyn #trait_path #associated_impl + ' static ) {
59+ impl :: godot:: obj:: AsDyn <dyn #trait_path #assoc_type_constraints > for #class_path {
60+ fn dyn_upcast( & self ) -> & ( dyn #trait_path #assoc_type_constraints + ' static ) {
6361 self
6462 }
6563
66- fn dyn_upcast_mut( & mut self ) -> & mut ( dyn #trait_path #associated_impl + ' static ) {
64+ fn dyn_upcast_mut( & mut self ) -> & mut ( dyn #trait_path #assoc_type_constraints + ' static ) {
6765 self
6866 }
6967 }
You can’t perform that action at this time.
0 commit comments