};
Some(item)
}
- ty::TypeTraitItem(_) => {
- // FIXME(pcwalton): Implement.
- None
+ ty::TypeTraitItem(ref assoc_ty) => {
+ let did = assoc_ty.def_id;
+ let type_scheme = ty::lookup_item_type(tcx, did);
+ // Not sure the choice of ParamSpace actually matters here, because an
+ // associated type won't have generics on the LHS
+ let typedef = (type_scheme, subst::ParamSpace::TypeSpace).clean(cx);
+ Some(clean::Item {
+ name: Some(assoc_ty.name.clean(cx)),
+ inner: clean::TypedefItem(typedef),
+ source: clean::Span::empty(),
+ attrs: vec![],
+ visibility: None,
+ stability: stability::lookup(tcx, did).clean(cx),
+ def_id: did
+ })
}
}
}).collect();
+ let polarity = csearch::get_impl_polarity(tcx, did);
return Some(clean::Item {
inner: clean::ImplItem(clean::Impl {
derived: clean::detect_derived(attrs.as_slice()),
for_: ty.ty.clean(cx),
generics: (&ty.generics, subst::TypeSpace).clean(cx),
items: trait_items,
+ polarity: polarity.map(|p| { p.clean(cx) }),
}),
source: clean::Span::empty(),
name: None,