Commit e7752ae
authored
Rollup merge of rust-lang#68469 - ollie27:skip_count, r=sfackler
Avoid overflow in `std::iter::Skip::count`
The call to `count` on the inner iterator can overflow even if `Skip` itself would return less that `usize::max_value()` items.
Fixes rust-lang#68139File tree
2 files changed
+16
-2
lines changed- src
- libcore/iter/adapters
- test/ui/iterators
2 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1815 | 1815 | | |
1816 | 1816 | | |
1817 | 1817 | | |
1818 | | - | |
1819 | | - | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
1820 | 1826 | | |
1821 | 1827 | | |
1822 | 1828 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments