From c1c0d2593987a604fa0842ebd0b6515d9213883e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 27 Jun 2022 15:59:02 +0200 Subject: [PATCH] Fix kind for associated types in rustdoc JSON output for trait implementations --- src/librustdoc/json/conversions.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index c627dcc30d6..428519dbc16 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -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 {