]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/inline.rs
rollup merge of #21438: taralx/kill-racycell
[rust.git] / src / librustdoc / clean / inline.rs
index 432748b40e439d9da9dd1901e7f7a57d2b03ab3f..6e79bd9bebda1003233dfa0a9b8ce95d06e125f7 100644 (file)
@@ -319,12 +319,25 @@ fn build_impl(cx: &DocContext, tcx: &ty::ctxt,
                 };
                 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()),
@@ -337,6 +350,7 @@ fn build_impl(cx: &DocContext, tcx: &ty::ctxt,
             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,