Skip to content

Commit 883bf4b

Browse files
committed
Auto merge of #49630 - npmccallum:shl, r=alexcrichton
Update Rhs on ShlAssign to default to Self This matches the behavior on ShrAssign and all other *Assign operations.
2 parents 5dc896e + 587098a commit 883bf4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/ops/bit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
375375
#[stable(feature = "rust1", since = "1.0.0")]
376376
#[rustc_on_unimplemented(message="no implementation for `{Self} << {RHS}`",
377377
label="no implementation for `{Self} << {RHS}`")]
378-
pub trait Shl<RHS> {
378+
pub trait Shl<RHS=Self> {
379379
/// The resulting type after applying the `<<` operator.
380380
#[stable(feature = "rust1", since = "1.0.0")]
381381
type Output;
@@ -482,7 +482,7 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
482482
#[stable(feature = "rust1", since = "1.0.0")]
483483
#[rustc_on_unimplemented(message="no implementation for `{Self} >> {RHS}`",
484484
label="no implementation for `{Self} >> {RHS}`")]
485-
pub trait Shr<RHS> {
485+
pub trait Shr<RHS=Self> {
486486
/// The resulting type after applying the `>>` operator.
487487
#[stable(feature = "rust1", since = "1.0.0")]
488488
type Output;
@@ -738,7 +738,7 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
738738
#[stable(feature = "op_assign_traits", since = "1.8.0")]
739739
#[rustc_on_unimplemented(message="no implementation for `{Self} <<= {Rhs}`",
740740
label="no implementation for `{Self} <<= {Rhs}`")]
741-
pub trait ShlAssign<Rhs> {
741+
pub trait ShlAssign<Rhs=Self> {
742742
/// Performs the `<<=` operation.
743743
#[stable(feature = "op_assign_traits", since = "1.8.0")]
744744
fn shl_assign(&mut self, rhs: Rhs);

0 commit comments

Comments
 (0)