Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 79321df6b6..64d08c7364 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -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)
}