File tree 2 files changed +26
-3
lines changed
2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -712,8 +712,9 @@ fn deserialize_seq(
712
712
713
713
if params. has_getter {
714
714
let this_type = & params. this_type ;
715
+ let ( _, ty_generics, _) = params. generics . split_for_impl ( ) ;
715
716
result = quote ! {
716
- _serde:: __private:: Into :: <#this_type>:: into( #result)
717
+ _serde:: __private:: Into :: <#this_type #ty_generics >:: into( #result)
717
718
} ;
718
719
}
719
720
@@ -856,8 +857,9 @@ fn deserialize_newtype_struct(
856
857
let mut result = quote ! ( #type_path( __field0) ) ;
857
858
if params. has_getter {
858
859
let this_type = & params. this_type ;
860
+ let ( _, ty_generics, _) = params. generics . split_for_impl ( ) ;
859
861
result = quote ! {
860
- _serde:: __private:: Into :: <#this_type>:: into( #result)
862
+ _serde:: __private:: Into :: <#this_type #ty_generics >:: into( #result)
861
863
} ;
862
864
}
863
865
@@ -2629,8 +2631,9 @@ fn deserialize_map(
2629
2631
let mut result = quote ! ( #struct_path { #( #result) , * } ) ;
2630
2632
if params. has_getter {
2631
2633
let this_type = & params. this_type ;
2634
+ let ( _, ty_generics, _) = params. generics . split_for_impl ( ) ;
2632
2635
result = quote ! {
2633
- _serde:: __private:: Into :: <#this_type>:: into( #result)
2636
+ _serde:: __private:: Into :: <#this_type #ty_generics >:: into( #result)
2634
2637
} ;
2635
2638
}
2636
2639
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ mod remote {
79
79
pub value : T ,
80
80
}
81
81
82
+ impl < T > StructGeneric < T > {
83
+ #[ allow( dead_code) ]
84
+ pub fn get_value ( & self ) -> & T {
85
+ & self . value
86
+ }
87
+ }
88
+
82
89
pub enum EnumGeneric < T > {
83
90
Variant ( T ) ,
84
91
}
@@ -171,6 +178,13 @@ struct StructPubDef {
171
178
b : remote:: Unit ,
172
179
}
173
180
181
+ #[ derive( Serialize , Deserialize ) ]
182
+ #[ serde( remote = "remote::StructGeneric" ) ]
183
+ struct StructGenericWithGetterDef < T > {
184
+ #[ serde( getter = "remote::StructGeneric::get_value" ) ]
185
+ value : T ,
186
+ }
187
+
174
188
#[ derive( Serialize , Deserialize ) ]
175
189
#[ serde( remote = "remote::StructGeneric<u8>" ) ]
176
190
struct StructConcrete {
@@ -206,3 +220,9 @@ impl From<StructPrivDef> for remote::StructPriv {
206
220
remote:: StructPriv :: new ( def. a , def. b )
207
221
}
208
222
}
223
+
224
+ impl < T > From < StructGenericWithGetterDef < T > > for remote:: StructGeneric < T > {
225
+ fn from ( def : StructGenericWithGetterDef < T > ) -> Self {
226
+ remote:: StructGeneric { value : def. value }
227
+ }
228
+ }
You can’t perform that action at this time.
0 commit comments