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

Implement Clone for std::vec::IntoIter #31704

Merged
merged 1 commit into from Feb 22, 2016

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Feb 16, 2016

No description provided.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@aturon
Copy link
Member

aturon commented Feb 16, 2016

@tbu- Thanks for the PR! Would you mind saying a bit about the motivation for this change?

cc @rust-lang/libs, we've been somewhat shy about adding APIs to iterators, and I'm not sure we've discussed the case of a trait impl like this.

@tbu-
Copy link
Contributor Author

tbu- commented Feb 16, 2016

I just saw this IRC message today and wondered why IntoIter does not implement Clone. If the general policy of implementing Clone where possible does not apply to iterators, feel free to close this pull request.

@alexcrichton
Copy link
Member

I believe that Clone is implemented lots of places on iterators, at least all of the adaptors have it derived. Additionally I also believe that lots of the slice/string iterators implement Clone.

Basically, sounds good to me!

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 16, 2016
@@ -1633,6 +1634,15 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> ExactSizeIterator for IntoIter<T> {}

#[stable(feature = "vec_into_iter_clone", since = "1.7.0")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 1.8.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I get a definitive statement for this? Should it be 1.8.0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.8.0, yes. That's the current nightly, slated to become beta next week.

@tbu-
Copy link
Contributor Author

tbu- commented Feb 17, 2016

OK, it's now 1.8.0.

@aturon
Copy link
Member

aturon commented Feb 22, 2016

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Feb 22, 2016

📌 Commit 8fd7469 has been approved by aturon

@bors
Copy link
Contributor

bors commented Feb 22, 2016

⌛ Testing commit 8fd7469 with merge c8fc481...

@bors bors merged commit 8fd7469 into rust-lang:master Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants