|
10 | 10 |
|
11 | 11 | // The Rust abstract syntax tree. |
12 | 12 |
|
13 | | -pub use self::Pat_::*; |
14 | 13 | pub use self::StructFieldKind::*; |
15 | 14 | pub use self::TyParamBound::*; |
16 | 15 | pub use self::UnsafeSource::*; |
@@ -521,7 +520,7 @@ pub struct Block { |
521 | 520 | #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)] |
522 | 521 | pub struct Pat { |
523 | 522 | pub id: NodeId, |
524 | | - pub node: Pat_, |
| 523 | + pub node: PatKind, |
525 | 524 | pub span: Span, |
526 | 525 | } |
527 | 526 |
|
@@ -552,47 +551,47 @@ pub enum BindingMode { |
552 | 551 | } |
553 | 552 |
|
554 | 553 | #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] |
555 | | -pub enum Pat_ { |
| 554 | +pub enum PatKind { |
556 | 555 | /// Represents a wildcard pattern (`_`) |
557 | | - PatWild, |
| 556 | + Wild, |
558 | 557 |
|
559 | | - /// A PatIdent may either be a new bound variable, |
| 558 | + /// A PatKind::Ident may either be a new bound variable, |
560 | 559 | /// or a nullary enum (in which case the third field |
561 | 560 | /// is None). |
562 | 561 | /// |
563 | 562 | /// In the nullary enum case, the parser can't determine |
564 | 563 | /// which it is. The resolver determines this, and |
565 | 564 | /// records this pattern's NodeId in an auxiliary |
566 | 565 | /// set (of "PatIdents that refer to nullary enums") |
567 | | - PatIdent(BindingMode, SpannedIdent, Option<P<Pat>>), |
| 566 | + Ident(BindingMode, SpannedIdent, Option<P<Pat>>), |
568 | 567 |
|
569 | 568 | /// "None" means a `Variant(..)` pattern where we don't bind the fields to names. |
570 | | - PatEnum(Path, Option<Vec<P<Pat>>>), |
| 569 | + Enum(Path, Option<Vec<P<Pat>>>), |
571 | 570 |
|
572 | 571 | /// An associated const named using the qualified path `<T>::CONST` or |
573 | 572 | /// `<T as Trait>::CONST`. Associated consts from inherent impls can be |
574 | 573 | /// referred to as simply `T::CONST`, in which case they will end up as |
575 | | - /// PatEnum, and the resolver will have to sort that out. |
576 | | - PatQPath(QSelf, Path), |
| 574 | + /// PatKind::Enum, and the resolver will have to sort that out. |
| 575 | + QPath(QSelf, Path), |
577 | 576 |
|
578 | 577 | /// Destructuring of a struct, e.g. `Foo {x, y, ..}` |
579 | 578 | /// The `bool` is `true` in the presence of a `..` |
580 | | - PatStruct(Path, Vec<Spanned<FieldPat>>, bool), |
| 579 | + Struct(Path, Vec<Spanned<FieldPat>>, bool), |
581 | 580 | /// A tuple pattern `(a, b)` |
582 | | - PatTup(Vec<P<Pat>>), |
| 581 | + Tup(Vec<P<Pat>>), |
583 | 582 | /// A `box` pattern |
584 | | - PatBox(P<Pat>), |
| 583 | + Box(P<Pat>), |
585 | 584 | /// A reference pattern, e.g. `&mut (a, b)` |
586 | | - PatRegion(P<Pat>, Mutability), |
| 585 | + Ref(P<Pat>, Mutability), |
587 | 586 | /// A literal |
588 | | - PatLit(P<Expr>), |
| 587 | + Lit(P<Expr>), |
589 | 588 | /// A range pattern, e.g. `1...2` |
590 | | - PatRange(P<Expr>, P<Expr>), |
| 589 | + Range(P<Expr>, P<Expr>), |
591 | 590 | /// `[a, b, ..i, y, z]` is represented as: |
592 | | - /// `PatVec(box [a, b], Some(i), box [y, z])` |
593 | | - PatVec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>), |
| 591 | + /// `PatKind::Vec(box [a, b], Some(i), box [y, z])` |
| 592 | + Vec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>), |
594 | 593 | /// A macro pattern; pre-expansion |
595 | | - PatMac(Mac), |
| 594 | + Mac(Mac), |
596 | 595 | } |
597 | 596 |
|
598 | 597 | #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] |
@@ -1609,7 +1608,7 @@ impl Arg { |
1609 | 1608 | }), |
1610 | 1609 | pat: P(Pat { |
1611 | 1610 | id: DUMMY_NODE_ID, |
1612 | | - node: PatIdent(BindingMode::ByValue(mutability), path, None), |
| 1611 | + node: PatKind::Ident(BindingMode::ByValue(mutability), path, None), |
1613 | 1612 | span: span |
1614 | 1613 | }), |
1615 | 1614 | id: DUMMY_NODE_ID |
|
0 commit comments