diff options
| author | bors <bors@rust-lang.org> | 2019-09-02 15:32:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-02 15:32:08 +0000 |
| commit | 9af17757be1cc3f672928ecf06c40a662c5ec26d (patch) | |
| tree | a0dbcad9168bec30ce63a9c17bc70f502e680448 /src/libcore/num | |
| parent | fdaf594bab31eec75fb6d582cd33e5a5b43de7f4 (diff) | |
| parent | 55800ce899d63dd80ad0c99e5617fc275b5e6644 (diff) | |
| download | rust-9af17757be1cc3f672928ecf06c40a662c5ec26d.tar.gz rust-9af17757be1cc3f672928ecf06c40a662c5ec26d.zip | |
Auto merge of #63692 - iluuu1994:issue-49660, r=sfackler
Test that Wrapping arithmetic ops are implemented for all int types Closes #49660
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> { |
