57
57
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
58
58
#[ rustc_paren_sugar]
59
59
#[ rustc_on_unimplemented(
60
- on( Args ="()" , note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" ) ,
61
- message="expected a `{Fn}<{Args}>` closure, found `{Self}`" ,
62
- label="expected an `Fn<{Args}>` closure, found `{Self}`" ,
60
+ on(
61
+ Args = "()" ,
62
+ note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
63
+ ) ,
64
+ message = "expected a `{Fn}<{Args}>` closure, found `{Self}`" ,
65
+ label = "expected an `Fn<{Args}>` closure, found `{Self}`"
63
66
) ]
64
67
#[ fundamental] // so that regex can rely that `&str: !FnMut`
65
68
#[ must_use]
66
- pub trait Fn < Args > : FnMut < Args > {
69
+ pub trait Fn < Args > : FnMut < Args > {
67
70
/// Performs the call operation.
68
71
#[ unstable( feature = "fn_traits" , issue = "29625" ) ]
69
72
extern "rust-call" fn call ( & self , args : Args ) -> Self :: Output ;
@@ -136,13 +139,16 @@ pub trait Fn<Args> : FnMut<Args> {
136
139
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
137
140
#[ rustc_paren_sugar]
138
141
#[ rustc_on_unimplemented(
139
- on( Args ="()" , note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" ) ,
140
- message="expected a `{FnMut}<{Args}>` closure, found `{Self}`" ,
141
- label="expected an `FnMut<{Args}>` closure, found `{Self}`" ,
142
+ on(
143
+ Args = "()" ,
144
+ note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
145
+ ) ,
146
+ message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`" ,
147
+ label = "expected an `FnMut<{Args}>` closure, found `{Self}`"
142
148
) ]
143
149
#[ fundamental] // so that regex can rely that `&str: !FnMut`
144
150
#[ must_use]
145
- pub trait FnMut < Args > : FnOnce < Args > {
151
+ pub trait FnMut < Args > : FnOnce < Args > {
146
152
/// Performs the call operation.
147
153
#[ unstable( feature = "fn_traits" , issue = "29625" ) ]
148
154
extern "rust-call" fn call_mut ( & mut self , args : Args ) -> Self :: Output ;
@@ -215,9 +221,12 @@ pub trait FnMut<Args> : FnOnce<Args> {
215
221
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
216
222
#[ rustc_paren_sugar]
217
223
#[ rustc_on_unimplemented(
218
- on( Args ="()" , note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" ) ,
219
- message="expected a `{FnOnce}<{Args}>` closure, found `{Self}`" ,
220
- label="expected an `FnOnce<{Args}>` closure, found `{Self}`" ,
224
+ on(
225
+ Args = "()" ,
226
+ note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"
227
+ ) ,
228
+ message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`" ,
229
+ label = "expected an `FnOnce<{Args}>` closure, found `{Self}`"
221
230
) ]
222
231
#[ fundamental] // so that regex can rely that `&str: !FnMut`
223
232
#[ must_use]
@@ -233,26 +242,29 @@ pub trait FnOnce<Args> {
233
242
234
243
mod impls {
235
244
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
236
- impl < A , F : ?Sized > Fn < A > for & F
237
- where F : Fn < A >
245
+ impl < A , F : ?Sized > Fn < A > for & F
246
+ where
247
+ F : Fn < A > ,
238
248
{
239
249
extern "rust-call" fn call ( & self , args : A ) -> F :: Output {
240
250
( * * self ) . call ( args)
241
251
}
242
252
}
243
253
244
254
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
245
- impl < A , F : ?Sized > FnMut < A > for & F
246
- where F : Fn < A >
255
+ impl < A , F : ?Sized > FnMut < A > for & F
256
+ where
257
+ F : Fn < A > ,
247
258
{
248
259
extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
249
260
( * * self ) . call ( args)
250
261
}
251
262
}
252
263
253
264
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
254
- impl < A , F : ?Sized > FnOnce < A > for & F
255
- where F : Fn < A >
265
+ impl < A , F : ?Sized > FnOnce < A > for & F
266
+ where
267
+ F : Fn < A > ,
256
268
{
257
269
type Output = F :: Output ;
258
270
@@ -262,17 +274,19 @@ mod impls {
262
274
}
263
275
264
276
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
265
- impl < A , F : ?Sized > FnMut < A > for & mut F
266
- where F : FnMut < A >
277
+ impl < A , F : ?Sized > FnMut < A > for & mut F
278
+ where
279
+ F : FnMut < A > ,
267
280
{
268
281
extern "rust-call" fn call_mut ( & mut self , args : A ) -> F :: Output {
269
282
( * self ) . call_mut ( args)
270
283
}
271
284
}
272
285
273
286
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
274
- impl < A , F : ?Sized > FnOnce < A > for & mut F
275
- where F : FnMut < A >
287
+ impl < A , F : ?Sized > FnOnce < A > for & mut F
288
+ where
289
+ F : FnMut < A > ,
276
290
{
277
291
type Output = F :: Output ;
278
292
extern "rust-call" fn call_once ( self , args : A ) -> F :: Output {
0 commit comments