Skip to content

Commit cc18104

Browse files
committed
rustdoc: Remove Derived Implementations title
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.
1 parent 1c975ea commit cc18104

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

src/librustdoc/clean/inline.rs

-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ pub fn build_impl<'a, 'tcx>(cx: &DocContext,
425425
ret.push(clean::Item {
426426
inner: clean::ImplItem(clean::Impl {
427427
unsafety: hir::Unsafety::Normal, // FIXME: this should be decoded
428-
derived: clean::detect_derived(&attrs),
429428
provided_trait_methods: provided,
430429
trait_: trait_,
431430
for_: for_,

src/librustdoc/clean/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -2239,14 +2239,9 @@ pub struct Impl {
22392239
pub trait_: Option<Type>,
22402240
pub for_: Type,
22412241
pub items: Vec<Item>,
2242-
pub derived: bool,
22432242
pub polarity: Option<ImplPolarity>,
22442243
}
22452244

2246-
fn detect_derived<M: AttrMetaMethods>(attrs: &[M]) -> bool {
2247-
attr::contains_name(attrs, "automatically_derived")
2248-
}
2249-
22502245
impl Clean<Vec<Item>> for doctree::Impl {
22512246
fn clean(&self, cx: &DocContext) -> Vec<Item> {
22522247
let mut ret = Vec::new();
@@ -2283,7 +2278,6 @@ impl Clean<Vec<Item>> for doctree::Impl {
22832278
trait_: trait_,
22842279
for_: self.for_.clean(cx),
22852280
items: items,
2286-
derived: detect_derived(&self.attrs),
22872281
polarity: Some(self.polarity.clean(cx)),
22882282
}),
22892283
});

src/librustdoc/html/render.rs

+1-16
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ fn init_ids() -> HashMap<String, usize> {
399399
"methods",
400400
"deref-methods",
401401
"implementations",
402-
"derived_implementations"
403402
].into_iter().map(|id| (String::from(*id), 1)).collect()
404403
}
405404

@@ -2501,25 +2500,11 @@ fn render_assoc_items(w: &mut fmt::Formatter,
25012500
}
25022501
write!(w, "<h2 id='implementations'>Trait \
25032502
Implementations</h2>")?;
2504-
let (derived, manual): (Vec<_>, Vec<&Impl>) = traits.iter().partition(|i| {
2505-
i.inner_impl().derived
2506-
});
2507-
for i in &manual {
2503+
for i in &traits {
25082504
let did = i.trait_did().unwrap();
25092505
let assoc_link = AssocItemLink::GotoSource(did, &i.inner_impl().provided_trait_methods);
25102506
render_impl(w, cx, i, assoc_link, true, containing_item.stable_since())?;
25112507
}
2512-
if !derived.is_empty() {
2513-
write!(w, "<h3 id='derived_implementations'>\
2514-
Derived Implementations \
2515-
</h3>")?;
2516-
for i in &derived {
2517-
let did = i.trait_did().unwrap();
2518-
let assoc_link = AssocItemLink::GotoSource(did,
2519-
&i.inner_impl().provided_trait_methods);
2520-
render_impl(w, cx, i, assoc_link, true, containing_item.stable_since())?;
2521-
}
2522-
}
25232508
}
25242509
Ok(())
25252510
}

0 commit comments

Comments
 (0)