Skip to content

Commit

Permalink
Fix macro bug in impl From<DefKind> for ItemType
Browse files Browse the repository at this point in the history
This was missed a while ago when support for proc-macro attributes was
first added.
  • Loading branch information
jyn514 committed Apr 23, 2021
1 parent 18ee323 commit ab54197
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustdoc/formats/item_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ impl From<DefKind> for ItemType {
DefKind::Trait => Self::Trait,
DefKind::TyAlias => Self::Typedef,
DefKind::TraitAlias => Self::TraitAlias,
DefKind::Macro(_) => Self::Macro,
DefKind::Macro(kind) => match kind {
MacroKind::Bang => ItemType::Macro,
MacroKind::Attr => ItemType::ProcAttribute,
MacroKind::Derive => ItemType::ProcDerive,
},
DefKind::ForeignTy
| DefKind::Variant
| DefKind::AssocTy
Expand Down

0 comments on commit ab54197

Please sign in to comment.