Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#83791 - the8472:relax-zip-side-effect-guara…
…ntee, r=dtolnay Weaken guarantee around advancing underlying iterators in zip The current guarantee (introduced in rust-lang#52279) is too strong as it prevents adapters from exploiting knowledge about the iterator length and using counted loops for example because they would stop calling `next()` before it ever returned `None`. Additionally several nested zip iterators already fail to uphold this. This does not yet remove any of the specialization code that tries (and sometimes fails) to uphold the guarantee for `next()` because removing it would also affect `next_back()` in more surprising ways. The intent is to be able to remove for example this branch https://github.com/rust-lang/rust/blob/36bcf4069717b9dff90270d13b53a3b130329960/library/core/src/iter/adapters/zip.rs#L234-L243 or this test https://github.com/rust-lang/rust/blob/36bcf4069717b9dff90270d13b53a3b130329960/library/core/tests/iter/adapters/zip.rs#L177-L188 Solves rust-lang#82303 by declaring it a non-issue.
- Loading branch information