Skip to content

Commit c1c0d25

Browse files
Fix kind for associated types in rustdoc JSON output for trait implementations
1 parent bd2e51a commit c1c0d25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustdoc/json/conversions.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,11 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
252252
bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(),
253253
default: None,
254254
},
255-
// FIXME: do not map to Typedef but to a custom variant
256-
AssocTypeItem(t, _) => ItemEnum::Typedef(t.into_tcx(tcx)),
255+
AssocTypeItem(t, b) => ItemEnum::AssocType {
256+
generics: t.generics.into_tcx(tcx),
257+
bounds: b.into_iter().map(|x| x.into_tcx(tcx)).collect(),
258+
default: t.item_type.map(|ty| ty.into_tcx(tcx)),
259+
},
257260
// `convert_item` early returns `None` for striped items and keywords.
258261
StrippedItem(_) | KeywordItem(_) => unreachable!(),
259262
ExternCrateItem { ref src } => ItemEnum::ExternCrate {

0 commit comments

Comments
 (0)