diff options
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
-rw-r--r-- | crates/hir/src/source_analyzer.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 186421cbd..b5c65808e 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -204,8 +204,7 @@ impl SourceAnalyzer { | |||
204 | macro_call: InFile<&ast::MacroCall>, | 204 | macro_call: InFile<&ast::MacroCall>, |
205 | ) -> Option<MacroDef> { | 205 | ) -> Option<MacroDef> { |
206 | let ctx = body::LowerCtx::new(db.upcast(), macro_call.file_id); | 206 | let ctx = body::LowerCtx::new(db.upcast(), macro_call.file_id); |
207 | let path = | 207 | let path = macro_call.value.path().and_then(|ast| Path::from_src(ast, &ctx))?; |
208 | macro_call.value.path().and_then(|ast| Path::from_src(db.upcast(), ast, &ctx))?; | ||
209 | self.resolver.resolve_path_as_macro(db.upcast(), path.mod_path()).map(|it| it.into()) | 208 | self.resolver.resolve_path_as_macro(db.upcast(), path.mod_path()).map(|it| it.into()) |
210 | } | 209 | } |
211 | 210 | ||
@@ -285,7 +284,7 @@ impl SourceAnalyzer { | |||
285 | // This must be a normal source file rather than macro file. | 284 | // This must be a normal source file rather than macro file. |
286 | let hygiene = Hygiene::new(db.upcast(), self.file_id); | 285 | let hygiene = Hygiene::new(db.upcast(), self.file_id); |
287 | let ctx = body::LowerCtx::with_hygiene(db.upcast(), &hygiene); | 286 | let ctx = body::LowerCtx::with_hygiene(db.upcast(), &hygiene); |
288 | let hir_path = Path::from_src(db.upcast(), path.clone(), &ctx)?; | 287 | let hir_path = Path::from_src(path.clone(), &ctx)?; |
289 | 288 | ||
290 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we | 289 | // Case where path is a qualifier of another path, e.g. foo::bar::Baz where we |
291 | // trying to resolve foo::bar. | 290 | // trying to resolve foo::bar. |