Skip to content

Rewrite FlatMapInPlace.#155582

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:overhaul-flat_map_in_place
Apr 21, 2026
Merged

Rewrite FlatMapInPlace.#155582
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:overhaul-flat_map_in_place

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

Replace the hacky macro with a generic function and a new FlatMapInPlaceVec trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it suggested the generic function + trait idea. I implemented the idea entirely by hand.

r? @chenyukang

Replace the hacky macro with a generic function and a new
`FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it
suggested the generic function + trait idea. I implemented the idea
entirely by hand.
@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 Apr 21, 2026
@chenyukang
Copy link
Copy Markdown
Member

@bors r=chenyukang

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit 21cd762 has been approved by chenyukang

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 Apr 21, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 21, 2026
…lace, r=chenyukang

Rewrite `FlatMapInPlace`.

Replace the hacky macro with a generic function and a new `FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it suggested the generic function + trait idea. I implemented the idea entirely by hand.

r? @chenyukang
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 21, 2026
…lace, r=chenyukang

Rewrite `FlatMapInPlace`.

Replace the hacky macro with a generic function and a new `FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it suggested the generic function + trait idea. I implemented the idea entirely by hand.

r? @chenyukang
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 21, 2026
…lace, r=chenyukang

Rewrite `FlatMapInPlace`.

Replace the hacky macro with a generic function and a new `FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it suggested the generic function + trait idea. I implemented the idea entirely by hand.

r? @chenyukang
rust-bors Bot pushed a commit that referenced this pull request Apr 21, 2026
Rollup of 6 pull requests

Successful merges:

 - #155028 (tests: add whitespace tests for vertical tab behavior)
 - #155582 (Rewrite `FlatMapInPlace`.)
 - #151194 (Fix wrong suggestion for returning async closure)
 - #154377 (Fix `#[expect(dead_code)]` liveness propagation)
 - #155572 (Move diagnostic attribute target checks from check_attr)
 - #155586 (Ensure we don't feed owners from ast lowering if we ever make that query tracked)
@rust-bors rust-bors Bot merged commit eb2c80d into rust-lang:main Apr 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 21, 2026
@nnethercote nnethercote deleted the overhaul-flat_map_in_place branch April 21, 2026 22:23
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@rust-timer build 995964a

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (995964a): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@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.5% [0.3%, 0.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (secondary -4.3%)

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.3% [-4.3%, -4.3%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 492.256s -> 492.451s (0.04%)
Artifact size: 394.33 MiB -> 394.31 MiB (-0.00%)

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