-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
1.35 -> 1.36 regression: && incorrectly considered to be unable to start expressions. #74233
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.P-highHigh priorityHigh 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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.
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.P-highHigh priorityHigh 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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.relnotesMarks issues that should be documented in the release notes of the next release.Marks issues that should be documented in the release notes of the next release.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This example compiles on 1.35 but not 1.36 or later:
(The example above was reduced from one involving
match ... {...} && false, found by @digama0)This regression was likely introduced by #60188, due to the definition of
can_continue_expr_unambiguously:rust/src/librustc_ast/util/parser.rs
Lines 209 to 232 in daecab3
That function lists all of the operators that can't start an expression, but only continue it.
LAnd(&&) is incorrectly included, as&&expris parsed the same as& &exprat the start of an expression.cc @estebank