Skip to content

Commit b9a05cc

Browse files
committed
---
yaml --- r: 191421 b: refs/heads/try c: b08d5ee h: refs/heads/master i: 191419: 54bf7e0 v: v3
1 parent 12ac537 commit b9a05cc

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: 1debe9d112010a23c76711f557ee6fdc4728f4ec
5+
refs/heads/try: b08d5eee6a1bb3aaf7385c84b255be964caff9d1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libsyntax/ast.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,13 @@ impl PartialEq for MetaItem_ {
535535

536536
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
537537
pub struct Block {
538+
/// Statements in a block
538539
pub stmts: Vec<P<Stmt>>,
540+
/// An expression at the end of the block
541+
/// without a semicolon, if any
539542
pub expr: Option<P<Expr>>,
540543
pub id: NodeId,
544+
/// Unsafety of the block
541545
pub rules: BlockCheckMode,
542546
pub span: Span,
543547
}
@@ -550,8 +554,14 @@ pub struct Pat {
550554
}
551555

552556
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
557+
/// A single field in a struct pattern
558+
///
559+
/// For patterns like `Foo {x, y, z}`, `pat` and `ident` point to the same identifier
560+
/// and `is_shorthand` is true.
553561
pub struct FieldPat {
562+
/// The identifier for the field
554563
pub ident: Ident,
564+
/// The pattern the field is destructured to
555565
pub pat: P<Pat>,
556566
pub is_shorthand: bool,
557567
}
@@ -588,15 +598,23 @@ pub enum Pat_ {
588598
/// "None" means a * pattern where we don't bind the fields to names.
589599
PatEnum(Path, Option<Vec<P<Pat>>>),
590600

601+
/// Destructuring of a struct, e.g. `Foo {x, y, ..}`
602+
/// The `bool` is `true` in the presence of a `..`
591603
PatStruct(Path, Vec<Spanned<FieldPat>>, bool),
604+
/// A tuple pattern (`a, b`)
592605
PatTup(Vec<P<Pat>>),
606+
/// A `box` pattern
593607
PatBox(P<Pat>),
594-
PatRegion(P<Pat>, Mutability), // reference pattern
608+
/// A reference pattern, e.g. `&mut (a, b)`
609+
PatRegion(P<Pat>, Mutability),
610+
/// A literal
595611
PatLit(P<Expr>),
612+
/// A range pattern, e.g. `[1...2]`
596613
PatRange(P<Expr>, P<Expr>),
597614
/// [a, b, ..i, y, z] is represented as:
598615
/// PatVec(box [a, b], Some(i), box [y, z])
599616
PatVec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>),
617+
/// A macro pattern; pre-expansion
600618
PatMac(Mac),
601619
}
602620

0 commit comments

Comments
 (0)