Skip to content

Commit

Permalink
Add relevant test
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFire13 committed Mar 5, 2021
1 parent 2371914 commit c1bfb9a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions library/core/tests/iter/adapters/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,26 @@ fn test_issue_82282() {
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);
}

0 comments on commit c1bfb9a

Please sign in to comment.