[WIP] Implement FusedIterator#32999
Conversation
This trait can be used to avoid the overhead of a fuse wrapper (which is pretty high).
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
|
|
||
| #[inline] | ||
| fn next(&mut self) -> Option<<I as Iterator>::Item> { | ||
| default fn next(&mut self) -> Option<<I as Iterator>::Item> { |
There was a problem hiding this comment.
Unless I'm mistaken, that doesn't apply here (yet) because we don't have the lattice rule. That is, a specialized implementation would have to have the bound I: FusedIterator + Something and the implementation on FusedIterator isn't marked default. However, that's a good point. I'll make a note of this on the specialization issue.
|
I think the RFC link is to the wrong repo, should be rust-lang/rfcs#1581 |
|
@hexsel github auto-linking... thanks. |
|
@Stebalien Here's another way this could be done: https://play.rust-lang.org/?gist=1c74c425ab7f916b691053348b27cb61&version=nightly&backtrace=0. |
|
☔ The latest upstream changes (presumably #33079) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@apasel422 that certainly gets rid of the unnecessary |
|
Closing due to inactivity, but feel free to reopen once the RFC is accepted! |
Pending RFC rust-lang/rfcs#1581
Only implements FusedIterator for core.
/cc @bluss, @apasel422