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-link-double-anchor.rs7
-rw-r--r--src/test/rustdoc-ui/intra-link-double-anchor.stderr10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/intra-link-double-anchor.rs b/src/test/rustdoc-ui/intra-link-double-anchor.rs
new file mode 100644
index 00000000000..a01211c4f32
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-link-double-anchor.rs
@@ -0,0 +1,7 @@
+// check-pass
+
+// regression test for #73264
+// should only give one error
+/// docs [label][with#anchor#error]
+//~^ WARNING multiple anchors
+pub struct S;
diff --git a/src/test/rustdoc-ui/intra-link-double-anchor.stderr b/src/test/rustdoc-ui/intra-link-double-anchor.stderr
new file mode 100644
index 00000000000..55636d5c2f4
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-link-double-anchor.stderr
@@ -0,0 +1,10 @@
+warning: `with#anchor#error` contains multiple anchors
+  --> $DIR/intra-link-double-anchor.rs:5:10
+   |
+LL | /// docs [label][with#anchor#error]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^ contains invalid anchor
+   |
+   = note: `#[warn(broken_intra_doc_links)]` on by default
+
+warning: 1 warning emitted
+