about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2024-04-17 23:55:35 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2024-04-18 18:11:21 -0700
commit986d9f104b2da25f7388ad824b9868c3ce1e5f21 (patch)
tree7ac1d3527e66ce610f6a69835bc5369f8334ff14 /compiler/rustc_errors/src
parente3181b091e88321f5ea149afed6db0edf0a4f37b (diff)
downloadrust-986d9f104b2da25f7388ad824b9868c3ce1e5f21.tar.gz
rust-986d9f104b2da25f7388ad824b9868c3ce1e5f21.zip
Make `checked` ops emit *unchecked* LLVM operations where feasible
For things with easily pre-checked overflow conditions -- shifts and unsigned subtraction -- write then checked methods in such a way that we stop emitting wrapping versions of them.

For example, today <https://rust.godbolt.org/z/qM9YK8Txb> neither
```rust
a.checked_sub(b).unwrap()
```
nor
```rust
a.checked_sub(b).unwrap_unchecked()
```
actually optimizes to `sub nuw`.  After this PR they do.
Diffstat (limited to 'compiler/rustc_errors/src')
0 files changed, 0 insertions, 0 deletions