Skip to content

Commit 6763ffe

Browse files
committed
Do a rustfmt for function.rs
1 parent c0bbc39 commit 6763ffe

File tree

1 file changed

+35
-21
lines changed

1 file changed

+35
-21
lines changed

src/libcore/ops/function.rs

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@
5757
#[stable(feature = "rust1", since = "1.0.0")]
5858
#[rustc_paren_sugar]
5959
#[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}`"
6366
)]
6467
#[fundamental] // so that regex can rely that `&str: !FnMut`
6568
#[must_use]
66-
pub trait Fn<Args> : FnMut<Args> {
69+
pub trait Fn<Args>: FnMut<Args> {
6770
/// Performs the call operation.
6871
#[unstable(feature = "fn_traits", issue = "29625")]
6972
extern "rust-call" fn call(&self, args: Args) -> Self::Output;
@@ -136,13 +139,16 @@ pub trait Fn<Args> : FnMut<Args> {
136139
#[stable(feature = "rust1", since = "1.0.0")]
137140
#[rustc_paren_sugar]
138141
#[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}`"
142148
)]
143149
#[fundamental] // so that regex can rely that `&str: !FnMut`
144150
#[must_use]
145-
pub trait FnMut<Args> : FnOnce<Args> {
151+
pub trait FnMut<Args>: FnOnce<Args> {
146152
/// Performs the call operation.
147153
#[unstable(feature = "fn_traits", issue = "29625")]
148154
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
@@ -215,9 +221,12 @@ pub trait FnMut<Args> : FnOnce<Args> {
215221
#[stable(feature = "rust1", since = "1.0.0")]
216222
#[rustc_paren_sugar]
217223
#[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}`"
221230
)]
222231
#[fundamental] // so that regex can rely that `&str: !FnMut`
223232
#[must_use]
@@ -233,26 +242,29 @@ pub trait FnOnce<Args> {
233242

234243
mod impls {
235244
#[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>,
238248
{
239249
extern "rust-call" fn call(&self, args: A) -> F::Output {
240250
(**self).call(args)
241251
}
242252
}
243253

244254
#[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>,
247258
{
248259
extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
249260
(**self).call(args)
250261
}
251262
}
252263

253264
#[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>,
256268
{
257269
type Output = F::Output;
258270

@@ -262,17 +274,19 @@ mod impls {
262274
}
263275

264276
#[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>,
267280
{
268281
extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output {
269282
(*self).call_mut(args)
270283
}
271284
}
272285

273286
#[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>,
276290
{
277291
type Output = F::Output;
278292
extern "rust-call" fn call_once(self, args: A) -> F::Output {

0 commit comments

Comments
 (0)