Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/expr.rs')
| -rw-r--r-- | crates/hir_def/src/expr.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/hir_def/src/expr.rs b/crates/hir_def/src/expr.rs index 6534f970ee..4dca823888 100644 --- a/crates/hir_def/src/expr.rs +++ b/crates/hir_def/src/expr.rs @@ -59,6 +59,10 @@ pub enum Expr { then_branch: ExprId, else_branch: Option<ExprId>, }, + Let { + pat: PatId, + expr: ExprId, + }, Block { id: BlockId, statements: Box<[Statement]>, @@ -189,18 +193,11 @@ pub enum Array { #[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, pub expr: ExprId, @@ -232,6 +229,9 @@ impl Expr { f(else_branch); } } + Expr::Let { expr, .. } => { + f(*expr); + } Expr::Block { statements, tail, .. } => { for stmt in statements.iter() { match stmt { |