rust/library/alloctests
Jonathan Brouwer 6d625cc074
Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum
Optimize indexing slices and strs with inclusive ranges

Instead of separately checking for `end == usize::MAX` and `end + 1 > slice.len()`, we can check for `end >= slice.len()`. Also consolidate all the str indexing related panic functions into a single function which reports the correct error depending on the arguments, as the slice indexing code already does.

The downside of all this is that the panic message is slightly less specific when trying to index with `[..=usize::MAX]`: instead of saying "attempted to index str up to maximum usize" it just says "end byte index {end} out of bounds". But this is a rare enough case that I think it is acceptable
2026-02-14 22:11:52 +01:00
..
benches Use rand crate more idiomatically 2026-01-07 22:31:33 +02:00
testing [std][BTree] Create tests for keys which can be == without being identical 2025-08-20 03:39:40 +08:00
tests Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum 2026-02-14 22:11:52 +01:00
Cargo.toml btree: cleanup difference, intersection, is_subset 2025-11-04 15:37:54 +00:00
lib.rs Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00