Skip to content

std: Remove iter::ByRef and generalize impls #21907

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

Merged
merged 1 commit into from
Feb 4, 2015

Conversation

alexcrichton
Copy link
Member

This removes the ByRef iterator adaptor to stay in line with the changes to
std::io. The by_ref method instead just returns &mut Self.

This also removes the implementation of Iterator for &mut Iterator and instead
generalizes it to Iterator for &mut I where I: Iterator + ?Sized. The
Box<I> implementations were also updated.

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned huonw Feb 3, 2015
@rust-highfive
Copy link
Contributor

r? @huonw

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

@aturon
Copy link
Member

aturon commented Feb 3, 2015

@bors: r+ 309701f

@reem
Copy link
Contributor

reem commented Feb 3, 2015

Should be marked a breaking change, since ByRef was stable.

@aturon
Copy link
Member

aturon commented Feb 3, 2015

@bors: r-

@aturon
Copy link
Member

aturon commented Feb 3, 2015

@reem, good point. r=me with a commit message update.

This removes the `ByRef` iterator adaptor to stay in line with the changes to
`std::io`. The `by_ref` method instead just returns `&mut Self`.

This also removes the implementation of `Iterator for &mut Iterator` and instead
generalizes it to `Iterator for &mut I` where `I: Iterator + ?Sized`. The
`Box<I>` implementations were also updated.

This is a breaking change due to the removal of the `std::iter::ByRef` type. All
mentions of `ByRef<'a, T>` should be replaced with `&mut T` to migrate forward.

[breaking-change]
@alexcrichton
Copy link
Member Author

Gah thanks for the reminder @reem!

@bors r=aturon d30f225

@alexcrichton
Copy link
Member Author

@bors: rollup

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 4, 2015
This removes the `ByRef` iterator adaptor to stay in line with the changes to
`std::io`. The `by_ref` method instead just returns `&mut Self`.

This also removes the implementation of `Iterator for &mut Iterator` and instead
generalizes it to `Iterator for &mut I` where `I: Iterator + ?Sized`. The
`Box<I>` implementations were also updated.
@bors bors merged commit d30f225 into rust-lang:master Feb 4, 2015
@alexcrichton alexcrichton deleted the iter-by-ref branch February 4, 2015 18:04
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.

6 participants