From 5e3f291195b580580be7ce5622f54ebca75fb9f0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Sep 2019 21:23:19 +0300 Subject: fix hir for new block syntax --- crates/ra_hir/src/code_model/src.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src/code_model') diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index e5bae16ab..7c9454c0b 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs @@ -119,10 +119,10 @@ where expr_id: crate::expr::ExprId, ) -> Option> { let source_map = self.body_source_map(db); - let expr_syntax = source_map.expr_syntax(expr_id)?; + let expr_syntax = source_map.expr_syntax(expr_id)?.a()?; let source = self.source(db); - let node = expr_syntax.to_node(&source.ast.syntax()); - ast::Expr::cast(node).map(|ast| Source { file_id: source.file_id, ast }) + let ast = expr_syntax.to_node(&source.ast.syntax()); + Some(Source { file_id: source.file_id, ast }) } } -- cgit v1.2.3