Skip to content

add a map function on homogenous tuples - #160640

Open
bend-n wants to merge 1 commit into
rust-lang:mainfrom
bend-n:map_tuple
Open

add a map function on homogenous tuples#160640
bend-n wants to merge 1 commit into
rust-lang:mainfrom
bend-n:map_tuple

Conversation

@bend-n

@bend-n bend-n commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • I did not use an LLM to create a change in this PR.
  • I used an LLM to create a change in this PR, and I have explained below how it was used.

This adds a function to map homogenous tuples, up to length 12. I thought about maps of heterogenous tuples, for each set partition, however it's impossible.

Will tracking issue etc if good.

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

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

r? @nia-e

rustbot has assigned @nia-e.
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

@bend-n

bend-n commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot label +T-libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Aug 6, 2026
@nia-e

nia-e commented Aug 6, 2026

Copy link
Copy Markdown
Member

Thanks for the PR! Since this is a public-facing change it should go through ACP first, so if you could write up the motivation and design considerations in a relevant issue, that would be appreciated ^^

@nia-e nia-e added S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. needs-acp This change is blocked on the author creating an ACP. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
normalized stderr:
warning: a method with this name may be added to the standard library in the future
##[warning]  --> $DIR/nested-rpit-with-lifetimes.rs:46:26
   |
LL |     (TakeWhile1::new(),).map()
   |                          ^^^
   |
   = help: call with fully qualified syntax `Parser::map(...)` to keep using the current method
   = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
   = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
   = note: `#[warn(unstable_name_collisions)]` (part of `#[warn(future_incompatible)]`) on by default
help: add `#![feature(tuple_map)]` to the crate attributes to enable `core::tuple::<impl (T,)>::map`
   |
LL + #![feature(tuple_map)]
   |

warning: 1 warning emitted


---
To only update this specific test, also pass `--test-args type-alias-impl-trait/nested-rpit-with-lifetimes.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/type-alias-impl-trait/nested-rpit-with-lifetimes.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/type-alias-impl-trait/nested-rpit-with-lifetimes" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: a method with this name may be added to the standard library in the future
##[warning]  --> /checkout/tests/ui/type-alias-impl-trait/nested-rpit-with-lifetimes.rs:46:26
   |
LL |     (TakeWhile1::new(),).map()
   |                          ^^^
   |
   = help: call with fully qualified syntax `Parser::map(...)` to keep using the current method
   = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
   = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
   = note: `#[warn(unstable_name_collisions)]` (part of `#[warn(future_incompatible)]`) on by default
help: add `#![feature(tuple_map)]` to the crate attributes to enable `core::tuple::<impl (T,)>::map`
   |
LL + #![feature(tuple_map)]
   |

warning: 1 warning emitted
------------------------------------------

@nia-e nia-e removed the needs-acp This change is blocked on the author creating an ACP. label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API 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