about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2021-03-26 18:14:47 -0700
committerCamelid <camelidcamel@gmail.com>2021-03-26 19:50:07 -0700
commit4572e7f903a3d6bd5b401e886c9e7e2ef97998f0 (patch)
tree8b6c6e2768a4631c59b4a15cfd39a258262844c2 /src/test
parent5e65467eff3d1da4712586d8402d1d2e1d6654bc (diff)
downloadrust-4572e7f903a3d6bd5b401e886c9e7e2ef97998f0.tar.gz
rust-4572e7f903a3d6bd5b401e886c9e7e2ef97998f0.zip
Lint on unknown intra-doc link disambiguators
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/intra-doc/unknown-disambiguator.rs10
-rw-r--r--src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr40
2 files changed, 50 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.rs b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.rs
new file mode 100644
index 00000000000..9222025367d
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.rs
@@ -0,0 +1,10 @@
+//! Linking to [foo@banana] and [`bar@banana!()`].
+//~^ ERROR unknown disambiguator `foo`
+//~| ERROR unknown disambiguator `bar`
+//! And to [no disambiguator](@nectarine) and [another](@apricot!()).
+//~^ ERROR unknown disambiguator ``
+//~| ERROR unknown disambiguator ``
+
+#![deny(warnings)]
+
+fn main() {}
diff --git a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
new file mode 100644
index 00000000000..9e7699eea9a
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
@@ -0,0 +1,40 @@
+error: unknown disambiguator `foo`
+  --> $DIR/unknown-disambiguator.rs:1:17
+   |
+LL | //! Linking to [foo@banana] and [`bar@banana!()`].
+   |                 ^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/unknown-disambiguator.rs:8:9
+   |
+LL | #![deny(warnings)]
+   |         ^^^^^^^^
+   = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]`
+   = note: the disambiguator is the part of the link before the `@` sign, or a suffix such as `()` for functions
+
+error: unknown disambiguator `bar`
+  --> $DIR/unknown-disambiguator.rs:1:34
+   |
+LL | //! Linking to [foo@banana] and [`bar@banana!()`].
+   |                                  ^^^^^^^^^^^^^^^
+   |
+   = note: the disambiguator is the part of the link before the `@` sign, or a suffix such as `()` for functions
+
+error: unknown disambiguator ``
+  --> $DIR/unknown-disambiguator.rs:4:31
+   |
+LL | //! And to [no disambiguator](@nectarine) and [another](@apricot!()).
+   |                               ^^^^^^^^^^
+   |
+   = note: the disambiguator is the part of the link before the `@` sign, or a suffix such as `()` for functions
+
+error: unknown disambiguator ``
+  --> $DIR/unknown-disambiguator.rs:4:57
+   |
+LL | //! And to [no disambiguator](@nectarine) and [another](@apricot!()).
+   |                                                         ^^^^^^^^^^^
+   |
+   = note: the disambiguator is the part of the link before the `@` sign, or a suffix such as `()` for functions
+
+error: aborting due to 4 previous errors
+