diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index b0554c21bf92e..0bc3da15462ad 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -174,12 +174,18 @@ pub enum ItemEnum { StaticItem(Static), TraitItem(Trait), ImplItem(Impl), + /// `use` and `extern crate` ViewItemItem(ViewItem), + /// A method signature only. Used for required methods in traits (ie, + /// non-default-methods). TyMethodItem(TyMethod), + /// A method with a body. MethodItem(Method), StructFieldItem(StructField), VariantItem(Variant), + /// `fn`s from an extern block ForeignFunctionItem(Function), + /// `static`s from an extern block ForeignStaticItem(Static), MacroItem(Macro), } @@ -1014,11 +1020,23 @@ pub struct Impl { generics: Generics, trait_: Option, for_: Type, - methods: Vec , + methods: Vec, + derived: bool, } impl Clean for doctree::Impl { fn clean(&self) -> Item { + let mut derived = false; + for attr in self.attrs.iter() { + match attr.node.value.node { + ast::MetaWord(ref s) => { + if s.get() == "automatically_derived" { + derived = true; + } + } + _ => {} + } + } Item { name: None, attrs: self.attrs.clean(), @@ -1030,6 +1048,7 @@ impl Clean for doctree::Impl { trait_: self.trait_.clean(), for_: self.for_.clean(), methods: self.methods.clean(), + derived: derived, }), } } diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 317571ebc3ff6..095f27d25b350 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -29,53 +29,53 @@ pub fn render( -> fmt::Result { write!(dst, -" - +r##" + - + {title} - + - {favicon, select, none{} other{}} + {favicon, select, none{} other{}} -
+ -