rust/library
bors 4ecfdfac51 Auto merge of #100214 - scottmcm:strict-range, r=thomcc
Optimize `array::IntoIter`

`.into_iter()` on arrays was slower than it needed to be (especially compared to slice iterator) since it uses `Range<usize>`, which needs to handle degenerate ranges like `10..4`.

This PR adds an internal `IndexRange` type that's like `Range<usize>` but with a safety invariant that means it doesn't need to worry about those cases -- it only handles `start <= end` -- and thus can give LLVM more information to optimize better.

I added one simple demonstration of the improvement as a codegen test.

(`vec::IntoIter` uses pointers instead of indexes, so doesn't have this problem, but that only works because its elements are boxed.  `array::IntoIter` can't use pointers because that would keep it from being movable.)
2022-09-21 00:41:33 +00:00
..
alloc Rollup merge of #101798 - y86-dev:const_waker, r=lcnr 2022-09-19 17:55:19 +02:00
backtrace@07872f28cd
core Auto merge of #100214 - scottmcm:strict-range, r=thomcc 2022-09-21 00:41:33 +00:00
panic_abort
panic_unwind
portable-simd
proc_macro Fix typo in proc_macro Span::eq 2022-09-17 19:15:30 -04:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #100581 - joboet:sync_rwlock_everywhere, r=thomcc 2022-09-20 22:00:08 +00:00
stdarch@699c093a42 Update stdarch 2022-09-15 13:05:28 -04:00
test
unwind