Documentation for Vec::leak doesn't ackowledge dropping of excess capacity #79240
Labels
A-collections
Area: `std::collections`
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
When using one of the functions to convert a
Vec<T>
to a[T]
, excess capacity of the vector is dropped, leaving the slice with only the elements which have been initialised in memory.This behaviour is acknowledged in the documentation for
Vec::into_boxed_slice
, but not in the documentation forVec::leak
.The text was updated successfully, but these errors were encountered: