Uh oh!
There was an error while loading. Please reload this page.
Forward more Iterator methods - #43074
Conversation
rust-highfive
commented
Jul 5, 2017
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
arielb1
commented
Jul 11, 2017
Is anyone going to be reviewing this? ping @aturon. |
aturon
commented
Jul 11, 2017
@bors: r+ Thanks @SimonSapin! |
bors
commented
Jul 11, 2017
📌 Commit 758ddeb has been approved by |
bors
commented
Jul 12, 2017
🔒 Merge conflict |
These are overridden by slice::Iter
`position` could not be implemented because calling `rposition` on the inner iterator would require more trait bounds.
alexcrichton
commented
Jul 13, 2017
@bors: r=aturon |
bors
commented
Jul 13, 2017
📌 Commit 2007987 has been approved by |
Mark-Simulacrum
commented
Jul 14, 2017
@bors rollup |
Forward more Iterator methods This allows in more cases to take advantage of specific (possibly more optimized) impls of these methods, rather than the default one defined for all `Iterator`s. I also wanted to do this for `&mut I` and `Box<I>`, but that didn’t compile for two reasons: * To make the trait object-safe, generic methods (e.g. that take a closure parameter) have a `where Self: Sized` bound. But e.g. `Box<I>: Sized` does not imply `I: Sized`, and adding an additional bound in the impl is not allowed. Some for of specialization would be needed here. * With e.g. a `F: FnMut(Self::Item) -> bool` bound and a `type Item = I::Item` associated types, I got errors like `F does not implement FnMut(I::Item) -> bool`. This looks like a limitation in the trait resolution system not recognizing that `Self::Item == I::Item` or "propagating" that fact to `FnMut` bounds.
bors
commented
Jul 15, 2017
Rev::rposition counts from the wrong end Introduced in rust-lang#43074. cc @SimonSapin
Rev::rposition counts from the wrong end Introduced in rust-lang#43074. cc @SimonSapin
This allows in more cases to take advantage of specific (possibly more optimized) impls of these methods, rather than the default one defined for all
Iterators.I also wanted to do this for
&mut IandBox<I>, but that didn’t compile for two reasons:where Self: Sizedbound. But e.g.Box<I>: Sizeddoes not implyI: Sized, and adding an additional bound in the impl is not allowed. Some for of specialization would be needed here.F: FnMut(Self::Item) -> boolbound and atype Item = I::Itemassociated types, I got errors likeF does not implement FnMut(I::Item) -> bool. This looks like a limitation in the trait resolution system not recognizing thatSelf::Item == I::Itemor "propagating" that fact toFnMutbounds.