Skip to content

Conversation

@nnethercote
Copy link
Contributor

There are numerous unnecessary into_iter calls.

Also add a comment explaining why the code looks like this, because it's non-obvious at first glance.

r? @saethlin

There are numerous unnecessary `into_iter` calls.

Also add a comment explaining why the code looks like this, because it's
non-obvious at first glance.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 23, 2025
@saethlin
Copy link
Member

Huh. Neat.

I agree that the iterator chaining thing is subtle, I was very confused by the type the first time I worked on this module.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 23, 2025

📌 Commit 3d95159 has been approved by saethlin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 23, 2025
bors added a commit that referenced this pull request Oct 24, 2025
Rollup of 5 pull requests

Successful merges:

 - #148016 (Revert constification of `Borrow` and `Deref for Cow` due to inference failure)
 - #148021 ([rustdoc] Simplify module rendering and HTML tags handling)
 - #148039 (Add myself to the review rotation)
 - #148042 (test(frontmatter): Cover spaces between infostring parts)
 - #148054 (Streamline iterator chaining when computing successors.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7141a0f into rust-lang:master Oct 24, 2025
11 checks passed
rust-timer added a commit that referenced this pull request Oct 24, 2025
Rollup merge of #148054 - nnethercote:chain, r=saethlin

Streamline iterator chaining when computing successors.

There are numerous unnecessary `into_iter` calls.

Also add a comment explaining why the code looks like this, because it's non-obvious at first glance.

r? `@saethlin`
@rustbot rustbot added this to the 1.92.0 milestone Oct 24, 2025
@Zalathar
Copy link
Contributor

Bors hasn't noticed that this was merged.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 24, 2025
@Zalathar
Copy link
Contributor

This appears to have somehow caused a bunch of perf regressions: #148059 (comment)

Assuming the regression is real and not some weird noise, the only possible explanation I can think of is that this PR does slightly change the shape of the iterator, and maybe that's enough to cause measurably worse codegen despite giving equivalent results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants