diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index dea5c60740bf..37b7c6c07b0f 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2451,6 +2451,8 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
";
+ let mut synthetic_types = Vec::new();
+
if let Some(implementors) = cache.implementors.get(&it.def_id) {
// The DefId is for the first Type found with that name. The bool is
// if any Types with the same name but different DefId have been found.
@@ -2506,6 +2508,9 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
if t.auto {
write!(w, "{}", synthetic_impl_header)?;
for implementor in synthetic {
+ synthetic_types.extend(
+ collect_paths_for_type(implementor.inner_impl().for_.clone())
+ );
render_implementor(cx, implementor, w, &implementor_dups)?;
}
write!(w, "
")?;
@@ -2516,13 +2521,13 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
write!(w, "{}", impl_header)?;
write!(w, "")?;
- write!(w, r#""#)?;
-
if t.auto {
write!(w, "{}", synthetic_impl_header)?;
write!(w, "")?;
}
}
+ write!(w, r#""#,
+ as_json(&synthetic_types))?;
write!(w, r#"