Skip to content

de-non_const Iterator trait methods#153708

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

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

Conversation

@Lars-Schumann
Copy link

#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
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

impl<I: Iterator<Item: IntoIterator>> Flatten<I> {
pub(in super::super) fn new(iter: I) -> Flatten<I> {
#[rustc_const_unstable(feature = "const_iter", issue = "92476")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this one need stability attrs but none of the other constructor functions do?

{
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
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 😅

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-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.

5 participants