diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index a255ba0ad4edf..9f2d02c14dde0 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1096,9 +1096,9 @@ impl fmt::Display for clean::ImportSource {
impl fmt::Display for clean::TypeBinding {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if f.alternate() {
- write!(f, "{}={:#}", self.name, self.ty)
+ write!(f, "{} = {:#}", self.name, self.ty)
} else {
- write!(f, "{}={}", self.name, self.ty)
+ write!(f, "{} = {}", self.name, self.ty)
}
}
}
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 7b60d497932de..10fde67a45674 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2808,7 +2808,7 @@ fn render_assoc_items(w: &mut fmt::Formatter,
}
AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
write!(w, "
Methods from \
- {}<Target={}>
", trait_, type_)?;
+ {}<Target = {}>", trait_, type_)?;
RenderMode::ForDeref { mut_: deref_mut_ }
}
};
diff --git a/src/test/rustdoc/doc-assoc-item.rs b/src/test/rustdoc/doc-assoc-item.rs
new file mode 100644
index 0000000000000..36f44295953f0
--- /dev/null
+++ b/src/test/rustdoc/doc-assoc-item.rs
@@ -0,0 +1,28 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 or the MIT license
+// , at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct Foo {
+ x: T,
+}
+
+pub trait Bar {
+ type Fuu;
+
+ fn foo(foo: Self::Fuu);
+}
+
+// @has doc_assoc_item/struct.Foo.html '//*[@class="impl"]' 'impl> Foo'
+impl> Foo {
+ pub fn new(t: T) -> Foo {
+ Foo {
+ x: t,
+ }
+ }
+}
diff --git a/src/test/rustdoc/issue-20646.rs b/src/test/rustdoc/issue-20646.rs
index 87c40d1157974..49fac20035fc0 100644
--- a/src/test/rustdoc/issue-20646.rs
+++ b/src/test/rustdoc/issue-20646.rs
@@ -23,7 +23,7 @@ pub trait Trait {
}
// @has issue_20646/fn.fun.html \
-// '//*[@class="rust fn"]' 'where T: Trait