about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/render.rs')
-rw-r--r--src/librustdoc/html/render.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 6945a6f3724..84f693a3be5 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -3181,14 +3181,16 @@ fn render_assoc_items(w: &mut fmt::Formatter,
         render_impls(cx, w, concrete, containing_item)?;
         write!(w, "</div>")?;
 
-        write!(w, "
-            <h2 id='synthetic-implementations' class='small-section-header'>
-              Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
-            </h2>
-            <div id='synthetic-implementations-list'>
-        ")?;
-        render_impls(cx, w, synthetic, containing_item)?;
-        write!(w, "</div>")?;
+        if !synthetic.is_empty() {
+            write!(w, "
+                <h2 id='synthetic-implementations' class='small-section-header'>
+                  Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
+                </h2>
+                <div id='synthetic-implementations-list'>
+            ")?;
+            render_impls(cx, w, synthetic, containing_item)?;
+            write!(w, "</div>")?;
+        }
     }
     Ok(())
 }