Rollup merge of #119231 - aDotInTheVoid:PatKind-struct-bool-docs, r=compiler-errors
Clairify `ast::PatKind::Struct` presese of `..` by using an enum instead of a bool
The bool is mainly used for when a `..` is present, but it is also set on recovery to avoid errors. The doc comment not describes both of these cases.
See cee794ee98/compiler/rustc_parse/src/parser/pat.rs (L890-L897)
for the only place this is constructed.
r? ``@compiler-errors``
This commit is contained in:
commit
bdc4480914
7 changed files with 30 additions and 15 deletions
|
@ -491,7 +491,7 @@ impl<'a> ExtCtxt<'a> {
|
|||
path: ast::Path,
|
||||
field_pats: ThinVec<ast::PatField>,
|
||||
) -> P<ast::Pat> {
|
||||
self.pat(span, PatKind::Struct(None, path, field_pats, false))
|
||||
self.pat(span, PatKind::Struct(None, path, field_pats, ast::PatFieldsRest::None))
|
||||
}
|
||||
pub fn pat_tuple(&self, span: Span, pats: ThinVec<P<ast::Pat>>) -> P<ast::Pat> {
|
||||
self.pat(span, PatKind::Tuple(pats))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue