Skip to content

Confusing wording in docs for slice::as_ptr/as_mut_ptr #37334

@crumblingstatue

Description

@crumblingstatue

Modifying the slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

I believe this is trying to refer to manipulating the data structure (e.g. Vec) that owns the memory the slice is borrowing, but modifying the slice data through a slice can never cause reallocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    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