-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Parsing inconsistencies (lambda, proc, return) #28784
Copy link
Copy link
Closed
Labels
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.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priorityT-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.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
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.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priorityT-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.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
I found more inconsistencies between
rustcandparser-lalr.I also noticed that Rust allows return expressions and lambda expressions to end with a struct literal, even when they're in a nostruct context. This seems inconsistent to me.
Lambdas (the two parsers disagree):
Return expressions (the two parsers agree):
The
rustcandparser-lalrparsers disagree about whether a barereturnexpression can be cast:Finally, I also noticed these two differences, which seem much less interesting to me. The grammar is probably just out-of-date or buggy:
lambda sometimes requires braces:
procis obsolete: