Skip to content

Tracking Issue for Vec::split_at_spare_mut #81944

Description

@KodrAus

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

  • 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 of Vec::spare_capacity_mut can be replaced with Vec::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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions