Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/nameres/attr_resolution.rs')
-rw-r--r--crates/hir_def/src/nameres/attr_resolution.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/hir_def/src/nameres/attr_resolution.rs b/crates/hir_def/src/nameres/attr_resolution.rs
index 4c436250db..a7e2c3e8ad 100644
--- a/crates/hir_def/src/nameres/attr_resolution.rs
+++ b/crates/hir_def/src/nameres/attr_resolution.rs
@@ -8,6 +8,7 @@ use crate::{
attr_macro_as_call_id, builtin_attr,
db::DefDatabase,
item_scope::BuiltinShadowMode,
+ macro_id_to_def_id,
nameres::path_resolution::ResolveMode,
path::{ModPath, PathKind},
AstIdWithPath, LocalModuleId, UnresolvedMacro,
@@ -45,7 +46,7 @@ impl DefMap {
);
let def = match resolved_res.resolved_def.take_macros() {
Some(def) => {
- if def.is_attribute() {
+ if def.is_attribute(db) {
def
} else {
return Ok(ResolvedAttr::Other);
@@ -54,7 +55,14 @@ impl DefMap {
None => return Err(UnresolvedMacro { path: ast_id.path.clone() }),
};
- Ok(ResolvedAttr::Macro(attr_macro_as_call_id(db, &ast_id, attr, self.krate, def, false)))
+ Ok(ResolvedAttr::Macro(attr_macro_as_call_id(
+ db,
+ &ast_id,
+ attr,
+ self.krate,
+ macro_id_to_def_id(db, def),
+ false,
+ )))
}
pub(crate) fn is_builtin_or_registered_attr(&self, path: &ModPath) -> bool {