Implement FusedIterator for core::iter::StepBy
Rust Internals [Unofficial]
March 12, 2026
philomathic_life:
Should the correctness of the
implbe dependent on the correctness of the underlyingIterator'simpl?
I don't understand why you'd answer that question with "no". Did you accidentally write the opposite of what you meant (dependent vs independent)?
The naive implementation of StepBy is only fused if the underlying iterator is fused. If the underlying iterator is incorrectly claiming to be fused, StepBy's claim to be fused would be just as incorrect. Which is completely fine.
Attempting to work around by fusing in StepBy would hurt performance, change existing behaviour, and require specialization. So it's clearly not a sane option.
Discussion in the ATmosphere