about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/intra-doc/email-address-localhost.rs6
-rw-r--r--src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr15
-rw-r--r--src/test/rustdoc/intra-doc/email-address.rs6
3 files changed, 27 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs b/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs
new file mode 100644
index 00000000000..417618c7458
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs
@@ -0,0 +1,6 @@
+#![deny(warnings)]
+
+//! Email me at <hello@localhost>.
+//~^ ERROR unknown disambiguator `hello`
+
+//! This should *not* warn: <hello@example.com>.
diff --git a/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr b/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr
new file mode 100644
index 00000000000..de215b2163b
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr
@@ -0,0 +1,15 @@
+error: unknown disambiguator `hello`
+  --> $DIR/email-address-localhost.rs:3:18
+   |
+LL | //! Email me at <hello@localhost>.
+   |                  ^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/email-address-localhost.rs:1:9
+   |
+LL | #![deny(warnings)]
+   |         ^^^^^^^^
+   = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]`
+
+error: aborting due to previous error
+
diff --git a/src/test/rustdoc/intra-doc/email-address.rs b/src/test/rustdoc/intra-doc/email-address.rs
new file mode 100644
index 00000000000..c407eb80da2
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/email-address.rs
@@ -0,0 +1,6 @@
+//! Email me at <hello@example.com>.
+//! Email me at <hello-world@example.com>.
+//! Email me at <hello@localhost> (this warns but will still become a link).
+// @has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com'
+// @has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com'
+// @has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost'