diff options
| author | Nathaniel McCallum <npmccallum@redhat.com> | 2018-04-03 15:03:41 -0400 |
|---|---|---|
| committer | Nathaniel McCallum <npmccallum@redhat.com> | 2018-04-06 09:41:05 -0400 |
| commit | 587098abf943b08cbed79063b5bad30b4864ffe8 (patch) | |
| tree | 9ac9b87486b695b9050772f67183da8f253d34d3 | |
| parent | 637ac17c5292ce723430de0e87b92271989e1436 (diff) | |
| download | rust-587098abf943b08cbed79063b5bad30b4864ffe8.tar.gz rust-587098abf943b08cbed79063b5bad30b4864ffe8.zip | |
Consistently default operator Rhs/RHS to Self
Operator traits seem to be inconsistent regarding the right hand side generic. Most default Rhs/RHS to Self, but a few omit this. This patch modifies them all to default to Self. This should not have any backwards compatibility issues because we are only enabling code that previously wouldn't compile.
| -rw-r--r-- | src/libcore/ops/bit.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/ops/bit.rs b/src/libcore/ops/bit.rs index a0ecd6cf75c..8785cbee633 100644 --- a/src/libcore/ops/bit.rs +++ b/src/libcore/ops/bit.rs @@ -370,7 +370,7 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_on_unimplemented(message="no implementation for `{Self} << {RHS}`", label="no implementation for `{Self} << {RHS}`")] -pub trait Shl<RHS> { +pub trait Shl<RHS=Self> { /// The resulting type after applying the `<<` operator. #[stable(feature = "rust1", since = "1.0.0")] type Output; @@ -472,7 +472,7 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 } #[stable(feature = "rust1", since = "1.0.0")] #[rustc_on_unimplemented(message="no implementation for `{Self} >> {RHS}`", label="no implementation for `{Self} >> {RHS}`")] -pub trait Shr<RHS> { +pub trait Shr<RHS=Self> { /// The resulting type after applying the `>>` operator. #[stable(feature = "rust1", since = "1.0.0")] type Output; @@ -728,7 +728,7 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } #[stable(feature = "op_assign_traits", since = "1.8.0")] #[rustc_on_unimplemented(message="no implementation for `{Self} <<= {Rhs}`", label="no implementation for `{Self} <<= {Rhs}`")] -pub trait ShlAssign<Rhs> { +pub trait ShlAssign<Rhs=Self> { /// Performs the `<<=` operation. #[stable(feature = "op_assign_traits", since = "1.8.0")] fn shl_assign(&mut self, rhs: Rhs); |
