Use dyn cache for Semantics macro resolution

This commit is contained in:
Lukas Wirth 2024-06-04 15:51:01 +02:00
parent 7d40763c88
commit 9349045e09
11 changed files with 44 additions and 41 deletions

View file

@ -2755,6 +2755,12 @@ impl Macro {
}
}
pub fn is_asm_or_global_asm(&self, db: &dyn HirDatabase) -> bool {
matches!(self.id, MacroId::Macro2Id(it) if {
matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm())
})
}
pub fn is_attr(&self, db: &dyn HirDatabase) -> bool {
matches!(self.kind(db), MacroKind::Attr)
}