diff options
| author | bors <bors@rust-lang.org> | 2019-11-27 12:16:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-11-27 12:16:52 +0000 |
| commit | 04e69e4f4234beb4f12cc76dcc53e2cc4247a9be (patch) | |
| tree | 148834cf05a0062cc851f578c636241d0bd87b30 /src/libcore/ops/function.rs | |
| parent | 876a72a251e0d533f776fa9149b3e4daaeea3a61 (diff) | |
| parent | 166471e7f1f05fe272a4df99c20c1ffc0204a25f (diff) | |
| download | rust-04e69e4f4234beb4f12cc76dcc53e2cc4247a9be.tar.gz rust-04e69e4f4234beb4f12cc76dcc53e2cc4247a9be.zip | |
Auto merge of #66691 - dtolnay:fmt0, r=sfackler
Format libcore with rustfmt I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small. This PR 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: ```console $ 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 { |
