Skip to content

Constify Extend and FromIterator - #161500

Open
Randl wants to merge 4 commits into
rust-lang:mainfrom
Randl:iter-collect-constify
Open

Constify Extend and FromIterator#161500
Randl wants to merge 4 commits into
rust-lang:mainfrom
Randl:iter-collect-constify

Conversation

@Randl

@Randl Randl commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This is part of an attempt to fully constify Iterator. Specifically, I'm extracting the changes from the local branch that contains more or less minimal Iterator constification.

@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 Aug 22, 2026
@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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 JohnTitor, Mark-Simulacrum, clarfonthey, nia-e

@rust-log-analyzer

This comment has been minimized.

@Randl
Randl force-pushed the iter-collect-constify branch from fdf0b5e to e613e35 Compare August 22, 2026 10:55
@rust-bors

This comment has been minimized.

@Randl
Randl force-pushed the iter-collect-constify branch from e613e35 to 751b284 Compare September 7, 2026 04:40
@rustbot

rustbot commented Sep 7, 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.

Comment thread library/core/src/iter/traits/collect.rs Outdated

@JohnTitor JohnTitor Sep 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should also be constified, right?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is? It's inside const trait.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Though the current doesn't allow to call iter.into_iter() which is less usable. I think we should also make a change like extend(), no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, you mean const impl? Yeah, makes sense

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added the same bounds and constified impl for tuples.

@rust-log-analyzer

This comment has been minimized.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants