156
156
//!
157
157
//! ```{.text}
158
158
//! EnumNonMatchingCollapsed(
159
- //! vec![<ident of self>, <ident of __arg_1 >],
159
+ //! vec![<ident of self>, <ident of arg_1 >],
160
160
//! &[<ast::Variant for C0>, <ast::Variant for C1>],
161
- //! &[<ident for self index value>, <ident of __arg_1 index value>])
161
+ //! &[<ident for self index value>, <ident of arg_1 index value>])
162
162
//! ```
163
163
//!
164
164
//! It is the same for when the arguments are flipped to `C1 {x}` and
165
165
//! `C0(a)`; the only difference is what the values of the identifiers
166
- //! <ident for self index value> and <ident of __arg_1 index value> will
166
+ //! <ident for self index value> and <ident of arg_1 index value> will
167
167
//! be in the generated code.
168
168
//!
169
169
//! `EnumNonMatchingCollapsed` deliberately provides far less information
@@ -912,7 +912,7 @@ impl<'a> MethodDef<'a> {
912
912
913
913
for ( i, ty) in self . args . iter ( ) . enumerate ( ) {
914
914
let ast_ty = ty. to_ty ( cx, trait_. span , type_ident, generics) ;
915
- let ident = cx. ident_of ( & format ! ( "__arg_ {}" , i) ) ;
915
+ let ident = cx. ident_of ( & format ! ( "arg_ {}" , i) ) ;
916
916
arg_tys. push ( ( ident, ast_ty) ) ;
917
917
918
918
let arg_expr = cx. expr_ident ( trait_. span , ident) ;
@@ -999,10 +999,10 @@ impl<'a> MethodDef<'a> {
999
999
///
1000
1000
/// // equivalent to:
1001
1001
/// impl PartialEq for A {
1002
- /// fn eq(&self, __arg_1 : &A) -> bool {
1002
+ /// fn eq(&self, arg_1 : &A) -> bool {
1003
1003
/// match *self {
1004
1004
/// A {x: ref __self_0_0, y: ref __self_0_1} => {
1005
- /// match *__arg_1 {
1005
+ /// match *arg_1 {
1006
1006
/// A {x: ref __self_1_0, y: ref __self_1_1} => {
1007
1007
/// __self_0_0.eq(__self_1_0) && __self_0_1.eq(__self_1_1)
1008
1008
/// }
@@ -1015,10 +1015,10 @@ impl<'a> MethodDef<'a> {
1015
1015
/// // or if A is repr(packed) - note fields are matched by-value
1016
1016
/// // instead of by-reference.
1017
1017
/// impl PartialEq for A {
1018
- /// fn eq(&self, __arg_1 : &A) -> bool {
1018
+ /// fn eq(&self, arg_1 : &A) -> bool {
1019
1019
/// match *self {
1020
1020
/// A {x: __self_0_0, y: __self_0_1} => {
1021
- /// match __arg_1 {
1021
+ /// match arg_1 {
1022
1022
/// A {x: __self_1_0, y: __self_1_1} => {
1023
1023
/// __self_0_0.eq(&__self_1_0) && __self_0_1.eq(&__self_1_1)
1024
1024
/// }
@@ -1129,25 +1129,25 @@ impl<'a> MethodDef<'a> {
1129
1129
/// // is equivalent to
1130
1130
///
1131
1131
/// impl PartialEq for A {
1132
- /// fn eq(&self, __arg_1 : &A) -> ::bool {
1133
- /// match (&*self, &*__arg_1 ) {
1132
+ /// fn eq(&self, arg_1 : &A) -> ::bool {
1133
+ /// match (&*self, &*arg_1 ) {
1134
1134
/// (&A1, &A1) => true,
1135
1135
/// (&A2(ref self_0),
1136
- /// &A2(ref __arg_1_0 )) => (*self_0).eq(&(*__arg_1_0 )),
1136
+ /// &A2(ref arg_1_0 )) => (*self_0).eq(&(*arg_1_0 )),
1137
1137
/// _ => {
1138
1138
/// let __self_vi = match *self { A1(..) => 0, A2(..) => 1 };
1139
- /// let __arg_1_vi = match *__arg_1 { A1(..) => 0, A2(..) => 1 };
1139
+ /// let arg_1_vi = match *arg_1 { A1(..) => 0, A2(..) => 1 };
1140
1140
/// false
1141
1141
/// }
1142
1142
/// }
1143
1143
/// }
1144
1144
/// }
1145
1145
/// ```
1146
1146
///
1147
- /// (Of course `__self_vi` and `__arg_1_vi ` are unused for
1147
+ /// (Of course `__self_vi` and `arg_1_vi ` are unused for
1148
1148
/// `PartialEq`, and those subcomputations will hopefully be removed
1149
1149
/// as their results are unused. The point of `__self_vi` and
1150
- /// `__arg_1_vi ` is for `PartialOrd`; see #15503.)
1150
+ /// `arg_1_vi ` is for `PartialOrd`; see #15503.)
1151
1151
fn expand_enum_method_body < ' b > ( & self ,
1152
1152
cx : & mut ExtCtxt ,
1153
1153
trait_ : & TraitDef < ' b > ,
@@ -1220,7 +1220,7 @@ impl<'a> MethodDef<'a> {
1220
1220
if arg_count == 0 {
1221
1221
"__self" . to_string ( )
1222
1222
} else {
1223
- format ! ( "__arg_ {}" , arg_count)
1223
+ format ! ( "arg_ {}" , arg_count)
1224
1224
}
1225
1225
} )
1226
1226
. collect :: < Vec < String > > ( ) ;
@@ -1442,7 +1442,7 @@ impl<'a> MethodDef<'a> {
1442
1442
// down to desired places, but we cannot actually deref
1443
1443
// them when they are fed as r-values into a tuple
1444
1444
// expression; here add a layer of borrowing, turning
1445
- // `(*self, *__arg_0 , ...)` into `(&*self, &*__arg_0 , ...)`.
1445
+ // `(*self, *arg_0 , ...)` into `(&*self, &*arg_0 , ...)`.
1446
1446
let borrowed_self_args = self_args. move_map ( |self_arg| cx. expr_addr_of ( sp, self_arg) ) ;
1447
1447
let match_arg = cx. expr ( sp, ast:: ExprKind :: Tup ( borrowed_self_args) ) ;
1448
1448
@@ -1481,7 +1481,7 @@ impl<'a> MethodDef<'a> {
1481
1481
// generate code like this:
1482
1482
//
1483
1483
// _ => { let __self0 = match *self { };
1484
- // let __self1 = match *__arg_0 { };
1484
+ // let __self1 = match *arg_0 { };
1485
1485
// <catch-all-expr> }
1486
1486
//
1487
1487
// Which is yields bindings for variables which type
@@ -1519,7 +1519,7 @@ impl<'a> MethodDef<'a> {
1519
1519
// down to desired places, but we cannot actually deref
1520
1520
// them when they are fed as r-values into a tuple
1521
1521
// expression; here add a layer of borrowing, turning
1522
- // `(*self, *__arg_0 , ...)` into `(&*self, &*__arg_0 , ...)`.
1522
+ // `(*self, *arg_0 , ...)` into `(&*self, &*arg_0 , ...)`.
1523
1523
let borrowed_self_args = self_args. move_map ( |self_arg| cx. expr_addr_of ( sp, self_arg) ) ;
1524
1524
let match_arg = cx. expr ( sp, ast:: ExprKind :: Tup ( borrowed_self_args) ) ;
1525
1525
cx. expr_match ( sp, match_arg, match_arms)
@@ -1720,8 +1720,8 @@ pub fn cs_fold<F>(use_foldl: bool,
1720
1720
/// process the collected results. i.e.
1721
1721
///
1722
1722
/// ```ignore (only-for-syntax-highlight)
1723
- /// f(cx, span, vec![self_1.method(__arg_1_1, __arg_2_1 ),
1724
- /// self_2.method(__arg_1_2, __arg_2_2 )])
1723
+ /// f(cx, span, vec![self_1.method(arg_1_1, arg_2_1 ),
1724
+ /// self_2.method(arg_1_2, arg_2_2 )])
1725
1725
/// ```
1726
1726
#[ inline]
1727
1727
pub fn cs_same_method < F > ( f : F ,
0 commit comments