Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vec.capacity() to [slow_vec_initialization] detection #8953

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

DevAccentor
Copy link
Contributor

fix #8800

for example

let mut vec1 = Vec::with_capacity(len);
vec1.resize(vec1.capacity(), 0);

let mut vec2 = Vec::with_capacity(len);
vec2.extend(repeat(0).take(vec2.capacity()));

will trigger the lint


changelog: add vec.capacity() to [slow_vec_initialization] detection

@rust-highfive
Copy link

r? @Manishearth

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 5, 2022
@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Contributor

bors commented Jun 23, 2022

📌 Commit 5a70d88 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Jun 23, 2022

⌛ Testing commit 5a70d88 with merge f718984...

@bors
Copy link
Contributor

bors commented Jun 23, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing f718984 to master...

@bors bors merged commit f718984 into rust-lang:master Jun 23, 2022
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

slow_vector_initialization should catch capacity call
4 participants