-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustc_parser incorrectly parses groups with Delimiter::None #67062
Copy link
Copy link
Open
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Such groups can currently be created by proc macros.
Reproduction, proc macro crate:
User crate:
This is not a huge issue right now because proc macros have no reasons to created
Delimiter::Nonedelimiters themselves (but they can still get them from input and return them if they return their input partially or fully, see the example below).However, this will became a huge issue when interpolated tokens like
$e: exprmigrate from AST pieces to token streams, because in the token stream model they are represented exactly like groups withDelimiter::Nonedelimiters (proc macros already see them in this way).