Fix macro bug in impl From<DefKind> for ItemType
· rust-lang/rust@6c066ab (original) (raw)
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -116,7 +116,11 @@ impl From for ItemType { | ||
116 | 116 | DefKind::Trait => Self::Trait, |
117 | 117 | DefKind::TyAlias => Self::Typedef, |
118 | 118 | DefKind::TraitAlias => Self::TraitAlias, |
119 | -DefKind::Macro(_) => Self::Macro, | |
119 | +DefKind::Macro(kind) => match kind { | |
120 | +MacroKind::Bang => ItemType::Macro, | |
121 | +MacroKind::Attr => ItemType::ProcAttribute, | |
122 | +MacroKind::Derive => ItemType::ProcDerive, | |
123 | +}, | |
120 | 124 | DefKind::ForeignTy |
121 | 125 | | DefKind::Variant |
122 | 126 | | DefKind::AssocTy |