We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66a2606 commit 8b9ac4dCopy full SHA for 8b9ac4d
library/core/tests/iter/adapters/zip.rs
@@ -245,3 +245,23 @@ fn test_double_ended_zip() {
245
assert_eq!(it.next_back(), Some((3, 3)));
246
assert_eq!(it.next(), None);
247
}
248
+
249
+#[test]
250
+fn test_issue_82282() {
251
+ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
252
+ static UNIT_EMPTY_ARR: [(); 0] = [];
253
254
+ let mapped = arr.into_iter().map(|i| *i);
255
+ let mut zipped = mapped.zip(UNIT_EMPTY_ARR.iter());
256
+ zipped.next();
257
+ zipped
258
+ }
259
260
+ let arr = [1, 2, 3];
261
+ let zip = overflowed_zip(&arr).zip(overflowed_zip(&arr));
262
263
+ assert_eq!(zip.size_hint(), (0, Some(0)));
264
+ for _ in zip {
265
+ panic!();
266
267
+}
0 commit comments