rust/library
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
..
alloc Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann 2026-02-13 13:34:58 +01:00
alloctests Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum 2026-02-14 22:11:52 +01:00
backtrace@28ec93b503 Update backtrace 2026-01-26 10:57:35 +00:00
compiler-builtins libm: Fix tests for lgamma 2026-02-09 04:32:04 -06:00
core Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum 2026-02-14 22:11:52 +01:00
coretests Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00
panic_abort Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
panic_unwind Remove unused features in library 2026-02-13 09:25:50 +08:00
portable-simd Merge commit 'd9aae8cc54' into sync-from-portable-simd-2026-01-28 2026-01-28 00:56:52 -05:00
proc_macro inline SameThread and CrossThread 2026-02-13 11:24:50 +00:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
rustc-std-workspace-core Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
rustc-std-workspace-std Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
std Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann 2026-02-13 13:34:58 +01:00
std_detect Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00
stdarch Merge pull request #2020 from Snehal-Reddy/main 2026-02-11 20:40:14 +00:00
sysroot compiler-builtins: Remove the no-f16-f128 feature 2026-01-11 07:02:27 -06:00
test Remove unused features in library 2026-02-13 09:25:50 +08:00
unwind Remove unused features in library 2026-02-13 09:25:50 +08:00
windows_link Update windows bindings in std 2026-01-26 10:59:16 +00:00
Cargo.lock Rollup merge of #151660 - fmease:bump-backtrace-demangler-alt, r=tgross35 2026-01-28 21:10:51 +01:00
Cargo.toml Update windows bindings in std 2026-01-26 10:59:16 +00:00