Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for core::iter::zip #83574

Closed
2 of 3 tasks
cuviper opened this issue Mar 27, 2021 · 9 comments · Fixed by #91881
Closed
2 of 3 tasks

Tracking Issue for core::iter::zip #83574

cuviper opened this issue Mar 27, 2021 · 9 comments · Fixed by #91881
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@cuviper
Copy link
Member

cuviper commented Mar 27, 2021

Feature gate: #![feature(iter_zip)]

This is a tracking issue for core::iter::zip, a function that combines two IntoIterator arguments into a Zip iterator.

Public API

// core::iter
pub fn zip<A, B>(a: A, b: B) -> Zip<A::IntoIter, B::IntoIter>
where
    A: IntoIterator,
    B: IntoIterator,

Steps / History

Unresolved Questions

  • None yet.
@cuviper cuviper added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Mar 27, 2021
@joshtriplett
Copy link
Member

This has been around for a while, and I haven't seen any issues reported with it. Shall we stabilize this?

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Nov 22, 2021

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Nov 22, 2021
@scottmcm
Copy link
Member

Ah, the reason it's worth having instead of encouraging Iterator::zip(a, b) is that it has different bounds?

@BurntSushi
Copy link
Member

The current docs seem to indicate that this is equivalent to Iterator::zip by referencing its docs, but doesn't call out why the free function zip exists. What is the motivation of stabilizing this?

@jakeweary
Copy link

The motivation is explained in #82917.

@rfcbot
Copy link

rfcbot commented Nov 30, 2021

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Nov 30, 2021
@rfcbot rfcbot added the finished-final-comment-period The final comment period is finished for this PR / Issue. label Dec 10, 2021
@rfcbot
Copy link

rfcbot commented Dec 10, 2021

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Dec 10, 2021
@scottmcm scottmcm linked a pull request Dec 14, 2021 that will close this issue
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 15, 2021
… r=scottmcm

Stabilize `iter::zip`

Hello all!

As the tracking issue (rust-lang#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue.

As the pull request that introduced the feature (rust-lang#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been
used in many places across the rust compiler and standard library since March without any issues.

For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Dec 16, 2021
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 17, 2021
… r=scottmcm

Stabilize `iter::zip`

Hello all!

As the tracking issue (rust-lang#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue.

As the pull request that introduced the feature (rust-lang#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been
used in many places across the rust compiler and standard library since March without any issues.

For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
@ibraheemdev
Copy link
Member

I realize that this has already merged, but it might have been nicer as a zip! macro that flattens nested tuples.

for (((a, b), c), d) in ia.zip(ib).zip(ic).zip(id) {
   // ...
}

for (a, b, c, d) in iter::zip!(ia, ib, ic, id) {
   // ...
}

@scottmcm
Copy link
Member

scottmcm commented Mar 5, 2022

@ibraheemdev that's available in https://docs.rs/itertools/latest/itertools/macro.izip.html if you'd like.

It's not clear whether core wants such macros. Like it waited for const generics before getting a bunch of array stuff, it might be waiting for variadic generics to let that be just zip(ia, ib, ic, id) eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants