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.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index f047971a11..423b46cc61 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1792,6 +1792,13 @@ impl MacroDef { } } + pub fn is_builtin_derive(&self) -> bool { + match self.id.kind { + MacroDefKind::BuiltInAttr(exp, _) => exp.is_derive(), + _ => false, + } + } + pub fn is_attr(&self) -> bool { matches!(self.kind(), MacroKind::Attr) } |