Files
rust/compiler
bors 91e426a051 Auto merge of #164206 - scrabsha:perf/bound-var-length-check, r=nnethercote
Avoid double-checking self.bound_vars' len in ValidateBoundVars' TypeVisitor impl

`ValidateBoundVars` has three instances of the following:

```rust
if list.len() <= idx {
    panic!();
}
bound_ty.assert_eq(list.get(idx).unwrap());
```

The length check on `list` ends up being performed twice: once in the function itself and once in the implementation of the `get` method.

Replacing this by a `let-else` allows to ensure that the bound check is done exactly once. This results in IC improvements ranging from -0.26% to -0.08% except 5 benchmarks that end up being +0.05% to +0.08%.

r? nnethercote 
@bors try @rust-timer queue
2026-10-13 05:00:03 +00:00
..
2026-09-29 22:18:54 +00:00
2026-09-29 22:18:54 +00:00
2026-10-11 10:56:53 +02:00
2026-10-10 17:09:31 +02:00