@@ -555,28 +555,34 @@ pub enum PatKind {
555555 /// Represents a wildcard pattern (`_`)
556556 Wild ,
557557
558- /// A PatKind::Ident may either be a new bound variable,
559- /// or a nullary enum (in which case the third field
560- /// is None).
558+ /// A ` PatKind::Ident` may either be a new bound variable,
559+ /// or a unit struct/variant pattern, or a const pattern (in the last two cases
560+ /// the third field must be ` None` ).
561561 ///
562- /// In the nullary enum case, the parser can't determine
562+ /// In the unit or const pattern case, the parser can't determine
563563 /// which it is. The resolver determines this, and
564- /// records this pattern's NodeId in an auxiliary
565- /// set (of "PatIdents that refer to nullary enums")
564+ /// records this pattern's ` NodeId` in an auxiliary
565+ /// set (of "PatIdents that refer to unit patterns or constants").
566566 Ident ( BindingMode , SpannedIdent , Option < P < Pat > > ) ,
567567
568+ /// A struct or struct variant pattern, e.g. `Variant {x, y, ..}`.
569+ /// The `bool` is `true` in the presence of a `..`.
570+ Struct ( Path , Vec < Spanned < FieldPat > > , bool ) ,
571+
572+ /// A tuple struct/variant pattern `Variant(x, y, z)`.
568573 /// "None" means a `Variant(..)` pattern where we don't bind the fields to names.
569- Enum ( Path , Option < Vec < P < Pat > > > ) ,
574+ TupleStruct ( Path , Option < Vec < P < Pat > > > ) ,
575+
576+ /// A path pattern.
577+ /// Such pattern can be resolved to a unit struct/variant or a constant.
578+ Path ( Path ) ,
570579
571580 /// An associated const named using the qualified path `<T>::CONST` or
572581 /// `<T as Trait>::CONST`. Associated consts from inherent impls can be
573582 /// referred to as simply `T::CONST`, in which case they will end up as
574583 /// PatKind::Enum, and the resolver will have to sort that out.
575584 QPath ( QSelf , Path ) ,
576585
577- /// Destructuring of a struct, e.g. `Foo {x, y, ..}`
578- /// The `bool` is `true` in the presence of a `..`
579- Struct ( Path , Vec < Spanned < FieldPat > > , bool ) ,
580586 /// A tuple pattern `(a, b)`
581587 Tup ( Vec < P < Pat > > ) ,
582588 /// A `box` pattern
0 commit comments