diff options
| author | Ilija Tovilo <ilija.tovilo@me.com> | 2019-08-18 23:59:46 +0200 |
|---|---|---|
| committer | Ilija Tovilo <ilija.tovilo@me.com> | 2019-08-20 23:13:08 +0200 |
| commit | 0c5220dc364a389935b5bd99f5f8e4ebbf47f6f8 (patch) | |
| tree | f14af2abaafd5f3be8ebdcb8bd6221ee40e33c54 /src/libcore/num | |
| parent | d65e272a9fe3e61aa5f229c5358e35a909435575 (diff) | |
| download | rust-0c5220dc364a389935b5bd99f5f8e4ebbf47f6f8.tar.gz rust-0c5220dc364a389935b5bd99f5f8e4ebbf47f6f8.zip | |
Test that Wrapping arithmetic ops are implemented for all int types
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/wrapping.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index fd129a306d1..59a10ae99bb 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -18,6 +18,8 @@ macro_rules! sh_impl_signed { } } } + forward_ref_binop! { impl Shl, shl for Wrapping<$t>, $f, + #[stable(feature = "wrapping_ref_ops", since = "1.39.0")] } #[stable(feature = "op_assign_traits", since = "1.8.0")] impl ShlAssign<$f> for Wrapping<$t> { @@ -41,6 +43,8 @@ macro_rules! sh_impl_signed { } } } + forward_ref_binop! { impl Shr, shr for Wrapping<$t>, $f, + #[stable(feature = "wrapping_ref_ops", since = "1.39.0")] } #[stable(feature = "op_assign_traits", since = "1.8.0")] impl ShrAssign<$f> for Wrapping<$t> { @@ -64,6 +68,8 @@ macro_rules! sh_impl_unsigned { Wrapping(self.0.wrapping_shl((other & self::shift_max::$t as $f) as u32)) } } + forward_ref_binop! { impl Shl, shl for Wrapping<$t>, $f, + #[stable(feature = "wrapping_ref_ops", since = "1.39.0")] } #[stable(feature = "op_assign_traits", since = "1.8.0")] impl ShlAssign<$f> for Wrapping<$t> { @@ -83,6 +89,8 @@ macro_rules! sh_impl_unsigned { Wrapping(self.0.wrapping_shr((other & self::shift_max::$t as $f) as u32)) } } + forward_ref_binop! { impl Shr, shr for Wrapping<$t>, $f, + #[stable(feature = "wrapping_ref_ops", since = "1.39.0")] } #[stable(feature = "op_assign_traits", since = "1.8.0")] impl ShrAssign<$f> for Wrapping<$t> { |
