Skip to content

inline next() on &mut Iterator impl #89774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 13, 2021
Merged

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Oct 11, 2021

In #87431 I found that (&mut range).fold doesn't optimize well because the default impl for for fold on &mut Iterator doesn't inline next. In that particular case it was worked around by using try_fold which takes a &mut self instead of self.

Let's see if this can be fixed more broadly.

@rust-highfive
Copy link
Contributor

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2021
@the8472
Copy link
Member Author

the8472 commented Oct 11, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 11, 2021
@bors
Copy link
Collaborator

bors commented Oct 11, 2021

⌛ Trying commit a398b6b with merge eb61fdba9cf2f7d6351ac9958b767cff681af8fc...

@bors
Copy link
Collaborator

bors commented Oct 11, 2021

☀️ Try build successful - checks-actions
Build commit: eb61fdba9cf2f7d6351ac9958b767cff681af8fc (eb61fdba9cf2f7d6351ac9958b767cff681af8fc)

@rust-timer
Copy link
Collaborator

Queued eb61fdba9cf2f7d6351ac9958b767cff681af8fc with parent 6ae8912, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (eb61fdba9cf2f7d6351ac9958b767cff681af8fc): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 11, 2021
@the8472
Copy link
Member Author

the8472 commented Oct 11, 2021

This now addresses the FIXME from #87431 since #[inline] works just as well as the original workaround, without disturbing perf.

@the8472 the8472 marked this pull request as ready for review October 11, 2021 21:41
@the8472 the8472 added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 11, 2021
@m-ou-se
Copy link
Member

m-ou-se commented Oct 12, 2021

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

📌 Commit f1c588f has been approved by m-ou-se

@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 12, 2021
@bors
Copy link
Collaborator

bors commented Oct 12, 2021

⌛ Testing commit f1c588f with merge 989cc355cd00e5b9b66575f8c30a9176d10dc2b5...

@bors
Copy link
Collaborator

bors commented Oct 12, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 12, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@the8472
Copy link
Member Author

the8472 commented Oct 12, 2021

That may have been due to sccache invalidation caused by the github runner upgrade. Let's wait and see how the next PR in the queue fares.

@the8472
Copy link
Member Author

the8472 commented Oct 12, 2021

@bors retry

@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 12, 2021
@bors
Copy link
Collaborator

bors commented Oct 12, 2021

⌛ Testing commit f1c588f with merge ef4b306...

@bors
Copy link
Collaborator

bors commented Oct 13, 2021

☀️ Test successful - checks-actions
Approved by: m-ou-se
Pushing ef4b306 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 13, 2021
@bors bors merged commit ef4b306 into rust-lang:master Oct 13, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 13, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ef4b306): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants