theirix commented on code in PR #9418:
URL: https://github.com/apache/arrow-rs/pull/9418#discussion_r2956732631


##########
arrow-buffer/src/bigint/mod.rs:
##########
@@ -807,6 +807,46 @@ impl Shr<u8> for i256 {
     }
 }
 
+impl WrappingShl for i256 {
+    #[inline]
+    fn wrapping_shl(&self, rhs: u32) -> i256 {
+        (*self).shl(rhs)
+    }
+}
+
+impl WrappingShr for i256 {
+    #[inline]
+    fn wrapping_shr(&self, rhs: u32) -> i256 {
+        (*self).shr(rhs)
+    }
+}
+
+// Define Shr<T> and Shl<T> for specified integer types
+macro_rules! define_wrapping_shift {

Review Comment:
   Introduced changes as discussed.
   
   Turns out, it's better to provide multiple Shl/Shr implementations for [all 
numeric types](https://doc.rust-lang.org/src/core/ops/bit.rs.html#517 ), not 
only for `usize` (required by WrappingShl) and `i32` (for bare operations like 
`val << 10` for tests) to be conformant with other types. I reused the macro to 
generate implementations based on existing  `u8`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to