Files
rust/library/core/src/iter
Jonathan Brouwer fb03f8462c Rollup merge of #159963 - Lfan-ke:feature/step-by-fused-iterator, r=jhpratt,dtolnay
core: implement FusedIterator for StepBy

Implements the accepted ACP rust-lang/libs-team#757.

`StepBy` yields no more items once its underlying iterator is exhausted, so it is fused whenever the underlying iterator is fused. `StepBy` was added in 1.28.0, just after the batch of `FusedIterator` impls stabilized in 1.26.0 (`Map`, `Skip`, `Take`, `Enumerate`, ...), so it was left out.

```rust
impl<I: FusedIterator> FusedIterator for StepBy<I> {}
```

This is insta-stable, matching the sibling adapter impls, so it needs a libs-api FCP.

Motivation from the ACP: crates with traits refined on top of `FusedIterator` (e.g. `range-set-blaze`'s `SortedStarts`) cannot cover `StepBy` today, even though it would always be valid.

A `test_step_by_fused` regression test is added.
2026-08-14 23:55:05 +02:00
..
2026-08-12 19:11:35 +00:00
…
…