diff options
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 1ea8ce249..5c291421a 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | use hir_expand::{ | 3 | use hir_expand::{ |
4 | either::Either, | 4 | either::Either, |
5 | hygiene::Hygiene, | ||
6 | name::{self, AsName, Name}, | 5 | name::{self, AsName, Name}, |
7 | AstId, MacroCallLoc, MacroFileKind, | 6 | AstId, MacroCallLoc, MacroFileKind, |
8 | }; | 7 | }; |
@@ -447,10 +446,9 @@ where | |||
447 | if let Some(node) = self.db.parse_or_expand(file_id) { | 446 | if let Some(node) = self.db.parse_or_expand(file_id) { |
448 | if let Some(expr) = ast::Expr::cast(node) { | 447 | if let Some(expr) = ast::Expr::cast(node) { |
449 | log::debug!("macro expansion {:#?}", expr.syntax()); | 448 | log::debug!("macro expansion {:#?}", expr.syntax()); |
450 | let old_file_id = | 449 | let mark = self.expander.enter(self.db, file_id); |
451 | std::mem::replace(&mut self.expander.current_file_id, file_id); | ||
452 | let id = self.collect_expr(expr); | 450 | let id = self.collect_expr(expr); |
453 | self.expander.current_file_id = old_file_id; | 451 | self.expander.exit(self.db, mark); |
454 | return id; | 452 | return id; |
455 | } | 453 | } |
456 | } | 454 | } |
@@ -572,8 +570,7 @@ where | |||
572 | } | 570 | } |
573 | 571 | ||
574 | fn parse_path(&mut self, path: ast::Path) -> Option<Path> { | 572 | fn parse_path(&mut self, path: ast::Path) -> Option<Path> { |
575 | let hygiene = Hygiene::new(self.db, self.expander.current_file_id); | 573 | Path::from_src(path, &self.expander.hygiene) |
576 | Path::from_src(path, &hygiene) | ||
577 | } | 574 | } |
578 | } | 575 | } |
579 | 576 | ||