Skip to content

core: implement FusedIterator for StepBy - #159963

Open
Lfan-ke wants to merge 1 commit into
rust-lang:mainfrom
Lfan-ke:feature/step-by-fused-iterator
Open

core: implement FusedIterator for StepBy#159963
Lfan-ke wants to merge 1 commit into
rust-lang:mainfrom
Lfan-ke:feature/step-by-fused-iterator

Conversation

@Lfan-ke

@Lfan-ke Lfan-ke commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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.

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.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 26, 2026
@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from Darksonn, JohnTitor, Mark-Simulacrum, clarfonthey, jhpratt

Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
@Lfan-ke
Lfan-ke force-pushed the feature/step-by-fused-iterator branch from 741bdbd to 8cf58ce Compare July 26, 2026 12:30
@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jhpratt

jhpratt commented Jul 27, 2026

Copy link
Copy Markdown
Member

r=me with completed FCP. Nominating for that purpose.

@jhpratt jhpratt added I-libs-api-nominated Nominated for discussion during a libs-api team meeting. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 27, 2026
@rust-bors

rust-bors Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #160348) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

@jhpratt jhpratt added S-waiting-on-t-libs-api Status: Awaiting decision from T-libs-api and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-libs-api-nominated Nominated for discussion during a libs-api team meeting. S-waiting-on-t-libs-api Status: Awaiting decision from T-libs-api T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants