Skip to content

Documentation for Vec::leak doesn't ackowledge dropping of excess capacity #79240

Closed
@TheOnlyMrCat

Description

@TheOnlyMrCat

When using one of the functions to convert a Vec<T> to a [T], excess capacity of the vector is dropped, leaving the slice with only the elements which have been initialised in memory.

This behaviour is acknowledged in the documentation for Vec::into_boxed_slice, but not in the documentation for Vec::leak.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libs-apiRelevant to the library API 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