Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_,
Expand Down
6 changes: 0 additions & 6 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -2283,7 +2278,6 @@ impl Clean<Vec<Item>> for doctree::Impl {
trait_: trait_,
for_: self.for_.clean(cx),
items: items,
derived: detect_derived(&self.attrs),
polarity: Some(self.polarity.clean(cx)),
}),
});
Expand Down
17 changes: 1 addition & 16 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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(())
}
Expand Down