diff options
| author | David Tolnay <dtolnay@gmail.com> | 2019-11-24 01:43:32 -0800 | 
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2019-11-26 23:02:11 -0800 | 
| commit | 95e00bfed801e264e9c4ac817004153ca0f19eb6 (patch) | |
| tree | 79549f727c3fc8bb0b09779a7dc3f94df43654f2 /src/libcore/ops/function.rs | |
| parent | 809e180a76ce97340bf4354ff357bc59e3ca40b2 (diff) | |
| download | rust-95e00bfed801e264e9c4ac817004153ca0f19eb6.tar.gz rust-95e00bfed801e264e9c4ac817004153ca0f19eb6.zip  | |
Format libcore with rustfmt
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
With the list of files from the script in `outstanding_files`, the
relevant commands were:
    $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
    $ rg libcore outstanding_files | xargs git checkout --
Repeating this process several months apart should get us coverage of
most of the rest of libcore.
Diffstat (limited to 'src/libcore/ops/function.rs')
| -rw-r--r-- | src/libcore/ops/function.rs | 56 | 
1 files changed, 35 insertions, 21 deletions
diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs index 35790324a2f..505a65cee3d 100644 --- a/src/libcore/ops/function.rs +++ b/src/libcore/ops/function.rs @@ -57,13 +57,16 @@ #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{Fn}<{Args}>` closure, found `{Self}`", - label="expected an `Fn<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{Fn}<{Args}>` closure, found `{Self}`", + label = "expected an `Fn<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] -pub trait Fn<Args> : FnMut<Args> { +pub trait Fn<Args>: FnMut<Args> { /// Performs the call operation. #[unstable(feature = "fn_traits", issue = "29625")] extern "rust-call" fn call(&self, args: Args) -> Self::Output; @@ -136,13 +139,16 @@ pub trait Fn<Args> : FnMut<Args> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{FnMut}<{Args}>` closure, found `{Self}`", - label="expected an `FnMut<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{FnMut}<{Args}>` closure, found `{Self}`", + label = "expected an `FnMut<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] -pub trait FnMut<Args> : FnOnce<Args> { +pub trait FnMut<Args>: FnOnce<Args> { /// Performs the call operation. #[unstable(feature = "fn_traits", issue = "29625")] extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; @@ -207,9 +213,12 @@ pub trait FnMut<Args> : FnOnce<Args> { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] #[rustc_on_unimplemented( - on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"), - message="expected a `{FnOnce}<{Args}>` closure, found `{Self}`", - label="expected an `FnOnce<{Args}>` closure, found `{Self}`", + on( + Args = "()", + note = "wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}" + ), + message = "expected a `{FnOnce}<{Args}>` closure, found `{Self}`", + label = "expected an `FnOnce<{Args}>` closure, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] @@ -225,8 +234,9 @@ pub trait FnOnce<Args> { mod impls { #[stable(feature = "rust1", since = "1.0.0")] - impl<A,F:?Sized> Fn<A> for &F - where F : Fn<A> + impl<A, F: ?Sized> Fn<A> for &F + where + F: Fn<A>, { extern "rust-call" fn call(&self, args: A) -> F::Output { (**self).call(args) @@ -234,8 +244,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<A,F:?Sized> FnMut<A> for &F - where F : Fn<A> + impl<A, F: ?Sized> FnMut<A> for &F + where + F: Fn<A>, { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { (**self).call(args) @@ -243,8 +254,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<A,F:?Sized> FnOnce<A> for &F - where F : Fn<A> + impl<A, F: ?Sized> FnOnce<A> for &F + where + F: Fn<A>, { type Output = F::Output; @@ -254,8 +266,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<A,F:?Sized> FnMut<A> for &mut F - where F : FnMut<A> + impl<A, F: ?Sized> FnMut<A> for &mut F + where + F: FnMut<A>, { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { (*self).call_mut(args) @@ -263,8 +276,9 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<A,F:?Sized> FnOnce<A> for &mut F - where F : FnMut<A> + impl<A, F: ?Sized> FnOnce<A> for &mut F + where + F: FnMut<A>, { type Output = F::Output; extern "rust-call" fn call_once(self, args: A) -> F::Output {  | 
