1- use deriving:: path_std;
2- use deriving:: generic:: * ;
3- use deriving:: generic:: ty:: * ;
1+ use crate :: deriving:: path_std;
2+ use crate :: deriving:: generic:: * ;
3+ use crate :: deriving:: generic:: ty:: * ;
44
5- use syntax:: ast:: { self , Expr , Generics , ItemKind , MetaItem , VariantData } ;
6- use syntax:: ast:: GenericArg ;
5+ use syntax:: ast:: { self , Expr , GenericArg , Generics , ItemKind , MetaItem , VariantData } ;
76use syntax:: attr;
87use syntax:: ext:: base:: { Annotatable , ExtCtxt } ;
98use syntax:: ext:: build:: AstBuilder ;
109use syntax:: ptr:: P ;
1110use syntax:: symbol:: { Symbol , keywords} ;
1211use syntax_pos:: Span ;
1312
14- pub fn expand_deriving_clone ( cx : & mut ExtCtxt ,
13+ pub fn expand_deriving_clone ( cx : & mut ExtCtxt < ' _ > ,
1514 span : Span ,
1615 mitem : & MetaItem ,
1716 item : & Annotatable ,
@@ -105,12 +104,12 @@ pub fn expand_deriving_clone(cx: &mut ExtCtxt,
105104}
106105
107106fn cs_clone_shallow ( name : & str ,
108- cx : & mut ExtCtxt ,
107+ cx : & mut ExtCtxt < ' _ > ,
109108 trait_span : Span ,
110- substr : & Substructure ,
109+ substr : & Substructure < ' _ > ,
111110 is_union : bool )
112111 -> P < Expr > {
113- fn assert_ty_bounds ( cx : & mut ExtCtxt , stmts : & mut Vec < ast:: Stmt > ,
112+ fn assert_ty_bounds ( cx : & mut ExtCtxt < ' _ > , stmts : & mut Vec < ast:: Stmt > ,
114113 ty : P < ast:: Ty > , span : Span , helper_name : & str ) {
115114 // Generate statement `let _: helper_name<ty>;`,
116115 // set the expn ID so we can use the unstable struct.
@@ -120,7 +119,7 @@ fn cs_clone_shallow(name: &str,
120119 vec ! [ GenericArg :: Type ( ty) ] , vec ! [ ] ) ;
121120 stmts. push ( cx. stmt_let_type_only ( span, cx. ty_path ( assert_path) ) ) ;
122121 }
123- fn process_variant ( cx : & mut ExtCtxt , stmts : & mut Vec < ast:: Stmt > , variant : & VariantData ) {
122+ fn process_variant ( cx : & mut ExtCtxt < ' _ > , stmts : & mut Vec < ast:: Stmt > , variant : & VariantData ) {
124123 for field in variant. fields ( ) {
125124 // let _: AssertParamIsClone<FieldTy>;
126125 assert_ty_bounds ( cx, stmts, field. ty . clone ( ) , field. span , "AssertParamIsClone" ) ;
@@ -151,14 +150,14 @@ fn cs_clone_shallow(name: &str,
151150}
152151
153152fn cs_clone ( name : & str ,
154- cx : & mut ExtCtxt ,
153+ cx : & mut ExtCtxt < ' _ > ,
155154 trait_span : Span ,
156- substr : & Substructure )
155+ substr : & Substructure < ' _ > )
157156 -> P < Expr > {
158157 let ctor_path;
159158 let all_fields;
160159 let fn_path = cx. std_path ( & [ "clone" , "Clone" , "clone" ] ) ;
161- let subcall = |cx : & mut ExtCtxt , field : & FieldInfo | {
160+ let subcall = |cx : & mut ExtCtxt < ' _ > , field : & FieldInfo < ' _ > | {
162161 let args = vec ! [ cx. expr_addr_of( field. span, field. self_. clone( ) ) ] ;
163162 cx. expr_call_global ( field. span , fn_path. clone ( ) , args)
164163 } ;
0 commit comments