aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/expr')
-rw-r--r--crates/ra_hir/src/expr/lower.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs
index 50ea429ea..b3a9a2e6b 100644
--- a/crates/ra_hir/src/expr/lower.rs
+++ b/crates/ra_hir/src/expr/lower.rs
@@ -16,7 +16,7 @@ use crate::{
16 path::GenericArgs, 16 path::GenericArgs,
17 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, 17 ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy},
18 type_ref::TypeRef, 18 type_ref::TypeRef,
19 DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver, 19 AstId, DefWithBody, Either, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, Resolver,
20 Source, 20 Source,
21}; 21};
22 22
@@ -458,15 +458,14 @@ where
458 ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), 458 ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr),
459 ast::Expr::RangeExpr(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), 459 ast::Expr::RangeExpr(_e) => self.alloc_expr(Expr::Missing, syntax_ptr),
460 ast::Expr::MacroCall(e) => { 460 ast::Expr::MacroCall(e) => {
461 let ast_id = self 461 let ast_id = AstId::new(
462 .db 462 self.current_file_id,
463 .ast_id_map(self.current_file_id) 463 self.db.ast_id_map(self.current_file_id).ast_id(&e),
464 .ast_id(&e) 464 );
465 .with_file_id(self.current_file_id);
466 465
467 if let Some(path) = e.path().and_then(|path| self.parse_path(path)) { 466 if let Some(path) = e.path().and_then(|path| self.parse_path(path)) {
468 if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) { 467 if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) {
469 let call_id = MacroCallLoc { def: def.id, ast_id }.id(self.db); 468 let call_id = self.db.intern_macro(MacroCallLoc { def: def.id, ast_id });
470 let file_id = call_id.as_file(MacroFileKind::Expr); 469 let file_id = call_id.as_file(MacroFileKind::Expr);
471 if let Some(node) = self.db.parse_or_expand(file_id) { 470 if let Some(node) = self.db.parse_or_expand(file_id) {
472 if let Some(expr) = ast::Expr::cast(node) { 471 if let Some(expr) = ast::Expr::cast(node) {