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

Remove Self: Sized from Iterator::nth #38134

Merged
merged 1 commit into from
Dec 7, 2016
Merged

Conversation

bluss
Copy link
Member

@bluss bluss commented Dec 2, 2016

It is an unnecessary restriction; nth neither needs self to be sized
nor needs to be exempted from the trait object.

It increases the utility of the nth method, because type specific
implementations are available through &mut I or through an iterator
trait object.

It is a backwards compatible change due to the special cases of the
where Self: Sized bound; it was already optional to include this bound
in Iterator implementations.

@rust-highfive
Copy link
Collaborator

r? @aturon

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

It is an unnecessary restriction; nth neither needs self to be sized
nor needs to be exempted from the trait object.

It increases the utility of the nth method, because type specific
implementations are available through `&mut I` or through an iterator
trait object.

It is a backwards compatible change due to the special cases of the
`where Self: Sized` bound; it was already optional to include this bound
in `Iterator` implementations.
@aturon
Copy link
Member

aturon commented Dec 2, 2016

Thanks!

@bors: r+

@aturon
Copy link
Member

aturon commented Dec 2, 2016

@bors: r+

@bors
Copy link
Contributor

bors commented Dec 2, 2016

📌 Commit bc3618e has been approved by aturon

@Stebalien
Copy link
Contributor

Note: prior discussion here #25471 (comment)

/cc @alexcrichton

@bluss
Copy link
Member Author

bluss commented Dec 4, 2016

Thanks for the link. nth is the only non-generic method left and the only that this can be applied to.

@bors
Copy link
Contributor

bors commented Dec 7, 2016

⌛ Testing commit bc3618e with merge 3fef221...

bors added a commit that referenced this pull request Dec 7, 2016
Remove Self: Sized from Iterator::nth

It is an unnecessary restriction; nth neither needs self to be sized
nor needs to be exempted from the trait object.

It increases the utility of the nth method, because type specific
implementations are available through `&mut I` or through an iterator
trait object.

It is a backwards compatible change due to the special cases of the
`where Self: Sized` bound; it was already optional to include this bound
in `Iterator` implementations.
@bors bors merged commit bc3618e into rust-lang:master Dec 7, 2016
@bluss bluss deleted the iter-nth branch December 7, 2016 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants