about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2024-10-11 14:41:02 -0700
committerJosh Stone <jistone@redhat.com>2024-10-11 16:22:43 -0700
commit5365b3f7be079008d7cac03b821f7c65563ee5ed (patch)
treeb797d50e60b0c4feeabf72027a0a7d25c78839ce /compiler/rustc_codegen_llvm/src/errors.rs
parentf4966590d8edd5f493a1aab04016b94a75494329 (diff)
downloadrust-5365b3f7be079008d7cac03b821f7c65563ee5ed.tar.gz
rust-5365b3f7be079008d7cac03b821f7c65563ee5ed.zip
Avoid superfluous UB checks in `IndexRange`
`IndexRange::len` is justified as an overall invariant, and
`take_prefix` and `take_suffix` are justified by local branch
conditions. A few more UB-checked calls remain in cases that are only
supported locally by `debug_assert!`, which won't do anything in
distributed builds, so those UB checks may still be useful.

We generally expect core's `#![rustc_preserve_ub_checks]` to optimize
away in user's release builds, but the mere presence of that extra code
can sometimes inhibit optimization, as seen in #131563.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions