Skip to content

Use .map.collect to aggregate in .to_ty of tuples#152265

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lapla-cogito:tytuple_agg
Feb 7, 2026
Merged

Use .map.collect to aggregate in .to_ty of tuples#152265
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lapla-cogito:tytuple_agg

Conversation

@lapla-cogito
Copy link
Contributor

@lapla-cogito lapla-cogito commented Feb 7, 2026

Since #48994 might have been resolved, we can address the FIXME.

@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. labels Feb 7, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 7, 2026

r? @mati865

rustbot has assigned @mati865.
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: compiler, parser
  • compiler, parser expanded to 22 candidates
  • Random selection from 12 candidates

@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

According to #53019 the current code was motivated by performance, so let's double-check; things are probably fine nowadays.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 7, 2026
Use `.collect.map` to aggregate in `.to_ty` of tuples
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 7, 2026
@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

(Also I was very confused by the issue number in this PR's description, but it was just a typo and I updated it to the actual issue number from the FIXME.)

EDIT: Actually the “fix” cited in the description is also bogus, because it applies to the typoed PR number and appears to have nothing to do with this FIXME. I'll remove that too.

@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

r? me

@rustbot rustbot assigned Zalathar and unassigned mati865 Feb 7, 2026
@lapla-cogito
Copy link
Contributor Author

lapla-cogito commented Feb 7, 2026

This PR doesn't address the issue mentioned in the updated description. The Span-related issue from my original description was fixed in 50924 and this FIXME was added in b68b396. This makes me question whether performance measurements are actually necessary.

@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

The code change in this PR tries to address a // FIXME(#48994) comment:

However, the original description of this PR cited this seemingly-unrelated issue instead:

Notice the similarity between 48994 and 48944.

@lapla-cogito
Copy link
Contributor Author

Ah my bad! Sorry for the mistake. Anyway I also think this won't hurt performance.

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 7, 2026

☀️ Try build successful (CI)
Build commit: e85694f (e85694f3b539b8d4c85cb59b7e92c5880d159bcc, parent: c58d9f9f82ead734d73d99a64e910718f5f464d3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e85694f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.1%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -4.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.9% [-4.9%, -4.9%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 4.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 475.659s -> 475.091s (-0.12%)
Artifact size: 398.00 MiB -> 397.96 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 7, 2026
@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

Oh I just noticed, is .collect.map in the commit message a mistake? I think it should be .map.collect instead.

@lapla-cogito
Copy link
Contributor Author

Thanks, fixed. It seems I can't change the PR title myself - is there any way to do this?

@Zalathar Zalathar changed the title Use .collect.map to aggregate in .to_ty of tuples Use .map.collect to aggregate in .to_ty of tuples Feb 7, 2026
@Zalathar
Copy link
Member

Zalathar commented Feb 7, 2026

Since there was no measurable perf difference, not even in stress tests, it should be safe to merge this nice little improvement.

Thanks for the fix!

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 7, 2026

📌 Commit b5cd820 has been approved by Zalathar

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 Feb 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 7, 2026
Use `.map.collect` to aggregate in `.to_ty` of tuples

Since rust-lang#48994 might have been resolved, we can address the FIXME.
rust-bors bot pushed a commit that referenced this pull request Feb 7, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #146900 (Add avr_target_feature)
 - #150949 (Port symbol mangler attrs)
 - #152252 (Convert diagnostic style checks)
 - #152265 (Use `.map.collect` to aggregate in `.to_ty` of tuples)
@rust-bors rust-bors bot merged commit 5e476ba into rust-lang:main Feb 7, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 7, 2026
Rollup merge of #152265 - lapla-cogito:tytuple_agg, r=Zalathar

Use `.map.collect` to aggregate in `.to_ty` of tuples

Since #48994 might have been resolved, we can address the FIXME.
@rustbot rustbot added this to the 1.95.0 milestone Feb 7, 2026
@lapla-cogito lapla-cogito deleted the tytuple_agg branch February 7, 2026 12:06
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-compiler Relevant to the compiler 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