about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-06-23 22:29:52 +0000
committerbors <bors@rust-lang.org>2022-06-23 22:29:52 +0000
commitf7189846be257cf59a2ea27216173438386007f9 (patch)
tree48828f12768b9c58461fcc06d2c48dc37ea0b39d /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs
parent2cc5211584c7d813860706bafa49ee70c38a1f7b (diff)
parent5a70d88af5ff96897b7ddfd01d13e039a86c775c (diff)
downloadrust-f7189846be257cf59a2ea27216173438386007f9.tar.gz
rust-f7189846be257cf59a2ea27216173438386007f9.zip
Auto merge of #8953 - DevAccentor:slow_vector_initialization, r=Manishearth
add vec.capacity() to [`slow_vec_initialization`] detection

fix #8800

for example
```rust
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
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs')
0 files changed, 0 insertions, 0 deletions