rust/library/core
Matthias Krüger 75dc99b996
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.
2024-03-14 11:10:00 +01:00
..
benches Add benches for net parsing 2024-03-04 18:46:24 -05:00
src Rollup merge of #122461 - the8472:fix-step-forward-unchecked, r=Amanieu 2024-03-14 11:10:00 +01:00
tests fix unsoundness in Step::forward_unchecked for signed integers 2024-03-14 00:57:02 +01:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00