about summary refs log tree commit diff
path: root/tests/rustdoc-ui
diff options
context:
space:
mode:
authorbinarycat <binarycat@envs.net>2025-04-18 20:23:05 -0500
committerbinarycat <binarycat@envs.net>2025-07-24 11:17:14 -0500
commit6a7d4882a207890c75ca09ce19810d90ac9cfde6 (patch)
tree2725cb9f61a6d2c44d589f965e55caefb307c7fd /tests/rustdoc-ui
parent041348110e2e526a80efd5adfc2909c716cbb37f (diff)
downloadrust-6a7d4882a207890c75ca09ce19810d90ac9cfde6.tar.gz
rust-6a7d4882a207890c75ca09ce19810d90ac9cfde6.zip
rustdoc::broken_intra_doc_links: only be lenient with shortcut links
collapsed links and reference links have a pretty particular syntax,
it seems unlikely they would show up on accident.

Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
Diffstat (limited to 'tests/rustdoc-ui')
-rw-r--r--tests/rustdoc-ui/intra-doc/weird-syntax.rs2
-rw-r--r--tests/rustdoc-ui/intra-doc/weird-syntax.stderr10
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/rustdoc-ui/intra-doc/weird-syntax.rs b/tests/rustdoc-ui/intra-doc/weird-syntax.rs
index 9f18f67fc44..1c5977b1bc3 100644
--- a/tests/rustdoc-ui/intra-doc/weird-syntax.rs
+++ b/tests/rustdoc-ui/intra-doc/weird-syntax.rs
@@ -65,7 +65,7 @@ pub struct XLinkToCloneWithStartSpace;
 /// [x][struct@Clone ] //~ERROR link
 pub struct XLinkToCloneWithEndSpace;
 
-/// [x][Clone\(\)]
+/// [x][Clone\(\)] //~ERROR link
 pub struct XLinkToCloneWithEscapedParens;
 
 /// [x][`Clone`] not URL-shaped enough
diff --git a/tests/rustdoc-ui/intra-doc/weird-syntax.stderr b/tests/rustdoc-ui/intra-doc/weird-syntax.stderr
index ad813f0f9b6..7f2fc1fe625 100644
--- a/tests/rustdoc-ui/intra-doc/weird-syntax.stderr
+++ b/tests/rustdoc-ui/intra-doc/weird-syntax.stderr
@@ -123,6 +123,14 @@ LL - /// [x][struct@Clone ]
 LL + /// [x][trait@Clone ]
    |
 
+error: unresolved link to `Clone\(\)`
+  --> $DIR/weird-syntax.rs:68:9
+   |
+LL | /// [x][Clone\(\)]
+   |         ^^^^^^^^^ no item named `Clone\(\)` in scope
+   |
+   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
+
 error: unresolved link to `Clone`
   --> $DIR/weird-syntax.rs:74:9
    |
@@ -299,5 +307,5 @@ LL | /// - [`SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER`]: the
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
-error: aborting due to 27 previous errors
+error: aborting due to 28 previous errors