This commit is contained in:
Lukas Wirth 2023-11-25 17:10:18 +01:00
parent ab8f12e169
commit 92d447f976
26 changed files with 102 additions and 123 deletions

View file

@ -483,7 +483,7 @@ impl SourceAnalyzer {
macro_call: InFile<&ast::MacroCall>,
) -> Option<Macro> {
let ctx = LowerCtx::with_file_id(db.upcast(), macro_call.file_id);
let path = macro_call.value.path().and_then(|ast| Path::from_src(ast, &ctx))?;
let path = macro_call.value.path().and_then(|ast| Path::from_src(&ctx, ast))?;
self.resolver
.resolve_path_as_macro(db.upcast(), path.mod_path()?, Some(MacroSubNs::Bang))
.map(|(it, _)| it.into())
@ -596,7 +596,7 @@ impl SourceAnalyzer {
// This must be a normal source file rather than macro file.
let ctx = LowerCtx::with_span_map(db.upcast(), db.span_map(self.file_id));
let hir_path = Path::from_src(path.clone(), &ctx)?;
let hir_path = Path::from_src(&ctx, path.clone())?;
// Case where path is a qualifier of a use tree, e.g. foo::bar::{Baz, Qux} where we are
// trying to resolve foo::bar.