then_branch: ExprId,
else_branch: Option<ExprId>,
},
+ Let {
+ pat: PatId,
+ expr: ExprId,
+ },
Block {
id: BlockId,
statements: Box<[Statement]>,
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct MatchArm {
pub pat: PatId,
- pub guard: Option<MatchGuard>,
+ pub guard: Option<ExprId>,
pub expr: ExprId,
}
-#[derive(Debug, Clone, Eq, PartialEq)]
-pub enum MatchGuard {
- If { expr: ExprId },
-
- IfLet { pat: PatId, expr: ExprId },
-}
-
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct RecordLitField {
pub name: Name,
f(else_branch);
}
}
+ Expr::Let { expr, .. } => {
+ f(*expr);
+ }
Expr::Block { statements, tail, .. } => {
for stmt in statements.iter() {
match stmt {