@@ -815,6 +815,9 @@ pub struct MacroDef {
815
815
pub legacy : bool ,
816
816
}
817
817
818
+ /// A block of statements `{ .. }`, which may have a label (in this case the
819
+ /// `targeted_by_break` field will be `true`) and may be `unsafe` by means of
820
+ /// the `rules` being anything but `DefaultBlock`.
818
821
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
819
822
pub struct Block {
820
823
/// Statements in a block.
@@ -1177,6 +1180,7 @@ impl fmt::Debug for Stmt {
1177
1180
}
1178
1181
}
1179
1182
1183
+ /// The contents of a statement.
1180
1184
#[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
1181
1185
pub enum StmtKind {
1182
1186
/// A local (`let`) binding.
@@ -1207,21 +1211,28 @@ impl StmtKind {
1207
1211
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1208
1212
pub struct Local {
1209
1213
pub pat : P < Pat > ,
1214
+ /// Type annotation, if any (otherwise the type will be inferred).
1210
1215
pub ty : Option < P < Ty > > ,
1211
1216
/// Initializer expression to set the value, if any.
1212
1217
pub init : Option < P < Expr > > ,
1213
1218
pub hir_id : HirId ,
1214
1219
pub span : Span ,
1215
1220
pub attrs : ThinVec < Attribute > ,
1221
+ /// Can be `ForLoopDesugar` if the `let` statement is part of a `for` loop
1222
+ /// desugaring. Otherwise will be `Normal`.
1216
1223
pub source : LocalSource ,
1217
1224
}
1218
1225
1219
- /// Represents a single arm of a `match` expression.
1226
+ /// Represents a single arm of a `match` expression, e.g.
1227
+ /// `<pats> (if <guard>) => <body>`.
1220
1228
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable ) ]
1221
1229
pub struct Arm {
1222
1230
pub attrs : HirVec < Attribute > ,
1231
+ /// Multiple patterns can be combined with `|`
1223
1232
pub pats : HirVec < P < Pat > > ,
1233
+ /// Optional guard clause.
1224
1234
pub guard : Option < Guard > ,
1235
+ /// The expression the arm evaluates to if this arm matches.
1225
1236
pub body : P < Expr > ,
1226
1237
}
1227
1238
0 commit comments