Skip to content

Make safety constraints for grow and shrink more strict #70

Closed
rust-lang/rust
#75621
@TimDiekmann

Description

@TimDiekmann

Currently, it requires, that the new size must be greater/smaller or equal to the current size. This is because the trait also supports ZSTs, as growing an array of ZSTs will still result in a size of zero. I propose to restrict this clause to

new_size must be strictly greater(smaller) than layout.size() or both must be zero

Let's discuss/vote which constraint makes more sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions