]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #95699 - SparkyPotato:master, r=dtolnay
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Wed, 6 Apr 2022 01:39:09 +0000 (03:39 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Apr 2022 01:39:09 +0000 (03:39 +0200)
commitb4527492b1630c18deb7206ec703d71a372da664
tree534d0958fe063b5ed0c5cd3e700f380100066775
parentacdba55b5371f1f64912d42c98edb5149d5e67dc
parent83f659b4bb2212037ec62028b1979ec31d956fdd
Rollup merge of #95699 - SparkyPotato:master, r=dtolnay

fix: Vec leak when capacity is 0

When `RawVec::with_capacity_in` is called with capacity 0, an allocation of size 0 is allocated.
However, `<RawVec as Drop>::drop` doesn't deallocate, since it only checks if capacity was 0. Fixed by not allocating when capacity is 0.