]> git.lizzy.rs Git - rust.git/commitdiff
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)
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.


Trivial merge