Skip to content

remove an unnecessary allocation from char_iter.collect::<String>() - #166729

Open
the8472 wants to merge 1 commit into
rust-lang:mainfrom
the8472:fix-string-append-allocation-behavior
Open

the8472 wants to merge 1 commit into
rust-lang:mainfrom
the8472:fix-string-append-allocation-behavior

Conversation

@the8472

@the8472 the8472 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

fixes #166566

Confirmed by running the reproducer locally.

@rustbot rustbot added A-str Area: `str` and `String` 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 Nov 28, 2026
@rustbot

rustbot commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

r? @joboet

rustbot has assigned @joboet.
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 38 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, clarfonthey, joboet

@the8472 the8472 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 28, 2026
@the8472

the8472 commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

Perhaps this will also resolve #159916 (comment)

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 28, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 28, 2026
…, r=<try>

remove an unnecessary allocation from char_iter.collect::<String>()
@rust-bors

rust-bors Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: b161381 (b1613814d8ac0132da56cf657b9adb547d339272)
Base parent: 6181cc4 (6181cc4f077f1a16ce605e297173b01c6ddff553)

@rust-timer

Copy link
Copy Markdown

Queued b161381 with parent 6181cc4, future comparison URL.
There is currently 1 preceding artifact in the queue.
It will probably take at least ~1.5 hours until the benchmark run finishes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-str Area: `str` and `String` beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.101 beta crater regression: collecting into a String can unnecessarily reallocate

4 participants