Skip to content

Commit

Permalink
Fix kind for associated types in rustdoc JSON output for trait implem…
Browse files Browse the repository at this point in the history
…entations
  • Loading branch information
GuillaumeGomez committed Jun 27, 2022
1 parent bd2e51a commit c1c0d25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,11 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(),
default: None,
},
// FIXME: do not map to Typedef but to a custom variant
AssocTypeItem(t, _) => ItemEnum::Typedef(t.into_tcx(tcx)),
AssocTypeItem(t, b) => ItemEnum::AssocType {
generics: t.generics.into_tcx(tcx),
bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(),
default: t.item_type.map(|ty| ty.into_tcx(tcx)),
},
// `convert_item` early returns `None` for striped items and keywords.
StrippedItem(_) | KeywordItem(_) => unreachable!(),
ExternCrateItem { ref src } => ItemEnum::ExternCrate {
Expand Down

0 comments on commit c1c0d25

Please sign in to comment.