@@ -1420,20 +1420,13 @@ impl<'a> MethodDef<'a> {
1420
1420
1421
1421
// general helper methods.
1422
1422
impl < ' 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
-
1430
1423
fn summarise_struct ( & self ,
1431
1424
cx : & mut ExtCtxt ,
1432
1425
struct_def : & VariantData ) -> StaticFields {
1433
1426
let mut named_idents = Vec :: new ( ) ;
1434
1427
let mut just_spans = Vec :: new ( ) ;
1435
1428
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 } ;
1437
1430
match field. ident {
1438
1431
Some ( ident) => named_idents. push ( ( ident, sp) ) ,
1439
1432
_ => just_spans. push ( sp) ,
@@ -1475,7 +1468,7 @@ impl<'a> TraitDef<'a> {
1475
1468
let mut paths = Vec :: new ( ) ;
1476
1469
let mut ident_exprs = Vec :: new ( ) ;
1477
1470
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 } ;
1479
1472
let ident = cx. ident_of ( & format ! ( "{}_{}" , prefix, i) ) ;
1480
1473
paths. push ( codemap:: Spanned { span : sp, node : ident} ) ;
1481
1474
let val = cx. expr_deref ( sp, cx. expr_path ( cx. path_ident ( sp, ident) ) ) ;
0 commit comments