Commit c83fca5
committed
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>1 parent d9fa6d2 commit c83fca5
12 files changed
Lines changed: 377 additions & 152 deletions
File tree
- compiler
- rustc_abi/src
- rustc_index_macros/src
- library
- coretests/tests
- iter
- core/src
- iter
- ops
- tests
- codegen-llvm
- mir-opt/pre-codegen
- ui/impl-trait
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
993 | 1000 | | |
994 | 1001 | | |
995 | 1002 | | |
| |||
1005 | 1012 | | |
1006 | 1013 | | |
1007 | 1014 | | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1008 | 1022 | | |
1009 | 1023 | | |
1010 | 1024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
0 commit comments