diff options
Diffstat (limited to 'crates/ra_hir_def/src/body/lower.rs')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 331736cb2..be1eaa523 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -429,10 +429,19 @@ where | |||
429 | let index = self.collect_expr_opt(e.index()); | 429 | let index = self.collect_expr_opt(e.index()); |
430 | self.alloc_expr(Expr::Index { base, index }, syntax_ptr) | 430 | self.alloc_expr(Expr::Index { base, index }, syntax_ptr) |
431 | } | 431 | } |
432 | ast::Expr::RangeExpr(e) => { | ||
433 | let lhs = e.start().map(|lhs| self.collect_expr(lhs)); | ||
434 | let rhs = e.end().map(|rhs| self.collect_expr(rhs)); | ||
435 | match e.op_kind() { | ||
436 | Some(range_type) => { | ||
437 | self.alloc_expr(Expr::Range { lhs, rhs, range_type }, syntax_ptr) | ||
438 | } | ||
439 | None => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
440 | } | ||
441 | } | ||
432 | 442 | ||
433 | // FIXME implement HIR for these: | 443 | // FIXME implement HIR for these: |
434 | ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | 444 | ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), |
435 | ast::Expr::RangeExpr(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
436 | ast::Expr::MacroCall(e) => match self.expander.enter_expand(self.db, e) { | 445 | ast::Expr::MacroCall(e) => match self.expander.enter_expand(self.db, e) { |
437 | Some((mark, expansion)) => { | 446 | Some((mark, expansion)) => { |
438 | let id = self.collect_expr(expansion); | 447 | let id = self.collect_expr(expansion); |