Tracking Issue for Vec::split_at_spare_mut · Issue #81944 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
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]) {} }
Steps / History
- Implementation: Make Vec::split_at_spare_mut public #81687
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
- Should we consider changing the name?
split_at_spare_mut
doesn't seem like an intuitive name - Should we deprecate
Vec::spare_capacity_mut
? Any usecase ofVec::spare_capacity_mut
can be replaced withVec::split_at_spare_mut
(but not vise-versa):
edit:spare_capacity_mut
has been stabilised now in Stabilize vec_spare_capacity #93016 so deprecating it is probably not an option