@@ -258,10 +258,10 @@ pub struct FieldInfo<'a> {
258
258
pub name : Option < Ident > ,
259
259
/// The expression corresponding to this field of `self`
260
260
/// (specifically, a reference to it).
261
- pub self_ : P < Expr > ,
261
+ pub self_expr : P < Expr > ,
262
262
/// The expressions corresponding to references to this field in
263
- /// the other `Self` arguments.
264
- pub other : Vec < P < Expr > > ,
263
+ /// the other selflike arguments.
264
+ pub other_selflike_exprs : Vec < P < Expr > > ,
265
265
/// The attributes on the field
266
266
pub attrs : & ' a [ ast:: Attribute ] ,
267
267
}
@@ -1080,13 +1080,13 @@ impl<'a> MethodDef<'a> {
1080
1080
let fields = if !raw_fields. is_empty ( ) {
1081
1081
let mut raw_fields = raw_fields. into_iter ( ) . map ( |v| v. into_iter ( ) ) ;
1082
1082
let first_field = raw_fields. next ( ) . unwrap ( ) ;
1083
- let mut other_fields : Vec < vec:: IntoIter < _ > > = raw_fields. collect ( ) ;
1083
+ let mut nonself_fields : Vec < vec:: IntoIter < _ > > = raw_fields. collect ( ) ;
1084
1084
first_field
1085
- . map ( |( span, opt_id, field , attrs) | FieldInfo {
1085
+ . map ( |( span, opt_id, expr , attrs) | FieldInfo {
1086
1086
span : span. with_ctxt ( trait_. span . ctxt ( ) ) ,
1087
1087
name : opt_id,
1088
- self_ : field ,
1089
- other : other_fields
1088
+ self_expr : expr ,
1089
+ other_selflike_exprs : nonself_fields
1090
1090
. iter_mut ( )
1091
1091
. map ( |l| {
1092
1092
let ( .., ex, _) = l. next ( ) . unwrap ( ) ;
@@ -1289,7 +1289,7 @@ impl<'a> MethodDef<'a> {
1289
1289
// and pull out getter for same field in each
1290
1290
// of them (using `field_index` tracked above).
1291
1291
// That is the heart of the transposition.
1292
- let others = selflike_pats_idents
1292
+ let other_selflike_exprs = selflike_pats_idents
1293
1293
. iter ( )
1294
1294
. map ( |fields| {
1295
1295
let ( _, _opt_ident, ref other_getter_expr, _) = fields[ field_index] ;
@@ -1307,8 +1307,8 @@ impl<'a> MethodDef<'a> {
1307
1307
FieldInfo {
1308
1308
span,
1309
1309
name : opt_ident,
1310
- self_ : self_getter_expr,
1311
- other : others ,
1310
+ self_expr : self_getter_expr,
1311
+ other_selflike_exprs ,
1312
1312
attrs,
1313
1313
}
1314
1314
} )
@@ -1712,24 +1712,25 @@ where
1712
1712
let ( base, rest) = match ( all_fields. is_empty ( ) , use_foldl) {
1713
1713
( false , true ) => {
1714
1714
let ( first, rest) = all_fields. split_first ( ) . unwrap ( ) ;
1715
- let args = ( first. span , first. self_ . clone ( ) , & first. other [ ..] ) ;
1715
+ let args =
1716
+ ( first. span , first. self_expr . clone ( ) , & first. other_selflike_exprs [ ..] ) ;
1716
1717
( b ( cx, Some ( args) ) , rest)
1717
1718
}
1718
1719
( false , false ) => {
1719
1720
let ( last, rest) = all_fields. split_last ( ) . unwrap ( ) ;
1720
- let args = ( last. span , last. self_ . clone ( ) , & last. other [ ..] ) ;
1721
+ let args = ( last. span , last. self_expr . clone ( ) , & last. other_selflike_exprs [ ..] ) ;
1721
1722
( b ( cx, Some ( args) ) , rest)
1722
1723
}
1723
1724
( true , _) => ( b ( cx, None ) , & all_fields[ ..] ) ,
1724
1725
} ;
1725
1726
1726
1727
if use_foldl {
1727
1728
rest. iter ( ) . fold ( base, |old, field| {
1728
- f ( cx, field. span , old, field. self_ . clone ( ) , & field. other )
1729
+ f ( cx, field. span , old, field. self_expr . clone ( ) , & field. other_selflike_exprs )
1729
1730
} )
1730
1731
} else {
1731
1732
rest. iter ( ) . rev ( ) . fold ( base, |old, field| {
1732
- f ( cx, field. span , old, field. self_ . clone ( ) , & field. other )
1733
+ f ( cx, field. span , old, field. self_expr . clone ( ) , & field. other_selflike_exprs )
1733
1734
} )
1734
1735
}
1735
1736
}
0 commit comments