Expand attribute macros on impl and trait items

This commit is contained in:
Jonas Schievink 2022-01-06 12:30:16 +01:00
parent 3eddda6f4c
commit 3ff68f25b8
8 changed files with 200 additions and 73 deletions

View file

@ -108,6 +108,17 @@ impl HasName for Macro {
impl HasAttrs for Macro {}
impl From<ast::AssocItem> for ast::Item {
fn from(assoc: ast::AssocItem) -> Self {
match assoc {
ast::AssocItem::Const(it) => ast::Item::Const(it),
ast::AssocItem::Fn(it) => ast::Item::Fn(it),
ast::AssocItem::MacroCall(it) => ast::Item::MacroCall(it),
ast::AssocItem::TypeAlias(it) => ast::Item::TypeAlias(it),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AttrKind {
Inner,