Fix kind for associated types in rustdoc JSON output for trait implementations

This commit is contained in:
Guillaume Gomez 2022-06-27 15:59:02 +02:00
parent bd2e51a338
commit c1c0d25939

View File

@ -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(), bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(),
default: None, default: None,
}, },
// FIXME: do not map to Typedef but to a custom variant AssocTypeItem(t, b) => ItemEnum::AssocType {
AssocTypeItem(t, _) => ItemEnum::Typedef(t.into_tcx(tcx)), 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. // `convert_item` early returns `None` for striped items and keywords.
StrippedItem(_) | KeywordItem(_) => unreachable!(), StrippedItem(_) | KeywordItem(_) => unreachable!(),
ExternCrateItem { ref src } => ItemEnum::ExternCrate { ExternCrateItem { ref src } => ItemEnum::ExternCrate {