about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorpierzchalski <e.a.pierzchalski@gmail.com>2016-04-14 13:57:01 +1000
committerpierzchalski <e.a.pierzchalski@gmail.com>2016-04-14 13:57:01 +1000
commitd8d8669439bd9e636b9209733c24c32063cc611d (patch)
tree81d00b6ac28dcd96696b2617064bcd93ed3b15b8 /src/test/rustdoc
parent2b6020723115e77ebe94f228c0c9b977b9199c6e (diff)
downloadrust-d8d8669439bd9e636b9209733c24c32063cc611d.tar.gz
rust-d8d8669439bd9e636b9209733c24c32063cc611d.zip
Delegate whether to print docblocks to 'document'
Add test to check this resolves #24838 and #26871.
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/manual_impl.rs26
1 files changed, 26 insertions, 0 deletions
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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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
+    }
+}