@@ -251,7 +251,7 @@ pub struct Substructure<'a> {
251
251
}
252
252
253
253
/// Summary of the relevant parts of a struct/enum field.
254
- pub struct FieldInfo < ' a > {
254
+ pub struct FieldInfo {
255
255
pub span : Span ,
256
256
/// None for tuple structs/normal enum variants, Some for normal
257
257
/// structs/struct enum variants.
@@ -262,8 +262,6 @@ pub struct FieldInfo<'a> {
262
262
/// The expressions corresponding to references to this field in
263
263
/// the other selflike arguments.
264
264
pub other_selflike_exprs : Vec < P < Expr > > ,
265
- /// The attributes on the field
266
- pub attrs : & ' a [ ast:: Attribute ] ,
267
265
}
268
266
269
267
/// Fields for a static method
@@ -276,11 +274,11 @@ pub enum StaticFields {
276
274
277
275
/// A summary of the possible sets of fields.
278
276
pub enum SubstructureFields < ' a > {
279
- Struct ( & ' a ast:: VariantData , Vec < FieldInfo < ' a > > ) ,
277
+ Struct ( & ' a ast:: VariantData , Vec < FieldInfo > ) ,
280
278
/// Matching variants of the enum: variant index, variant count, ast::Variant,
281
279
/// fields: the field name is only non-`None` in the case of a struct
282
280
/// variant.
283
- EnumMatching ( usize , usize , & ' a ast:: Variant , Vec < FieldInfo < ' a > > ) ,
281
+ EnumMatching ( usize , usize , & ' a ast:: Variant , Vec < FieldInfo > ) ,
284
282
285
283
/// Non-matching variants of the enum, but with all state hidden from the
286
284
/// consequent code. The field is a list of `Ident`s bound to the variant
@@ -1082,18 +1080,17 @@ impl<'a> MethodDef<'a> {
1082
1080
let first_field = raw_fields. next ( ) . unwrap ( ) ;
1083
1081
let mut nonself_fields: Vec < vec:: IntoIter < _ > > = raw_fields. collect ( ) ;
1084
1082
first_field
1085
- . map ( |( span, opt_id, expr, attrs ) | FieldInfo {
1083
+ . map ( |( span, opt_id, expr) | FieldInfo {
1086
1084
span : span. with_ctxt ( trait_. span . ctxt ( ) ) ,
1087
1085
name : opt_id,
1088
1086
self_expr : expr,
1089
1087
other_selflike_exprs : nonself_fields
1090
1088
. iter_mut ( )
1091
1089
. map ( |l| {
1092
- let ( .. , ex , _ ) = l. next ( ) . unwrap ( ) ;
1090
+ let ( _ , _ , ex ) = l. next ( ) . unwrap ( ) ;
1093
1091
ex
1094
1092
} )
1095
1093
. collect ( ) ,
1096
- attrs,
1097
1094
} )
1098
1095
. collect ( )
1099
1096
} else {
@@ -1282,7 +1279,7 @@ impl<'a> MethodDef<'a> {
1282
1279
. into_iter ( )
1283
1280
. enumerate ( )
1284
1281
// For each arg field of self, pull out its getter expr ...
1285
- . map ( |( field_index, ( span, opt_ident, self_getter_expr, attrs ) ) | {
1282
+ . map ( |( field_index, ( span, opt_ident, self_getter_expr) ) | {
1286
1283
// ... but FieldInfo also wants getter expr
1287
1284
// for matching other arguments of Self type;
1288
1285
// so walk across the *other* selflike_pats_idents
@@ -1292,7 +1289,7 @@ impl<'a> MethodDef<'a> {
1292
1289
let other_selflike_exprs = selflike_pats_idents
1293
1290
. iter ( )
1294
1291
. map ( |fields| {
1295
- let ( _, _opt_ident, ref other_getter_expr, _ ) = fields[ field_index] ;
1292
+ let ( _, _opt_ident, ref other_getter_expr) = fields[ field_index] ;
1296
1293
1297
1294
// All Self args have same variant, so
1298
1295
// opt_idents are the same. (Assert
@@ -1309,10 +1306,9 @@ impl<'a> MethodDef<'a> {
1309
1306
name : opt_ident,
1310
1307
self_expr : self_getter_expr,
1311
1308
other_selflike_exprs,
1312
- attrs,
1313
1309
}
1314
1310
} )
1315
- . collect :: < Vec < FieldInfo < ' _ > > > ( ) ;
1311
+ . collect :: < Vec < FieldInfo > > ( ) ;
1316
1312
1317
1313
// Now, for some given VariantK, we have built up
1318
1314
// expressions for referencing every field of every
@@ -1598,7 +1594,7 @@ impl<'a> TraitDef<'a> {
1598
1594
prefix : & str ,
1599
1595
mutbl : ast:: Mutability ,
1600
1596
use_temporaries : bool ,
1601
- ) -> ( P < ast:: Pat > , Vec < ( Span , Option < Ident > , P < Expr > , & ' a [ ast :: Attribute ] ) > ) {
1597
+ ) -> ( P < ast:: Pat > , Vec < ( Span , Option < Ident > , P < Expr > ) > ) {
1602
1598
let mut paths = Vec :: new ( ) ;
1603
1599
let mut ident_exprs = Vec :: new ( ) ;
1604
1600
for ( i, struct_field) in struct_def. fields ( ) . iter ( ) . enumerate ( ) {
@@ -1607,7 +1603,7 @@ impl<'a> TraitDef<'a> {
1607
1603
paths. push ( ident. with_span_pos ( sp) ) ;
1608
1604
let val = cx. expr_path ( cx. path_ident ( sp, ident) ) ;
1609
1605
let val = if use_temporaries { val } else { cx. expr_deref ( sp, val) } ;
1610
- ident_exprs. push ( ( sp, struct_field. ident , val, & struct_field . attrs [ .. ] ) ) ;
1606
+ ident_exprs. push ( ( sp, struct_field. ident , val) ) ;
1611
1607
}
1612
1608
1613
1609
let subpats = self . create_subpatterns ( cx, paths, mutbl, use_temporaries) ;
@@ -1643,7 +1639,7 @@ impl<'a> TraitDef<'a> {
1643
1639
cx : & mut ExtCtxt < ' _ > ,
1644
1640
mut selflike_arg : & P < Expr > ,
1645
1641
struct_def : & ' a VariantData ,
1646
- ) -> Vec < ( Span , Option < Ident > , P < Expr > , & ' a [ ast :: Attribute ] ) > {
1642
+ ) -> Vec < ( Span , Option < Ident > , P < Expr > ) > {
1647
1643
let mut ident_exprs = Vec :: new ( ) ;
1648
1644
for ( i, struct_field) in struct_def. fields ( ) . iter ( ) . enumerate ( ) {
1649
1645
let sp = struct_field. span . with_ctxt ( self . span . ctxt ( ) ) ;
@@ -1666,7 +1662,7 @@ impl<'a> TraitDef<'a> {
1666
1662
} ) ,
1667
1663
) ,
1668
1664
) ;
1669
- ident_exprs. push ( ( sp, struct_field. ident , val, & struct_field . attrs [ .. ] ) ) ;
1665
+ ident_exprs. push ( ( sp, struct_field. ident , val) ) ;
1670
1666
}
1671
1667
ident_exprs
1672
1668
}
@@ -1678,7 +1674,7 @@ impl<'a> TraitDef<'a> {
1678
1674
variant : & ' a ast:: Variant ,
1679
1675
prefix : & str ,
1680
1676
mutbl : ast:: Mutability ,
1681
- ) -> ( P < ast:: Pat > , Vec < ( Span , Option < Ident > , P < Expr > , & ' a [ ast :: Attribute ] ) > ) {
1677
+ ) -> ( P < ast:: Pat > , Vec < ( Span , Option < Ident > , P < Expr > ) > ) {
1682
1678
let sp = variant. span . with_ctxt ( self . span . ctxt ( ) ) ;
1683
1679
let variant_path = cx. path ( sp, vec ! [ enum_ident, variant. ident] ) ;
1684
1680
let use_temporaries = false ; // enums can't be repr(packed)
0 commit comments