Skip to content

Constify more Iterator and DoubleEndedIterator functions required for Range - #162734

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Randl:const-for-prereq
Sep 14, 2026
Merged

Constify more Iterator and DoubleEndedIterator functions required for Range#162734
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Randl:const-for-prereq

Conversation

@Randl

@Randl Randl commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Extracted from #156216
Consitfies functions required for const impl Iterator for Range.
r? clarfonthey

@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 Sep 13, 2026
Comment thread library/core/src/iter/traits/double_ended.rs Outdated
Comment thread library/core/src/iter/traits/iterator.rs Outdated
Comment thread library/core/src/iter/traits/iterator.rs Outdated
@clarfonthey

Copy link
Copy Markdown
Contributor

Left a few comments about const-hacks, once you make those I'll run perf on this PR just as a safeguard. Otherwise, minus the explicit stuff mentioned, LGTM.

@Randl

Randl commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

I've removed the const hacks

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 13, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 13, 2026
Constify more Iterator and DoubleEndedIterator functions required for Range
@rust-bors

rust-bors Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 634f40b (634f40b21cf0df62df28c5ac4e9e7f5f434990ac)
Base parent: 20d35a3 (20d35a3ae8f310f2a002e5f6e0bc583830010cd4)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (634f40b): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [0.6%, 5.7%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-3.0%, -1.6%] 3
All ❌✅ (primary) - - 0

Cycles

Results (primary -8.1%, secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
7.9% [7.9%, 7.9%] 1
Improvements ✅
(primary)
-8.1% [-8.1%, -8.1%] 1
Improvements ✅
(secondary)
-5.0% [-10.6%, -2.2%] 4
All ❌✅ (primary) -8.1% [-8.1%, -8.1%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 497.229s -> 495.175s (-0.41%)
Artifact size: 406.94 MiB -> 409.02 MiB (0.51%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 13, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

Looks like perf is expected consequences of constification, since it's under ctfe-stress-5.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 31922ed has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Rollup of 6 pull requests

Successful merges:

 - #162706 (Prefer exact derive imports over trait fallbacks)
 - #162732 (Fix unsound dealloc of reborrows from custom allocators)
 - #154113 (std::net: clamp multicast ttl value to u8 max.)
 - #161178 (lint ineffective #[unstable] annotations on re-exports)
 - #162717 (prevent ICE from `derive` on `repr(packed)` enum)
 - #162734 (Constify more Iterator and DoubleEndedIterator functions required for Range)
@rust-bors
rust-bors Bot merged commit 803c237 into rust-lang:main Sep 14, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 14, 2026
Rollup merge of #162734 - Randl:const-for-prereq, r=clarfonthey

Constify more Iterator and DoubleEndedIterator functions required for Range

Extracted from #156216
Consitfies functions required for `const impl Iterator for Range`.
r? clarfonthey
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (a4c4d95): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.8% [2.8%, 5.0%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-3.5%, -1.2%] 6
All ❌✅ (primary) - - 0

Cycles

Results (secondary 9.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
9.4% [2.8%, 15.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: missing data
Artifact size: 406.85 MiB -> 408.92 MiB (0.51%)

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

Labels

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.

4 participants