Skip to content

Commit 66a2606

Browse files
committed
Increment self.len in specialized ZipImpl to avoid underflow in size_hint
1 parent 939b143 commit 66a2606

File tree

1 file changed

+1
-0
lines changed
  • library/core/src/iter/adapters

1 file changed

+1
-0
lines changed

library/core/src/iter/adapters/zip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ where
200200
} else if A::MAY_HAVE_SIDE_EFFECT && self.index < self.a.size() {
201201
let i = self.index;
202202
self.index += 1;
203+
self.len += 1;
203204
// match the base implementation's potential side effects
204205
// SAFETY: we just checked that `i` < `self.a.len()`
205206
unsafe {

0 commit comments

Comments
 (0)