Skip to content

lib: specialize vec extend_with - #163757

Open
Paladynee wants to merge 1 commit into
rust-lang:mainfrom
Paladynee:lib/spec-vec-extend-with
Open

Paladynee wants to merge 1 commit into
rust-lang:mainfrom
Paladynee:lib/spec-vec-extend-with

Conversation

@Paladynee

@Paladynee Paladynee commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

specializes Vec::extend_with for T: TrivialClone, which in turn affects Vec::resize, alloc::vec::from_elem, and the vec![] macro.

perf: https://rust.godbolt.org/z/8P5M3fP9e

LLM's were not utilized for the making of this PR or the description.

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

rustbot commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

rustbot has assigned @clarfonthey.
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 Darksonn, JohnTitor, Mark-Simulacrum, clarfonthey

Comment thread library/alloc/src/vec/spec_extend_with.rs Outdated
@Paladynee
Paladynee force-pushed the lib/spec-vec-extend-with branch 2 times, most recently from 51a8b5e to 68b1987 Compare October 5, 2026 07:34
@Paladynee

Paladynee commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

added tests

couldn't figure out how to call private function extend_with, so called std::vec::from_elem instead.

@Paladynee
Paladynee force-pushed the lib/spec-vec-extend-with branch from 68b1987 to 65c8b13 Compare October 5, 2026 07:50

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

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.

3 participants