Skip to content

vec![] should support the [value, ..repeat] syntax #15587

Closed
@Kimundi

Description

@Kimundi

Rust now supports [] in macro invocations, with a driving use case being able to write vec![0, 0, 0] as analogy to the fixed sized vector syntax [0, 0, 0].

However, there is no analogy to the [0, ..n] repeat syntax for it: vec![0, ..n] does not work.

For it to be added, vec! would either need to become a procedural macro, or something like rust-lang/rfcs#88 needs to be implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions