Implement FusedIterator for core::iter::StepBy
Rust Internals [Unofficial]
March 12, 2026
mineichen:
Do i miss something?
I don't think so. This impl seems appropriate. The only questions I'd have are:
- Should the
implbe unconditional? - Should the correctness of the
implbedependentindependent on the correctness of the underlyingIterator'simpl?
The answer to both of those is "no" in my opinion. The API docs explain the behavior of StepBy pretty clearly, so answering "yes" to either of the two questions would constitute a change to how StepBy is implemented which in turn would be a breaking change based on its API documentation. There are also already FusedIterator impls in core whose correctness is dependent on the correctness of the underlying Iterator's impl.
Discussion in the ATmosphere