about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorQuietMisdreavus <grey@quietmisdreavus.net>2018-07-27 23:18:17 -0500
committerQuietMisdreavus <grey@quietmisdreavus.net>2018-08-04 22:20:45 -0500
commit001445b235dfa2c8203e2622e3c2062637452a0f (patch)
treea2a834525fad6f8ecc93de1fde119df4470c79d7 /src/test/rustdoc
parent9e4e26687731458b1a6ec1b04e9c0d514c23237d (diff)
downloadrust-001445b235dfa2c8203e2622e3c2062637452a0f.tar.gz
rust-001445b235dfa2c8203e2622e3c2062637452a0f.zip
add tests for new intra-doc-link behavior
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/auxiliary/intra-link-extern-crate.rs13
-rw-r--r--src/test/rustdoc/intra-link-extern-crate.rs19
-rw-r--r--src/test/rustdoc/intra-link-private.rs18
3 files changed, 50 insertions, 0 deletions
diff --git a/src/test/rustdoc/auxiliary/intra-link-extern-crate.rs b/src/test/rustdoc/auxiliary/intra-link-extern-crate.rs
new file mode 100644
index 00000000000..e4a194466cc
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/intra-link-extern-crate.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.
+
+#![crate_name="inner"]
+
+//! ooh, i'm a rebel just for [kicks]
diff --git a/src/test/rustdoc/intra-link-extern-crate.rs b/src/test/rustdoc/intra-link-extern-crate.rs
new file mode 100644
index 00000000000..5666f3bd2f2
--- /dev/null
+++ b/src/test/rustdoc/intra-link-extern-crate.rs
@@ -0,0 +1,19 @@
+// 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.
+
+// aux-build:intra-link-extern-crate.rs
+
+// When loading `extern crate` statements, we would pull in their docs at the same time, even
+// though they would never actually get displayed. This tripped intra-doc-link resolution failures,
+// for items that aren't under our control, and not actually getting documented!
+
+#![deny(intra_doc_link_resolution_failure)]
+
+extern crate inner;
diff --git a/src/test/rustdoc/intra-link-private.rs b/src/test/rustdoc/intra-link-private.rs
new file mode 100644
index 00000000000..dbdfbc4e5ad
--- /dev/null
+++ b/src/test/rustdoc/intra-link-private.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.
+
+// Rustdoc would previously report resolution failures on items that weren't in the public docs.
+// These failures were legitimate, but not truly relevant - the docs in question couldn't be
+// checked for accuracy anyway.
+
+#![deny(intra_doc_link_resolution_failure)]
+
+/// ooh, i'm a [rebel] just for kicks
+struct SomeStruct;