Feature gate: #![feature(vec_split_at_spare)]
This is a tracking issue for Vec::split_at_spare_mut, which is used as the basis for a few methods internally to give a slice pointing to the initialized portion of the Vec and a slice of MaybeUninit pointing to the uninitialized portion.
Public API
impl<T, A: Allocator> Vec<T, A> {
pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) {}
}
Steps / History
Unresolved Questions
Feature gate:
#![feature(vec_split_at_spare)]This is a tracking issue for
Vec::split_at_spare_mut, which is used as the basis for a few methods internally to give a slice pointing to the initialized portion of theVecand a slice ofMaybeUninitpointing to the uninitialized portion.Public API
Steps / History
Unresolved Questions
split_at_spare_mutdoesn't seem like an intuitive nameVec::spare_capacity_mut? Any usecase ofVec::spare_capacity_mutcan be replaced withVec::split_at_spare_mut(but not vise-versa):edit:
spare_capacity_muthas been stabilised now in Stabilize vec_spare_capacity #93016 so deprecating it is probably not an option