Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics.rs')
-rw-r--r--crates/hir/src/semantics.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index 1d7ab5f6b7..763f53031e 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -365,6 +365,7 @@ impl<'db> SemanticsImpl<'db> {
_,
BuiltinFnLikeExpander::Column
| BuiltinFnLikeExpander::File
+ | BuiltinFnLikeExpander::ModulePath
| BuiltinFnLikeExpander::Asm
| BuiltinFnLikeExpander::LlvmAsm
| BuiltinFnLikeExpander::GlobalAsm
@@ -482,26 +483,10 @@ impl<'db> SemanticsImpl<'db> {
let SourceAnalyzer { file_id, resolver, .. } =
self.analyze_no_infer(actual_macro_call.syntax())?;
let macro_call = InFile::new(file_id, actual_macro_call);
- let macro_call_id = macro_call
- .as_call_id(
- self.db.upcast(),
- resolver.module(),
- |path| {
- resolver.resolve_path_as_macro_def(
- self.db.upcast(),
- path,
- Some(MacroSubNs::Bang),
- )
- },
- |module| {
- resolver
- .module()
- .def_map(self.db.upcast())
- .path_for_module(self.db.upcast(), module)
- },
- )
- .ok()?
- .value?;
+ let krate = resolver.krate();
+ let macro_call_id = macro_call.as_call_id(self.db.upcast(), krate, |path| {
+ resolver.resolve_path_as_macro_def(self.db.upcast(), path, Some(MacroSubNs::Bang))
+ })?;
hir_expand::db::expand_speculative(
self.db.upcast(),
macro_call_id,