]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Remove Derived Implementations title
authorOliver Middleton <olliemail27@gmail.com>
Sun, 5 Jun 2016 22:50:18 +0000 (23:50 +0100)
committerOliver Middleton <olliemail27@gmail.com>
Sun, 5 Jun 2016 22:50:18 +0000 (23:50 +0100)
As far as I know whether a trait was derived or not does not change the
public API so there is no need to include this information in the docs.

This title currently just adds an extra divide in the list of trait
implementations which I don't think needs to be there.

src/librustdoc/clean/inline.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/render.rs

index f5d54123f37b52a018bee19ad27259ba87b8fba6..fbd9ba9d3021075c6d8e865f90708ea6a63edf06 100644 (file)
@@ -425,7 +425,6 @@ pub fn build_impl<'a, 'tcx>(cx: &DocContext,
     ret.push(clean::Item {
         inner: clean::ImplItem(clean::Impl {
             unsafety: hir::Unsafety::Normal, // FIXME: this should be decoded
-            derived: clean::detect_derived(&attrs),
             provided_trait_methods: provided,
             trait_: trait_,
             for_: for_,
index 0f3c62aca2a8595b51eba8be4f38b854ba3cbcce..1a08fc6bde412a002cfbdcd2627475d3eeacbf62 100644 (file)
@@ -2239,14 +2239,9 @@ pub struct Impl {
     pub trait_: Option<Type>,
     pub for_: Type,
     pub items: Vec<Item>,
-    pub derived: bool,
     pub polarity: Option<ImplPolarity>,
 }
 
-fn detect_derived<M: AttrMetaMethods>(attrs: &[M]) -> bool {
-    attr::contains_name(attrs, "automatically_derived")
-}
-
 impl Clean<Vec<Item>> for doctree::Impl {
     fn clean(&self, cx: &DocContext) -> Vec<Item> {
         let mut ret = Vec::new();
@@ -2283,7 +2278,6 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
                 trait_: trait_,
                 for_: self.for_.clean(cx),
                 items: items,
-                derived: detect_derived(&self.attrs),
                 polarity: Some(self.polarity.clean(cx)),
             }),
         });
index 396f71173f83451a24d43b3c071f06299dafe30f..1fa40a0cead28c48b3ab16627e92f4efbd0a8a34 100644 (file)
@@ -399,7 +399,6 @@ fn init_ids() -> HashMap<String, usize> {
      "methods",
      "deref-methods",
      "implementations",
-     "derived_implementations"
      ].into_iter().map(|id| (String::from(*id), 1)).collect()
 }
 
@@ -2501,25 +2500,11 @@ fn render_assoc_items(w: &mut fmt::Formatter,
         }
         write!(w, "<h2 id='implementations'>Trait \
                    Implementations</h2>")?;
-        let (derived, manual): (Vec<_>, Vec<&Impl>) = traits.iter().partition(|i| {
-            i.inner_impl().derived
-        });
-        for i in &manual {
+        for i in &traits {
             let did = i.trait_did().unwrap();
             let assoc_link = AssocItemLink::GotoSource(did, &i.inner_impl().provided_trait_methods);
             render_impl(w, cx, i, assoc_link, true, containing_item.stable_since())?;
         }
-        if !derived.is_empty() {
-            write!(w, "<h3 id='derived_implementations'>\
-                           Derived Implementations \
-                       </h3>")?;
-            for i in &derived {
-                let did = i.trait_did().unwrap();
-                let assoc_link = AssocItemLink::GotoSource(did,
-                                                           &i.inner_impl().provided_trait_methods);
-                render_impl(w, cx, i, assoc_link, true, containing_item.stable_since())?;
-            }
-        }
     }
     Ok(())
 }