Skip to content

de-non_const Iterator trait methods#153708

Closed
Lars-Schumann wants to merge 0 commit intorust-lang:mainfrom
Lars-Schumann:de-non_const-iterator-trait-methods
Closed

de-non_const Iterator trait methods#153708
Lars-Schumann wants to merge 0 commit intorust-lang:mainfrom
Lars-Schumann:de-non_const-iterator-trait-methods

Conversation

@Lars-Schumann
Copy link
Copy Markdown
Contributor

@Lars-Schumann Lars-Schumann commented Mar 11, 2026

View all comments

#92476

constifying Iterators methods that don't immediately or transitively need const closures or ugly hacks.

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 11, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 11, 2026

r? @scottmcm

rustbot has assigned @scottmcm.
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: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, scottmcm

@Lars-Schumann Lars-Schumann changed the title de-non_const Iterator trait methods de-non_const Iterator trait methods Mar 11, 2026
@Lars-Schumann Lars-Schumann force-pushed the de-non_const-iterator-trait-methods branch from 5e438b4 to 2960e3a Compare March 11, 2026 13:22
@oli-obk oli-obk assigned oli-obk and fee1-dead and unassigned scottmcm Mar 11, 2026
{
default fn spec_advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
for i in 0..n {
// FIXME(const-hack): this should be `for i in 0..n`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should figure that one out first 😅

Copy link
Copy Markdown
Contributor Author

@Lars-Schumann Lars-Schumann Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as const-hacks go, this is very tame, and I didn't want to make this pr too big by constifying the Range Iterator impl as well (if that's even possible right now)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, def don't do range iterators this in this one, I was wondering if we'd just delay on touching this one. But it is tame, and I do worry that by not doing progress here we end up in a deadlock somewhere with other iterator constifications.

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Mar 12, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 12, 2026

📌 Commit 2960e3a has been approved by oli-obk

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 Mar 12, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Mar 12, 2026
…r-trait-methods, r=oli-obk

de-non_const `Iterator` trait methods

rust-lang#92476

constifying Iterators methods that don't immediately or transitively need const closures or ugly hacks.
rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
Rollup of 11 pull requests

Successful merges:

 - #153726 (Add optional CI job to build the compiler with the parallel frontend)
 - #153763 (Don't add empty target features for target-cpu=native on macOS)
 - #153432 (Fix some comments about dataflow analysis.)
 - #153529 (Fix LegacyKeyValueFormat report from docker build: pr)
 - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`)
 - #153708 (de-non_const `Iterator` trait methods)
 - #153717 (unused_macro_rules switched used and unused comments)
 - #153736 (add test that an incomplete feature emits a warning)
 - #153748 (editorconfig: css uses tabs)
 - #153750 (rustc-dev-guide subtree update)
 - #153762 (actually make the is-fn test test what it says it tests)
@Zalathar
Copy link
Copy Markdown
Member

@bors try jobs=x86_64-rust-for-linux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…hods, r=<try>

de-non_const `Iterator` trait methods


try-job: x86_64-rust-for-linux
@Zalathar
Copy link
Copy Markdown
Member

On closer inspection the error mentions Iterator, so I’ll assume that this PR Is the most likely cause.

@bors r-

@rust-bors rust-bors bot 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 Mar 12, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 12, 2026

This pull request was unapproved.

This PR was contained in a rollup (#153767), which was unapproved.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
@bors try jobs=x86_64-rust-for-linux
#153767 (comment)

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…hods, r=<try>

de-non_const `Iterator` trait methods


try-job: x86_64-rust-for-linux
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 12, 2026

💔 Test for 4b830c9 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@Lars-Schumann Lars-Schumann force-pushed the de-non_const-iterator-trait-methods branch from 2960e3a to e141160 Compare March 29, 2026 23:25
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 29, 2026

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.

@Lars-Schumann Lars-Schumann marked this pull request as draft March 30, 2026 00:45
@Lars-Schumann
Copy link
Copy Markdown
Contributor Author

@bors try jobs=x86_64-rust-for-linux

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 30, 2026

@Lars-Schumann: 🔑 Insufficient privileges: not in try users

@Lars-Schumann Lars-Schumann force-pushed the de-non_const-iterator-trait-methods branch from e141160 to 42db04e Compare March 30, 2026 01:38
@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Mar 30, 2026

@bors try jobs=x86_64-rust-for-linux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 30, 2026
…hods, r=<try>

de-non_const `Iterator` trait methods


try-job: x86_64-rust-for-linux
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 30, 2026

💔 Test for ea2c265 failed: CI. Failed job:

@Zalathar
Copy link
Copy Markdown
Member

@bors try jobs=x86_64-rust-for-linux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 30, 2026
…hods, r=<try>

de-non_const `Iterator` trait methods


try-job: x86_64-rust-for-linux
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 30, 2026

💔 Test for f003781 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Lars-Schumann Lars-Schumann force-pushed the de-non_const-iterator-trait-methods branch from 42db04e to a25435b Compare April 2, 2026 19:16
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 6, 2026
…r, r=oli-obk

de-non_const some `Iterator` methods

rust-lang#92476

r? oli-obk

this is essentially just rust-lang#153708 again (which I accidentally closed...), but with the changes to `advance_by` omitted, since that seems to have caused the ICE.
rust-timer added a commit that referenced this pull request Apr 7, 2026
Rollup merge of #154729 - Lars-Schumann:de-non_const-iterator, r=oli-obk

de-non_const some `Iterator` methods

#92476

r? oli-obk

this is essentially just #153708 again (which I accidentally closed...), but with the changes to `advance_by` omitted, since that seems to have caused the ICE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

8 participants