Skip to content

Tracking issue for std::iter::repeat_with #48169

New issue

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

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

Already on GitHub? # to your account

Closed
Centril opened this issue Feb 12, 2018 · 11 comments
Closed

Tracking issue for std::iter::repeat_with #48169

Centril opened this issue Feb 12, 2018 · 11 comments
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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

@Centril
Copy link
Contributor

Centril commented Feb 12, 2018

This is the tracking issue for std::iter::repeat_with.
Currently in nightly, PR = #48156.

@Centril Centril added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC labels Feb 12, 2018
Centril added a commit to Centril/rust that referenced this issue Feb 12, 2018
@alexcrichton alexcrichton added the B-unstable Blocker: Implemented in the nightly compiler and unstable. label Feb 12, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 17, 2018
…th, r=kennytm

Fix spelling in core::iter::repeat_with: s/not/note

Fixes spelling error in rust-lang#48156 (comment).
Tracking issue: rust-lang#48169
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 18, 2018
…th, r=kennytm

Fix spelling in core::iter::repeat_with: s/not/note

Fixes spelling error in rust-lang#48156 (comment).
Tracking issue: rust-lang#48169
@Centril
Copy link
Contributor Author

Centril commented May 3, 2018

@SimonSapin Would stabilizing this be appropriate now?

@SimonSapin
Copy link
Contributor

The iterator_repeat_with feature covers these APIs in std::iter:

pub fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F> { /*…*/ }
pub struct RepeatWith<F> { /*…*/ }
impl<A, F: FnMut() -> A> Iterator for RepeatWith<F> { type Item = A; /* … */ }
impl<A, F: FnMut() -> A> DoubleEndedIterator for RepeatWith<F> { /*…*/ }
impl<A, F: FnMut() -> A> FusedIterator for RepeatWith<F> {}
unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {}

They’ve been in Nightly since February 15 and seem fine to me to stabilize.

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented May 3, 2018

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

Concerns:

Once a majority of reviewers approve (and none object), 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 May 3, 2018
@dtolnay
Copy link
Member

dtolnay commented May 4, 2018

@rfcbot concern DEI

The DoubleEndedIterator impl is somewhat surprising. I see this was brought up in #48156 (review) as well. While this has been in nightly has anyone observed use cases that benefit from having the DoubleEndedIterator impl?

@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 May 4, 2018
@Centril
Copy link
Contributor Author

Centril commented May 5, 2018

@dtolnay I haven't; DEI for RepeatWith doesn't seem useful on its own; and given
repeat_with(|| ..).zip(my_dei).rev() you can reorder as repeat_with(|| ..).zip(my_dei.rev()). This also applies to .chain(..). However, I think forcing the user to re-order might not be such a good thing from an ergonomics perspective. But... We can always get rid of the DEI impl now and re-add it if anyone asks for it.

@dtolnay
Copy link
Member

dtolnay commented May 5, 2018

I would accept this without a DoubleEndedIterator impl and then follow up when someone can explain their concrete use case for it.

@Centril
Copy link
Contributor Author

Centril commented May 6, 2018

@dtolnay Fair enough, sounds like a plan 👍.

@dtolnay
Copy link
Member

dtolnay commented May 6, 2018

@rfcbot resolved DEI

@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 May 6, 2018
@Kimundi
Copy link
Member

Kimundi commented May 16, 2018

Removing the DEI impl seems like the best course of action, yeah.

@rfcbot
Copy link
Collaborator

rfcbot commented May 16, 2018

🔔 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 May 16, 2018
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 26, 2018
@rfcbot
Copy link
Collaborator

rfcbot commented May 26, 2018

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

tmccombs added a commit to tmccombs/rust that referenced this issue Jun 2, 2018
bors added a commit that referenced this issue Jun 10, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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

No branches or pull requests

6 participants