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:
structS{f:i32}fnmain(){let s = S{f:42};
s asS.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.)
It's not clear to me whether this code is valid syntax. It looks wrong, so maybe it ought to be rejected.
rustcrejects it, butparser-lalraccepts it:It looks like it should parse as
s as (S.f), and that wouldn't parse.parser-lalrparses it as(s as S).f(To test the LALR grammar, build the check-grammar target, then run grammar/parser-lalr -v.)