Skip to content

macros: simplify tt matchers #39403

Closed
@jseyfried

Description

@jseyfried

Ideally, tt matches either a single token or delimited sequence (e.g. { arbitrary tokens }).
However, the following compiles today:

macro_rules! m { ($t:tt) => {} }
m!($x);
m!($(x)*);
m!($x:ident);

We want to avoid leaking details of macro_rules! syntax into the semantics of tt, at least for macros 2.0.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions