The grammar situation in general is quite poor at the moment, the language is basically defined by the parser. There is a plan to make things better (GitHub issue) and provide a reference grammar, but it is far from completion.
I don’t know about grammar checking infra in the repo, but I guess it should start with a proper grammar definition, and there isn’t one at the moment.
Currently available options are:
- https://doc.rust-lang.org/grammar.html — very incomplete
- https://github.com/rust-lang/rust/blob/master/src/grammar/parser-lalr.y — not maintained (has some removed features, don’t have some recent features), and a bit difficult to read imo.
- https://github.com/jorendorff/rust-grammar — don’t know much about this one.
- https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs — the only real definition of syntax. It is quite readable though (better than parser-lalr.y for me). I use it as a reference for
- https://github.com/intellij-rust/intellij-rust/blob/master/src/main/kotlin/org/rust/lang/core/grammar/rust.bnf — I think this is the only grammar like thing which is more or less complete, but its very unreadable because of the IntelliJ specific stuff.