diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index c5850089578..58901dcb380 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2540,11 +2540,10 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
_ => panic!("can't make docs for trait item with name {:?}", item.name)
}
- match link {
- AssocItemLink::Anchor if !is_static || render_static => {
- document(w, cx, item)
- },
- _ => Ok(()),
+ if !is_static || render_static {
+ document(w, cx, item)
+ } else {
+ Ok(())
}
}
diff --git a/src/test/rustdoc/manual_impl.rs b/src/test/rustdoc/manual_impl.rs
new file mode 100644
index 00000000000..540cf58d38e
--- /dev/null
+++ b/src/test/rustdoc/manual_impl.rs
@@ -0,0 +1,26 @@
+// Copyright 2015 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 trait T {
+ fn a_method(&self) -> usize;
+}
+
+// @has manual_impl/struct.S.html '//*[@class="trait"]' 'T'
+// @has - '//*[@class="docblock"]' 'Docs associated with the trait implementation.'
+// @has - '//*[@class="docblock"]' 'Docs associated with the trait method implementation.'
+pub struct S(usize);
+
+/// Docs associated with the trait implementation.
+impl T for S {
+ /// Docs associated with the trait method implementation.
+ fn a_method(&self) -> usize {
+ self.0
+ }
+}