-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Closed as not planned
Copy link
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustC-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team
Description
struct S { f: u32 }
fn main() {
{ S { f: 42 } }.f; // rustc accepts, parser-lalr rejects
{ 42 } as i32; // rustc and parser-lalr reject
{ 42 } == 42; // rustc and parser-lalr reject
}
The grammar in src/grammar/parser-lalr.y should probably be relaxed to accept the first example.
AFAIK, Rust could allow the other two cases (and others), because there are no statements or expressions that begin with as
or ==
.
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustC-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language team