@@ -1420,20 +1420,13 @@ impl<'a> MethodDef<'a> {
14201420
14211421// general helper methods.
14221422impl < ' a > TraitDef < ' a > {
1423- fn set_expn_info ( & self ,
1424- _cx : & mut ExtCtxt ,
1425- mut to_set : Span ) -> Span {
1426- to_set. expn_id = self . span . expn_id ;
1427- to_set
1428- }
1429-
14301423 fn summarise_struct ( & self ,
14311424 cx : & mut ExtCtxt ,
14321425 struct_def : & VariantData ) -> StaticFields {
14331426 let mut named_idents = Vec :: new ( ) ;
14341427 let mut just_spans = Vec :: new ( ) ;
14351428 for field in struct_def. fields ( ) {
1436- let sp = self . set_expn_info ( cx , field. span ) ;
1429+ let sp = Span { expn_id : self . span . expn_id , .. field. span } ;
14371430 match field. ident {
14381431 Some ( ident) => named_idents. push ( ( ident, sp) ) ,
14391432 _ => just_spans. push ( sp) ,
@@ -1475,7 +1468,7 @@ impl<'a> TraitDef<'a> {
14751468 let mut paths = Vec :: new ( ) ;
14761469 let mut ident_exprs = Vec :: new ( ) ;
14771470 for ( i, struct_field) in struct_def. fields ( ) . iter ( ) . enumerate ( ) {
1478- let sp = self . set_expn_info ( cx , struct_field. span ) ;
1471+ let sp = Span { expn_id : self . span . expn_id , .. struct_field. span } ;
14791472 let ident = cx. ident_of ( & format ! ( "{}_{}" , prefix, i) ) ;
14801473 paths. push ( codemap:: Spanned { span : sp, node : ident} ) ;
14811474 let val = cx. expr_deref ( sp, cx. expr_path ( cx. path_ident ( sp, ident) ) ) ;
0 commit comments