Skip to content

Reserve necessary space for params in generics_of - #80208

Merged
bors merged 1 commit into
rust-lang:masterfrom
bugadani:generics-of-alloc
Dec 22, 2020
Merged

Reserve necessary space for params in generics_of#80208
bors merged 1 commit into
rust-lang:masterfrom
bugadani:generics-of-alloc

Conversation

@bugadani

Copy link
Copy Markdown
Contributor

Always reserve space for the exact number of generic parameters we need in generics_of. As far as I can see, the default is 0/4 elements based on has_self, and the vector grows on after that.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @matthewjasper

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2020
@matthewjasper

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Dec 20, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 01d7f87 has been approved by matthewjasper

@borsbors 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 Dec 20, 2020
@jyn514

Copy link
Copy Markdown
Member

This could have a perf impact, are you sure it should be rolled up?

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Dec 21, 2020
…ewjasper
Reserve necessary space for params in generics_of
Always reserve space for the exact number of generic parameters we need in generics_of. As far as I can see, the default is 0/4 elements based on has_self, and the vector grows on after that.
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors rollup=never

@bors

bors commented Dec 22, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 01d7f87 with merge 9310aff...

@bors

bors commented Dec 22, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: matthewjasper
Pushing 9310aff to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Dec 22, 2020
@bors
bors merged commit 9310aff into rust-lang:masterDec 22, 2020
@rustbotrustbot added this to the 1.50.0 milestone Dec 22, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@bugadani@rust-highfive@matthewjasper@bors@jyn514@Mark-Simulacrum@rustbot