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