Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/resolver.rs')
| -rw-r--r-- | crates/hir_def/src/resolver.rs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index fcca84538a..22f66a0d62 100644 --- a/crates/hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs @@ -21,8 +21,8 @@ use crate::{ visibility::{RawVisibility, Visibility}, AdtId, AssocItemId, ConstId, ConstParamId, DefWithBodyId, EnumId, EnumVariantId, ExternBlockId, FunctionId, GenericDefId, GenericParamId, HasModule, ImplId, ItemContainerId, LifetimeParamId, - LocalModuleId, Lookup, MacroId, ModuleDefId, ModuleId, StaticId, StructId, TraitId, - TypeAliasId, TypeOrConstParamId, TypeParamId, VariantId, + LocalModuleId, Lookup, Macro2Id, MacroId, MacroRulesId, ModuleDefId, ModuleId, ProcMacroId, + StaticId, StructId, TraitId, TypeAliasId, TypeOrConstParamId, TypeParamId, VariantId, }; #[derive(Debug, Clone, Default)] @@ -864,3 +864,31 @@ impl HasResolver for VariantId { } } } + +impl HasResolver for MacroId { + fn resolver(self, db: &dyn DefDatabase) -> Resolver { + match self { + MacroId::Macro2Id(it) => it.resolver(db), + MacroId::MacroRulesId(it) => it.resolver(db), + MacroId::ProcMacroId(it) => it.resolver(db), + } + } +} + +impl HasResolver for Macro2Id { + fn resolver(self, db: &dyn DefDatabase) -> Resolver { + self.lookup(db).container.resolver(db) + } +} + +impl HasResolver for ProcMacroId { + fn resolver(self, db: &dyn DefDatabase) -> Resolver { + self.lookup(db).container.resolver(db) + } +} + +impl HasResolver for MacroRulesId { + fn resolver(self, db: &dyn DefDatabase) -> Resolver { + self.lookup(db).container.resolver(db) + } +} |