dtolnay / quote

Rust quasi-quoting
Apache License 2.0
1.32k stars 90 forks source link

Recognize underscore token to avoid slow path #198

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

It turns out _ is one of very few things still hitting the parser-based slow path after the recent optimizations for literals and lifetimes. Although _ is considered an Ident by the proc macro API, it does not match macro_rules's $:ident matcher and must be treated separately.