Skip to content

vec![Vec::with_capacity(x); n] has unintuitive behaviour. #11537

Closed
@agentsim

Description

@agentsim

What it does

Warns the user when that for n > 1 only the last of the Vec created by the macro will actually have the requested capacity.

Advantage

Alerts the user to some likely unintended behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions