Skip to content

Commit 3f33770

Browse files
authored
Rollup merge of rust-lang#133674 - scottmcm:chain-carrying-add, r=Amanieu
Fix chaining `carrying_add`s Something about the MIR lowering for `||` ended up breaking this, but it's fixed by changing the code to use `|` instead. I also added an assembly test to ensure it *keeps* being [`adc`](https://www.felixcloutier.com/x86/adc). cc rust-lang#85532 (comment), which noticed this.
2 parents f77fe3f + e8d5e83 commit 3f33770

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/num/uint_macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ macro_rules! uint_impl {
23542354
// to generate optimal code for now, and LLVM doesn't have an equivalent intrinsic
23552355
let (a, b) = self.overflowing_add(rhs);
23562356
let (c, d) = a.overflowing_add(carry as $SelfT);
2357-
(c, b || d)
2357+
(c, b | d)
23582358
}
23592359

23602360
/// Calculates `self` + `rhs` with a signed `rhs`.

0 commit comments

Comments
 (0)