about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-14 11:10:00 +0100
committerGitHub <noreply@github.com>2024-03-14 11:10:00 +0100
commit75dc99b9963a3553e515f9c5da50eb19fbcdaba4 (patch)
tree252a834a19d085b785f510b96397c14d0863808b /src
parentbdf84ea00ec8f81adb0857fe39df34be045daca2 (diff)
parentd3cab9f4d6c778da99185a4548ef7f0899f04766 (diff)
downloadrust-75dc99b9963a3553e515f9c5da50eb19fbcdaba4.tar.gz
rust-75dc99b9963a3553e515f9c5da50eb19fbcdaba4.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/shims/time-with-isolation2.stdout2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/shims/time-with-isolation2.stdout b/src/tools/miri/tests/pass/shims/time-with-isolation2.stdout
index c68b40b744b..dce51a7fdbe 100644
--- a/src/tools/miri/tests/pass/shims/time-with-isolation2.stdout
+++ b/src/tools/miri/tests/pass/shims/time-with-isolation2.stdout
@@ -1 +1 @@
-The loop took around 7s
+The loop took around 12s