Remove Self: Sized from Iterator::nth #38134

Merged
merged 1 commit into from Dec 7, 2016

Projects

None yet

5 participants

@bluss
Contributor
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.

@aturon aturon was assigned by rust-highfive Dec 2, 2016
@rust-highfive
Collaborator

r? @aturon

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

@bluss bluss core: 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.
bc3618e
@aturon
Contributor
aturon commented Dec 2, 2016

Thanks!

@bors: r+

@aturon
Contributor
aturon commented Dec 2, 2016

@bors: r+

@bors
Contributor
bors commented Dec 2, 2016

📌 Commit bc3618e has been approved by aturon

@Stebalien
Contributor

Note: prior discussion here #25471 (comment)

/cc @alexcrichton

@bluss
Contributor
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
Contributor
bors commented Dec 7, 2016

⌛️ Testing commit bc3618e with merge 3fef221...

@bors bors added a commit that referenced this pull request Dec 7, 2016
@bors bors Auto merge of #38134 - bluss:iter-nth, r=aturon
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.
3fef221
@bors bors merged commit bc3618e into rust-lang:master Dec 7, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@bluss bluss deleted the bluss:iter-nth branch Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment