Skip to content

Macro invocations allow type parameters in the path #28558

Closed
@Manishearth

Description

@Manishearth

vec::<T,U,V,W::X::Y<Z>>![1,2,3,4]; is valid syntax and compiles to a regular vector.

This is because macros use Paths, not Idents as their names. Multi-segment paths are disallowed, but the path can have type parameters.

We can move macros to Idents, however this would not be backwards compatible since anyone using vec::<T>![1,2] would get a syntax error (even though the original syntax is meaningless). It's still a bug, so perhaps we can get away with this breaking change.

Thoughts?

cc @eddyb @alexcrichton

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-grammarArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions