@@ -816,6 +816,9 @@ pub struct MacroDef {
816816 pub legacy : bool ,
817817}
818818
819+ /// A block of statements `{ .. }`, which may have a label (in this case the
820+ /// `targeted_by_break` field will be `true`) and may be `unsafe` by means of
821+ /// the `rules` being anything but `DefaultBlock`.
819822#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
820823pub struct Block {
821824 /// Statements in a block.
@@ -1178,6 +1181,7 @@ impl fmt::Debug for Stmt {
11781181 }
11791182}
11801183
1184+ /// The contents of a statement.
11811185#[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
11821186pub enum StmtKind {
11831187 /// A local (`let`) binding.
@@ -1208,21 +1212,28 @@ impl StmtKind {
12081212#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
12091213pub struct Local {
12101214 pub pat : P < Pat > ,
1215+ /// Type annotation, if any (otherwise the type will be inferred).
12111216 pub ty : Option < P < Ty > > ,
12121217 /// Initializer expression to set the value, if any.
12131218 pub init : Option < P < Expr > > ,
12141219 pub hir_id : HirId ,
12151220 pub span : Span ,
12161221 pub attrs : ThinVec < Attribute > ,
1222+ /// Can be `ForLoopDesugar` if the `let` statement is part of a `for` loop
1223+ /// desugaring. Otherwise will be `Normal`.
12171224 pub source : LocalSource ,
12181225}
12191226
1220- /// Represents a single arm of a `match` expression.
1227+ /// Represents a single arm of a `match` expression, e.g.
1228+ /// `<pats> (if <guard>) => <body>`.
12211229#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
12221230pub struct Arm {
12231231 pub attrs : HirVec < Attribute > ,
1232+ /// Multiple patterns can be combined with `|`
12241233 pub pats : HirVec < P < Pat > > ,
1234+ /// Optional guard clause.
12251235 pub guard : Option < Guard > ,
1236+ /// The action to take if this arm matches.
12261237 pub body : P < Expr > ,
12271238}
12281239
0 commit comments