about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-11-27 11:46:40 +0100
committerGitHub <noreply@github.com>2021-11-27 11:46:40 +0100
commit14ef447d1237a2534f3acc19a2f986b217ef274d (patch)
tree4704930421982bb95024ac595c411f054a3cea1d /compiler/rustc_mir_transform/src
parent84826fec957aa17b0e068775c1c5574f707d43b0 (diff)
parent2ff677dcbe2228323553447054d130a0c4585a91 (diff)
downloadrust-14ef447d1237a2534f3acc19a2f986b217ef274d.tar.gz
rust-14ef447d1237a2534f3acc19a2f986b217ef274d.zip
Rollup merge of #83791 - the8472:relax-zip-side-effect-guarantee, r=dtolnay
Weaken guarantee around advancing underlying iterators in zip

The current guarantee (introduced in #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 #82303 by declaring it a non-issue.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
0 files changed, 0 insertions, 0 deletions