about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/generic-impl.rs1
-rw-r--r--src/test/rustdoc/primitive-generic-impl.rs18
-rw-r--r--src/test/rustdoc/primitive/primitive-generic-impl.rs13
3 files changed, 32 insertions, 0 deletions
diff --git a/src/test/rustdoc/generic-impl.rs b/src/test/rustdoc/generic-impl.rs
index e2665fd8f37..46e02ed08e0 100644
--- a/src/test/rustdoc/generic-impl.rs
+++ b/src/test/rustdoc/generic-impl.rs
@@ -17,6 +17,7 @@ pub struct Bar;
 
 // @has foo/struct.Foo.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T'
 pub struct Foo;
+// @has foo/struct.Foo.html '//div[@class="sidebar-links"]/a[@href="#impl-ToString"]' 'ToString'
 
 impl fmt::Display for Foo {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
diff --git a/src/test/rustdoc/primitive-generic-impl.rs b/src/test/rustdoc/primitive-generic-impl.rs
new file mode 100644
index 00000000000..b4351b8268c
--- /dev/null
+++ b/src/test/rustdoc/primitive-generic-impl.rs
@@ -0,0 +1,18 @@
+// Copyright 2018 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.
+
+#![crate_name = "foo"]
+
+// we need to reexport something from libstd so that `all_trait_implementations` is called.
+pub use std::string::String;
+
+include!("primitive/primitive-generic-impl.rs");
+
+// @has foo/primitive.i32.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T'
diff --git a/src/test/rustdoc/primitive/primitive-generic-impl.rs b/src/test/rustdoc/primitive/primitive-generic-impl.rs
new file mode 100644
index 00000000000..1ac1fc95338
--- /dev/null
+++ b/src/test/rustdoc/primitive/primitive-generic-impl.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 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.
+
+#[doc(primitive = "i32")]
+/// Some useless docs, wouhou!
+mod i32 {}