Commit Graph

2 Commits

Author SHA1 Message Date
Peter Jaszkowiak
b3c94df68b introduce Step::forward/backward_overflowing
and optimize the RangeInclusive iterator implementation with them

This changes the `exhausted` field to represent an overflow flag
for the bounds, essentially acting as an extra bit for `Idx`.
This was found to enable optimizations previously only applicable
to the exclusive-ended Range type.

- change end_bound to return Excluded(start) when exhausted
- add contains to tests
- make into_bounds panic when exhausted
  matches From<legacy::RangeInclusive<T>> for RangeInclusive<T>
- add tests for new Step impls
2026-07-06 18:30:20 -06:00
Peter Jaszkowiak
05c50ed141 test that Range loops optimize away
but RangeInclusive loops do not
2026-07-06 18:30:20 -06:00