Skip to content

vec!() does not handle a trailing comma #12910

Closed
@lifthrasiir

Description

@lifthrasiir
fn main() {
    println!("{}", vec!(1,2,3,).len());
}

gives the following error unlike the old syntax (~[1,2,3,]):

t.rs:2:30: 2:31 error: unexpected end of macro invocation
t.rs:2     println!("{}", vec!(1,2,3,).len());
                                    ^

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