Closed as not planned
Closed as not planned
Description
It's not clear to me whether this code is valid syntax. It looks wrong, so maybe it ought to be rejected. rustc
rejects it, but parser-lalr
accepts it:
struct S { f: i32 }
fn main() {
let s = S { f: 42 };
s as S.f;
}
It looks like it should parse as s as (S.f)
, and that wouldn't parse. parser-lalr
parses it as (s as S).f
test.rs:4:11: 4:12 error: expected one of `!`, `(`, `::`, `;`, `<`, `}`, or an operator, found `.`
test.rs:4 s as S.f;
^
(To test the LALR grammar, build the check-grammar target, then run grammar/parser-lalr -v.)