about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
diff options
context:
space:
mode:
authorUlrik Sverdrup <root@localhost>2015-05-09 00:16:20 +0200
committerUlrik Sverdrup <root@localhost>2015-05-09 12:20:45 +0200
commitc46f3ff12b0a0b9c55df89eeb92603e9e488b2a7 (patch)
tree184e81aab23f30b218fab82e87652d2656a088f6 /src/librustdoc/html/render.rs
parentff4e06104903c8cb03600739fa51afb905188b18 (diff)
rustdoc: Add Associated Constants section
Section only visible if there are assoc. consts. present.
Diffstat (limited to 'src/librustdoc/html/render.rs')
-rw-r--r--src/librustdoc/html/render.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 4074a659442..55e16db596a 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, "</div>"));
     }
 
+    if !consts.is_empty() {
+        try!(write!(w, "
+            <h2 id='associated-const'>Associated Constants</h2>
+            <div class='methods'>
+        "));
+        for t in &consts {
+            try!(trait_item(w, *t));
+        }
+        try!(write!(w, "</div>"));
+    }
+
     // Output the documentation for each function individually
     if !required.is_empty() {
         try!(write!(w, "