File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/libsyntax/ext/deriving Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,19 @@ fn cs_clone(
52
52
name : & str ,
53
53
cx : & mut ExtCtxt , trait_span : Span ,
54
54
substr : & Substructure ) -> P < Expr > {
55
- let clone_ident = substr. method_ident ;
56
55
let ctor_ident;
57
56
let all_fields;
58
- let subcall = |field : & FieldInfo |
59
- cx. expr_method_call ( field. span , field. self_ . clone ( ) , clone_ident, Vec :: new ( ) ) ;
57
+ let fn_path = vec ! [
58
+ cx. ident_of( "std" ) ,
59
+ cx. ident_of( "clone" ) ,
60
+ cx. ident_of( "Clone" ) ,
61
+ cx. ident_of( "clone" ) ,
62
+ ] ;
63
+ let subcall = |field : & FieldInfo | {
64
+ let args = vec ! [ cx. expr_addr_of( field. span, field. self_. clone( ) ) ] ;
65
+
66
+ cx. expr_call_global ( field. span , fn_path. clone ( ) , args)
67
+ } ;
60
68
61
69
match * substr. fields {
62
70
Struct ( ref af) => {
You can’t perform that action at this time.
0 commit comments