aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/body
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 8d4b8b0f0..b02de5d67 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -482,14 +482,16 @@ impl ExprCollector<'_> {
482 self.collect_block_items(&block); 482 self.collect_block_items(&block);
483 let statements = block 483 let statements = block
484 .statements() 484 .statements()
485 .map(|s| match s { 485 .filter_map(|s| match s {
486 ast::Stmt::LetStmt(stmt) => { 486 ast::Stmt::LetStmt(stmt) => {
487 let pat = self.collect_pat_opt(stmt.pat()); 487 let pat = self.collect_pat_opt(stmt.pat());
488 let type_ref = stmt.ascribed_type().map(TypeRef::from_ast); 488 let type_ref = stmt.ascribed_type().map(TypeRef::from_ast);
489 let initializer = stmt.initializer().map(|e| self.collect_expr(e)); 489 let initializer = stmt.initializer().map(|e| self.collect_expr(e));
490 Statement::Let { pat, type_ref, initializer } 490 Some(Statement::Let { pat, type_ref, initializer })
491 }
492 ast::Stmt::ExprStmt(stmt) => {
493 Some(Statement::Expr(self.collect_expr_opt(stmt.expr())))
491 } 494 }
492 ast::Stmt::ExprStmt(stmt) => Statement::Expr(self.collect_expr_opt(stmt.expr())),
493 }) 495 })
494 .collect(); 496 .collect();
495 let tail = block.expr().map(|e| self.collect_expr(e)); 497 let tail = block.expr().map(|e| self.collect_expr(e));
@@ -541,6 +543,7 @@ impl ExprCollector<'_> {
541 let ast_id = self.expander.ast_id(&def); 543 let ast_id = self.expander.ast_id(&def);
542 (TraitLoc { container, ast_id }.intern(self.db).into(), def.name()) 544 (TraitLoc { container, ast_id }.intern(self.db).into(), def.name())
543 } 545 }
546 ast::ModuleItem::ExternBlock(_) => continue, // FIXME: collect from extern blocks
544 ast::ModuleItem::ImplDef(_) 547 ast::ModuleItem::ImplDef(_)
545 | ast::ModuleItem::UseItem(_) 548 | ast::ModuleItem::UseItem(_)
546 | ast::ModuleItem::ExternCrateItem(_) 549 | ast::ModuleItem::ExternCrateItem(_)