提交 c1bfb9a7 编写于 作者: G Giacomo Stevanato

Add relevant test

上级 2371914a
......@@ -265,3 +265,26 @@ fn overflowed_zip(arr: &[i32]) -> impl Iterator<Item = (i32, &())> {
panic!();
}
}
#[test]
fn test_issue_82291() {
use std::cell::Cell;
let mut v1 = [()];
let v2 = [()];
let called = Cell::new(0);
let mut zip = v1
.iter_mut()
.map(|r| {
called.set(called.get() + 1);
r
})
.zip(&v2);
zip.next_back();
assert_eq!(called.get(), 1);
zip.next();
assert_eq!(called.get(), 1);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册