-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Macro invocations allow type parameters in the path #28558
Copy link
Copy link
Closed
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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, notIdents 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 usingvec::<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