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