Skip to content

Tracking Issue for Vec::try_shrink_to* #152350

@BitSyndicate1

Description

@BitSyndicate1

Feature gate: #![feature(vec_fallible_shrink)]

This is a tracking issue for implementing fallible shrink methods on Vec so that they may be used in contexts without global OOM handling.

Public API

// alloc::vec

impl Vec {
    pub fn try_shrink_to(&mut self, min_capacity: usize) -> Result<(), TryReserveError>;
    pub fn try_shrink_to_fit(&mut self) -> Result<(), TryReserveError>;
}

Steps / History

Unresolved Questions

  • Should this use AllocError or TryReserveError?
  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions