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.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir-def/src/nameres/attr_resolution.rs b/crates/hir-def/src/nameres/attr_resolution.rs index d1f6ed023c..289b9e2fb7 100644 --- a/crates/hir-def/src/nameres/attr_resolution.rs +++ b/crates/hir-def/src/nameres/attr_resolution.rs @@ -1,6 +1,6 @@ //! Post-nameres attribute resolution. -use base_db::CrateId; +use base_db::Crate; use hir_expand::{ attrs::{Attr, AttrId, AttrInput}, inert_attr_macro::find_builtin_attr_idx, @@ -13,7 +13,7 @@ use triomphe::Arc; use crate::{ db::DefDatabase, item_scope::BuiltinShadowMode, - nameres::path_resolution::ResolveMode, + nameres::{path_resolution::ResolveMode, LocalDefMap}, path::{self, ModPath, PathKind}, AstIdWithPath, LocalModuleId, MacroId, UnresolvedMacro, }; @@ -30,6 +30,7 @@ pub enum ResolvedAttr { impl DefMap { pub(crate) fn resolve_attr_macro( &self, + local_def_map: &LocalDefMap, db: &dyn DefDatabase, original_module: LocalModuleId, ast_id: AstIdWithPath<ast::Item>, @@ -42,6 +43,7 @@ impl DefMap { } let resolved_res = self.resolve_path_fp_with_macro( + local_def_map, db, ResolveMode::Other, original_module, @@ -105,7 +107,7 @@ pub(super) fn attr_macro_as_call_id( db: &dyn DefDatabase, item_attr: &AstIdWithPath<ast::Item>, macro_attr: &Attr, - krate: CrateId, + krate: Crate, def: MacroDefId, ) -> MacroCallId { let arg = match macro_attr.input.as_deref() { @@ -136,7 +138,7 @@ pub(super) fn derive_macro_as_call_id( derive_attr_index: AttrId, derive_pos: u32, call_site: SyntaxContextId, - krate: CrateId, + krate: Crate, resolver: impl Fn(&path::ModPath) -> Option<(MacroId, MacroDefId)>, derive_macro_id: MacroCallId, ) -> Result<(MacroId, MacroDefId, MacroCallId), UnresolvedMacro> { |