Skip to content

Commit bb0136e

Browse files
authored
Rollup merge of #122461 - the8472:fix-step-forward-unchecked, r=Amanieu
fix unsoundness in Step::forward_unchecked for signed integers Fixes #122420 ```rust pub fn foo(a: i8, b: u8) -> i8 { unsafe { a.checked_add_unsigned(b).unwrap_unchecked() } } ``` still compiles down to a single arithmetic instruction ([godbolt](https://rust.godbolt.org/z/qsd3xYWfE)). But we may be losing some loop optimizations if llvm can no longer easily derive that it's a finite counted loop from the no-wrapping flags.
2 parents 0398886 + fbf7a93 commit bb0136e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The loop took around 7s
1+
The loop took around 12s

0 commit comments

Comments
 (0)