diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 4074a6594427d..55e16db596a39 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1862,6 +1862,17 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, try!(write!(w, "")); } + if !consts.is_empty() { + try!(write!(w, " +

Associated Constants

+
+ ")); + for t in &consts { + try!(trait_item(w, *t)); + } + try!(write!(w, "
")); + } + // Output the documentation for each function individually if !required.is_empty() { try!(write!(w, " diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs index cd8d7ec16dce4..20d4c744414c6 100644 --- a/src/test/rustdoc/assoc-consts.rs +++ b/src/test/rustdoc/assoc-consts.rs @@ -13,6 +13,7 @@ pub trait Foo { // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \ // 'const FOO: usize;' + // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO' const FOO: usize; }