5
5
/// (builder_method:ident)
6
6
/// (receiver:expr)
7
7
/// (receiver_ty:ty)
8
- /// (args_prefix *)
9
- /// (args_rest *)
8
+ /// (params_prefix *)
9
+ /// (params_rest *)
10
10
/// ```
11
11
#[ doc( hidden) ]
12
12
#[ macro_export]
13
- macro_rules! __rewrite_self_arg {
13
+ macro_rules! __rewrite_self_param {
14
14
{
15
- ( $( $args : tt) * )
15
+ ( $( $params : tt) * )
16
16
17
17
( $out_macro: path)
18
18
$( $macro_args: tt) *
19
19
} => {
20
- $crate:: __rewrite_self_arg_inner ! {
21
- // Duplicate args out so that we can match on `self`, while still
22
- // using it as a function argument
23
- ( $( $args ) * )
24
- ( $( $args ) * )
20
+ $crate:: __rewrite_self_param_inner ! {
21
+ // Duplicate params out so that we can match on `self`, while still
22
+ // using it as a function parameter
23
+ ( $( $params ) * )
24
+ ( $( $params ) * )
25
25
26
26
( $out_macro)
27
27
$( $macro_args) *
@@ -31,11 +31,11 @@ macro_rules! __rewrite_self_arg {
31
31
32
32
#[ doc( hidden) ]
33
33
#[ macro_export]
34
- macro_rules! __rewrite_self_arg_inner {
34
+ macro_rules! __rewrite_self_param_inner {
35
35
// Instance method
36
36
{
37
- ( & self $( $__args_rest : tt) * )
38
- ( & $self: ident $( , $( $args_rest : tt) * ) ?)
37
+ ( & self $( $__params_rest : tt) * )
38
+ ( & $self: ident $( , $( $params_rest : tt) * ) ?)
39
39
40
40
( $out_macro: path)
41
41
$( $macro_args: tt) *
@@ -50,12 +50,12 @@ macro_rules! __rewrite_self_arg_inner {
50
50
& $self,
51
51
_: $crate:: runtime:: Sel ,
52
52
)
53
- ( $( $( $args_rest ) * ) ?)
53
+ ( $( $( $params_rest ) * ) ?)
54
54
}
55
55
} ;
56
56
{
57
- ( & mut self $( $__args_rest : tt) * )
58
- ( & mut $self: ident $( , $( $args_rest : tt) * ) ?)
57
+ ( & mut self $( $__params_rest : tt) * )
58
+ ( & mut $self: ident $( , $( $params_rest : tt) * ) ?)
59
59
60
60
( $out_macro: path)
61
61
$( $macro_args: tt) *
@@ -70,12 +70,12 @@ macro_rules! __rewrite_self_arg_inner {
70
70
& mut $self,
71
71
_: $crate:: runtime:: Sel ,
72
72
)
73
- ( $( $( $args_rest ) * ) ?)
73
+ ( $( $( $params_rest ) * ) ?)
74
74
}
75
75
} ;
76
76
{
77
- ( self : $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
78
- ( $self: ident: $self_ty: ty $( , $( $args_rest : tt) * ) ?)
77
+ ( self : $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
78
+ ( $self: ident: $self_ty: ty $( , $( $params_rest : tt) * ) ?)
79
79
80
80
( $out_macro: path)
81
81
$( $macro_args: tt) *
@@ -90,12 +90,12 @@ macro_rules! __rewrite_self_arg_inner {
90
90
$self: $self_ty,
91
91
_: $crate:: runtime:: Sel ,
92
92
)
93
- ( $( $( $args_rest ) * ) ?)
93
+ ( $( $( $params_rest ) * ) ?)
94
94
}
95
95
} ;
96
96
{
97
- ( mut self : $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
98
- ( $mut: ident $self: ident: $self_ty: ty $( , $( $args_rest : tt) * ) ?)
97
+ ( mut self : $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
98
+ ( $mut: ident $self: ident: $self_ty: ty $( , $( $params_rest : tt) * ) ?)
99
99
100
100
( $out_macro: path)
101
101
$( $macro_args: tt) *
@@ -110,16 +110,16 @@ macro_rules! __rewrite_self_arg_inner {
110
110
$mut $self: $self_ty,
111
111
_: $crate:: runtime:: Sel ,
112
112
)
113
- ( $( $( $args_rest ) * ) ?)
113
+ ( $( $( $params_rest ) * ) ?)
114
114
}
115
115
} ;
116
116
117
117
// `this: Type` or `_this: Type` instance method
118
118
// Workaround for arbitary self types being unstable
119
119
// https://doc.rust-lang.org/nightly/unstable-book/language-features/arbitrary-self-types.html
120
120
{
121
- ( mut this: $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
122
- ( $mut: ident $this: ident: $this_ty: ty $( , $( $args_rest : tt) * ) ?)
121
+ ( mut this: $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
122
+ ( $mut: ident $this: ident: $this_ty: ty $( , $( $params_rest : tt) * ) ?)
123
123
124
124
( $out_macro: path)
125
125
$( $macro_args: tt) *
@@ -134,12 +134,12 @@ macro_rules! __rewrite_self_arg_inner {
134
134
$mut $this: $this_ty,
135
135
_: $crate:: runtime:: Sel ,
136
136
)
137
- ( $( $( $args_rest ) * ) ?)
137
+ ( $( $( $params_rest ) * ) ?)
138
138
}
139
139
} ;
140
140
{
141
- ( this: $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
142
- ( $this: ident: $this_ty: ty $( , $( $args_rest : tt) * ) ?)
141
+ ( this: $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
142
+ ( $this: ident: $this_ty: ty $( , $( $params_rest : tt) * ) ?)
143
143
144
144
( $out_macro: path)
145
145
$( $macro_args: tt) *
@@ -154,12 +154,12 @@ macro_rules! __rewrite_self_arg_inner {
154
154
$this: $this_ty,
155
155
_: $crate:: runtime:: Sel ,
156
156
)
157
- ( $( $( $args_rest ) * ) ?)
157
+ ( $( $( $params_rest ) * ) ?)
158
158
}
159
159
} ;
160
160
{
161
- ( mut _this: $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
162
- ( $mut: ident $this: ident: $this_ty: ty $( , $( $args_rest : tt) * ) ?)
161
+ ( mut _this: $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
162
+ ( $mut: ident $this: ident: $this_ty: ty $( , $( $params_rest : tt) * ) ?)
163
163
164
164
( $out_macro: path)
165
165
$( $macro_args: tt) *
@@ -174,12 +174,12 @@ macro_rules! __rewrite_self_arg_inner {
174
174
$mut $this: $this_ty,
175
175
_: $crate:: runtime:: Sel ,
176
176
)
177
- ( $( $( $args_rest ) * ) ?)
177
+ ( $( $( $params_rest ) * ) ?)
178
178
}
179
179
} ;
180
180
{
181
- ( _this: $__self_ty: ty $( , $( $__args_rest : tt) * ) ?)
182
- ( $this: ident: $this_ty: ty $( , $( $args_rest : tt) * ) ?)
181
+ ( _this: $__self_ty: ty $( , $( $__params_rest : tt) * ) ?)
182
+ ( $this: ident: $this_ty: ty $( , $( $params_rest : tt) * ) ?)
183
183
184
184
( $out_macro: path)
185
185
$( $macro_args: tt) *
@@ -194,14 +194,14 @@ macro_rules! __rewrite_self_arg_inner {
194
194
$this: $this_ty,
195
195
_: $crate:: runtime:: Sel ,
196
196
)
197
- ( $( $( $args_rest ) * ) ?)
197
+ ( $( $( $params_rest ) * ) ?)
198
198
}
199
199
} ;
200
200
201
201
// Class method
202
202
{
203
- ( $( $__args : tt) * )
204
- ( $( $args_rest : tt) * )
203
+ ( $( $__params : tt) * )
204
+ ( $( $params_rest : tt) * )
205
205
206
206
( $out_macro: path)
207
207
$( $macro_args: tt) *
@@ -216,7 +216,7 @@ macro_rules! __rewrite_self_arg_inner {
216
216
_: & $crate:: runtime:: AnyClass ,
217
217
_: $crate:: runtime:: Sel ,
218
218
)
219
- ( $( $args_rest ) * )
219
+ ( $( $params_rest ) * )
220
220
}
221
221
} ;
222
222
}
0 commit comments