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.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 00b4db5437..b7c3e6bb41 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -3046,14 +3046,23 @@ impl Macro {
MacroId::Macro2Id(it) => {
matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInEager(eager) if eager.is_env_or_option_env())
}
- MacroId::MacroRulesId(_) | MacroId::ProcMacroId(_) => false,
+ MacroId::MacroRulesId(it) => {
+ matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInEager(eager) if eager.is_env_or_option_env())
+ }
+ MacroId::ProcMacroId(_) => false,
}
}
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())
- })
+ match self.id {
+ MacroId::Macro2Id(it) => {
+ matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm())
+ }
+ MacroId::MacroRulesId(it) => {
+ matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltIn(m) if m.is_asm())
+ }
+ MacroId::ProcMacroId(_) => false,
+ }
}
pub fn is_attr(&self, db: &dyn HirDatabase) -> bool {