aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r--crates/ra_hir/src/expr.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index 4e8dc0c54..663338844 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -182,7 +182,7 @@ pub enum Expr {
182 }, 182 },
183 UnaryOp { 183 UnaryOp {
184 expr: ExprId, 184 expr: ExprId,
185 op: Option<UnaryOp>, 185 op: UnaryOp,
186 }, 186 },
187 BinaryOp { 187 BinaryOp {
188 lhs: ExprId, 188 lhs: ExprId,
@@ -612,8 +612,11 @@ impl ExprCollector {
612 } 612 }
613 ast::ExprKind::PrefixExpr(e) => { 613 ast::ExprKind::PrefixExpr(e) => {
614 let expr = self.collect_expr_opt(e.expr()); 614 let expr = self.collect_expr_opt(e.expr());
615 let op = e.op(); 615 if let Some(op) = e.op() {
616 self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr) 616 self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr)
617 } else {
618 self.alloc_expr(Expr::Missing, syntax_ptr)
619 }
617 } 620 }
618 ast::ExprKind::LambdaExpr(e) => { 621 ast::ExprKind::LambdaExpr(e) => {
619 let mut args = Vec::new(); 622 let mut args = Vec::new();