]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/num/uint_macros.rs
Rollup merge of #89876 - AlexApps99:const_ops, r=oli-obk
[rust.git] / library / core / src / num / uint_macros.rs
index 507ff516a8f2813124b924665d6653885549dedd..691d0891b144888dc0f8d11a44f9930848977f2a 100644 (file)
@@ -1525,7 +1525,7 @@ pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool) {
             //   to generate optimal code for now, and LLVM doesn't have an equivalent intrinsic
             let (a, b) = self.overflowing_add(rhs);
             let (c, d) = a.overflowing_add(carry as $SelfT);
-            (c, b | d)
+            (c, b || d)
         }
 
         /// Calculates `self` + `rhs` with a signed `rhs`
@@ -1606,7 +1606,7 @@ pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool) {
             //   to generate optimal code for now, and LLVM doesn't have an equivalent intrinsic
             let (a, b) = self.overflowing_sub(rhs);
             let (c, d) = a.overflowing_sub(borrow as $SelfT);
-            (c, b | d)
+            (c, b || d)
         }
 
         /// Computes the absolute difference between `self` and `other`.