diff options
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 78f6da5b8..288ca76c3 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -11,7 +11,7 @@ use ra_arena::Arena; | |||
11 | use ra_syntax::{ | 11 | use ra_syntax::{ |
12 | ast::{ | 12 | ast::{ |
13 | self, ArgListOwner, ArrayExprKind, LiteralKind, LoopBodyOwner, ModuleItemOwner, NameOwner, | 13 | self, ArgListOwner, ArrayExprKind, LiteralKind, LoopBodyOwner, ModuleItemOwner, NameOwner, |
14 | SlicePatComponents, TypeAscriptionOwner, | 14 | SlicePatComponents, |
15 | }, | 15 | }, |
16 | AstNode, AstPtr, | 16 | AstNode, AstPtr, |
17 | }; | 17 | }; |
@@ -466,8 +466,7 @@ impl ExprCollector<'_> { | |||
466 | if let Some(pl) = e.param_list() { | 466 | if let Some(pl) = e.param_list() { |
467 | for param in pl.params() { | 467 | for param in pl.params() { |
468 | let pat = self.collect_pat_opt(param.pat()); | 468 | let pat = self.collect_pat_opt(param.pat()); |
469 | let type_ref = | 469 | let type_ref = param.ty().map(|it| TypeRef::from_ast(&self.ctx(), it)); |
470 | param.ascribed_type().map(|it| TypeRef::from_ast(&self.ctx(), it)); | ||
471 | args.push(pat); | 470 | args.push(pat); |
472 | arg_types.push(type_ref); | 471 | arg_types.push(type_ref); |
473 | } | 472 | } |
@@ -607,8 +606,7 @@ impl ExprCollector<'_> { | |||
607 | .map(|s| match s { | 606 | .map(|s| match s { |
608 | ast::Stmt::LetStmt(stmt) => { | 607 | ast::Stmt::LetStmt(stmt) => { |
609 | let pat = self.collect_pat_opt(stmt.pat()); | 608 | let pat = self.collect_pat_opt(stmt.pat()); |
610 | let type_ref = | 609 | let type_ref = stmt.ty().map(|it| TypeRef::from_ast(&self.ctx(), it)); |
611 | stmt.ascribed_type().map(|it| TypeRef::from_ast(&self.ctx(), it)); | ||
612 | let initializer = stmt.initializer().map(|e| self.collect_expr(e)); | 610 | let initializer = stmt.initializer().map(|e| self.collect_expr(e)); |
613 | Statement::Let { pat, type_ref, initializer } | 611 | Statement::Let { pat, type_ref, initializer } |
614 | } | 612 | } |