about summary refs log tree commit diff
path: root/src/test/rustdoc/intra-doc/pub-use.rs
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-11-28 20:25:41 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-11-28 21:13:55 -0500
commitddfb581fb9e04595bc7cdb9d66792fdfdbec67ed (patch)
treeecf43b905627276e664d79d7ab93bba72f899fad /src/test/rustdoc/intra-doc/pub-use.rs
parente37f25aa3f356546ab851e394d5598fc575eabda (diff)
downloadrust-ddfb581fb9e04595bc7cdb9d66792fdfdbec67ed.tar.gz
rust-ddfb581fb9e04595bc7cdb9d66792fdfdbec67ed.zip
Move `src/test/rustdoc` intra-doc link tests into a subdirectory
They were starting to get unwieldy.
Diffstat (limited to 'src/test/rustdoc/intra-doc/pub-use.rs')
-rw-r--r--src/test/rustdoc/intra-doc/pub-use.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/rustdoc/intra-doc/pub-use.rs b/src/test/rustdoc/intra-doc/pub-use.rs
new file mode 100644
index 00000000000..dd52249abc6
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/pub-use.rs
@@ -0,0 +1,27 @@
+// aux-build: intra-link-pub-use.rs
+#![deny(broken_intra_doc_links)]
+#![crate_name = "outer"]
+
+extern crate inner;
+
+/// [mod@std::env] [g]
+
+// FIXME: This can't be tested because rustdoc doesn't show documentation on pub re-exports.
+// Until then, comment out the `htmldocck` test.
+// This test still does something; namely check that no incorrect errors are emitted when
+// documenting the re-export.
+
+// @has outer/index.html
+// @ has - '//a[@href="https://doc.rust-lang.org/nightly/std/env/fn.var.html"]' "std::env"
+// @ has - '//a[@href="../outer/fn.f.html"]' "g"
+pub use f as g;
+
+// FIXME: same as above
+/// [std::env]
+extern crate self as _;
+
+// Make sure the documentation is actually correct by documenting an inlined re-export
+/// [mod@std::env]
+// @has outer/fn.f.html
+// @has - '//a[@href="https://doc.rust-lang.org/nightly/std/env/index.html"]' "std::env"
+pub use inner::f;