Skip to content

Expand OptionFlatten's iterator methods#153097

Open
cuviper wants to merge 1 commit into
rust-lang:mainfrom
cuviper:expand-into_flat_iter
Open

Expand OptionFlatten's iterator methods#153097
cuviper wants to merge 1 commit into
rust-lang:mainfrom
cuviper:expand-into_flat_iter

Conversation

@cuviper

@cuviper cuviper commented Feb 25, 2026

Copy link
Copy Markdown
Member

If someone considers moving from option.into_iter().flatten() to
option.into_flat_iter(), it may be important for performance that this
iterator "specializes" methods the same way Flatten does, especially
forwarding to underlying fold, etc.

If someone considers moving from `option.into_iter().flatten()` to
`option.into_flat_iter()`, it may be important for performance that this
iterator "specializes" methods the same way `Flatten` does, especially
forwarding to underlying `fold`, etc.
@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 Feb 25, 2026
@rustbot

rustbot commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

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, joboet, scottmcm

@cuviper

cuviper commented Feb 25, 2026

Copy link
Copy Markdown
Member Author

PS: I think this could also implement the TrustedRandomAccess* traits and Iterator::__iterator_get_unchecked, but that's probably better considered as its own PR.

@scottmcm

Copy link
Copy Markdown
Member

r? @the8472

@rustbot rustbot assigned the8472 and unassigned scottmcm Apr 18, 2026
@cuviper

cuviper commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

@the8472 gentle ping, before I reroll...

@cuviper

cuviper commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@rustbot reroll

@rustbot rustbot assigned joboet and unassigned the8472 Jun 24, 2026
@joboet

joboet commented Jun 27, 2026

Copy link
Copy Markdown
Member

👍
@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8c92dc8 has been approved by joboet

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@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 Jun 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 27, 2026
…oboet

Expand `OptionFlatten`'s iterator methods

If someone considers moving from `option.into_iter().flatten()` to
`option.into_flat_iter()`, it may be important for performance that this
iterator "specializes" methods the same way `Flatten` does, especially
forwarding to underlying `fold`, etc.
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot pushed a commit that referenced this pull request Jun 27, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume")
 - #152225 (Add supertrait item shadowing for type-level path resolution)
 - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…)
 - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs)
 - #158501 (miri subtree update)
 - #153097 (Expand `OptionFlatten`'s iterator methods)
 - #158163 (Fix too-short variance slice in `variances_of` cycle recovery)
 - #158233 (Allow the unstable attribute on foreign type)
 - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.)
 - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 28, 2026
…oboet

Expand `OptionFlatten`'s iterator methods

If someone considers moving from `option.into_iter().flatten()` to
`option.into_flat_iter()`, it may be important for performance that this
iterator "specializes" methods the same way `Flatten` does, especially
forwarding to underlying `fold`, etc.
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.

5 participants