Hello! (Not sure in this qualifies as a 'topic' on here, but...)
I noticed that this struct https://github.com/rust-lang/rust/blob/master/src/librustc_ast/ast.rs#L515 is undocumented. Would it makes to describe this as "A pattern is a syntax element for matching against the structure of types"? This is close to how the the book describes patterns https://doc.rust-lang.org/book/ch18-00-patterns.html. Does it make sense in this context?
Or is it too high-level? :thinking:
I think that's too oriented at teaching Rust the language and less at documenting the compiler
e.g., I think it's not our job to explain what a pattern is
though I do think giving examples from Rust code is good
maybe something like
// AST for a match pattern. Patterns appear in match statements and some other contexts, such as
let P = ..., the P is pattern
Thanks, @nikomatsakis ! I'll submit a PR along these lines.