Skip to content

Removal of exact capacity guarantee for Vec::with_capacity() is a breaking change #99385

Closed

Description

@GoldsteinE

Link #95614
Cc @jmaargh

Location

https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.with_capacity

Summary

Latest stable guarantees that Vec::with_capacity() always allocates exact capacity (and this is indeed the case, since RawVec discards any extra allocated capacity). #96173 removes this guarantee. I believe this to be a breaking change requiring some further investigation.

Activity

  1. added
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    on Jul 17, 2022
  2. added a commit that references this issue on Feb 24, 2025
  3. added a commit that references this issue on Feb 25, 2025
  4. added 2 commits that reference this issue on Mar 11, 2025
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

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions