@@ -706,20 +706,45 @@ pub trait Shl<RHS> {
706
706
}
707
707
708
708
macro_rules! shl_impl {
709
- ( $( $ t: ty) * ) => ( $ (
709
+ ( $t: ty, $f : ty ) => (
710
710
#[ stable]
711
- impl Shl <uint > for $t {
711
+ impl Shl <$f > for $t {
712
712
type Output = $t;
713
713
714
714
#[ inline]
715
- fn shl( self , other: uint ) -> $t {
715
+ fn shl( self , other: $f ) -> $t {
716
716
self << other
717
717
}
718
718
}
719
+ )
720
+ }
721
+
722
+ // SNAP 9e4e524e0
723
+ #[ cfg( not( stage0) ) ]
724
+ macro_rules! shl_impl_all {
725
+ ( $( $t: ty) * ) => ( $(
726
+ shl_impl! { $t, u8 }
727
+ shl_impl! { $t, u16 }
728
+ shl_impl! { $t, u32 }
729
+ shl_impl! { $t, u64 }
730
+ shl_impl! { $t, usize }
731
+
732
+ shl_impl! { $t, i8 }
733
+ shl_impl! { $t, i16 }
734
+ shl_impl! { $t, i32 }
735
+ shl_impl! { $t, i64 }
736
+ shl_impl! { $t, isize }
719
737
) * )
720
738
}
721
739
722
- shl_impl ! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
740
+ #[ cfg( stage0) ]
741
+ macro_rules! shl_impl_all {
742
+ ( $( $t: ty) * ) => ( $(
743
+ shl_impl! { $t, usize }
744
+ ) * )
745
+ }
746
+
747
+ shl_impl_all ! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
723
748
724
749
/// The `Shr` trait is used to specify the functionality of `>>`.
725
750
///
@@ -761,17 +786,44 @@ pub trait Shr<RHS> {
761
786
}
762
787
763
788
macro_rules! shr_impl {
764
- ( $( $ t: ty) * ) => ( $ (
765
- impl Shr <uint > for $t {
789
+ ( $t: ty, $f : ty ) => (
790
+ impl Shr <$f > for $t {
766
791
type Output = $t;
767
792
768
793
#[ inline]
769
- fn shr( self , other: uint) -> $t { self >> other }
794
+ fn shr( self , other: $f) -> $t {
795
+ self >> other
796
+ }
770
797
}
798
+ )
799
+ }
800
+
801
+ // SNAP 9e4e524e0
802
+ #[ cfg( not( stage0) ) ]
803
+ macro_rules! shr_impl_all {
804
+ ( $( $t: ty) * ) => ( $(
805
+ shr_impl! { $t, u8 }
806
+ shr_impl! { $t, u16 }
807
+ shr_impl! { $t, u32 }
808
+ shr_impl! { $t, u64 }
809
+ shr_impl! { $t, usize }
810
+
811
+ shr_impl! { $t, i8 }
812
+ shr_impl! { $t, i16 }
813
+ shr_impl! { $t, i32 }
814
+ shr_impl! { $t, i64 }
815
+ shr_impl! { $t, isize }
816
+ ) * )
817
+ }
818
+
819
+ #[ cfg( stage0) ]
820
+ macro_rules! shr_impl_all {
821
+ ( $( $t: ty) * ) => ( $(
822
+ shr_impl! { $t, usize }
771
823
) * )
772
824
}
773
825
774
- shr_impl ! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
826
+ shr_impl_all ! { u8 u16 u32 u64 usize i8 i16 i32 i64 isize }
775
827
776
828
/// The `Index` trait is used to specify the functionality of indexing operations
777
829
/// like `arr[idx]` when used in an immutable context.
0 commit comments