about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-10-05 23:48:41 -0700
committerManish Goregaokar <manishsmail@gmail.com>2021-10-06 08:31:14 -0700
commit80408ef8dc00d4add3a76e27d93cf4ed8b50727e (patch)
treec38c1bc3206f72539a5e5eddde7429055632a682
parentb9d753e4f5eb921a4185d5bbaef15a5af2c43e2f (diff)
downloadrust-80408ef8dc00d4add3a76e27d93cf4ed8b50727e.tar.gz
rust-80408ef8dc00d4add3a76e27d93cf4ed8b50727e.zip
Add regression test for #7758
-rw-r--r--tests/ui/doc/doc.rs5
-rw-r--r--tests/ui/doc/doc.stderr8
2 files changed, 12 insertions, 1 deletions
diff --git a/tests/ui/doc/doc.rs b/tests/ui/doc/doc.rs
index 8b0c0f304fc..342208e52b8 100644
--- a/tests/ui/doc/doc.rs
+++ b/tests/ui/doc/doc.rs
@@ -203,6 +203,11 @@ fn issue_2343() {}
 /// __|_ _|__||_|
 fn pulldown_cmark_crash() {}
 
+/// This should not lint
+/// (regression test for #7758)
+/// [plain text][path::to::item]
+fn intra_doc_link() {}
+
 // issue #7033 - generic_const_exprs ICE
 struct S<T, const N: usize>
 where [(); N.checked_next_power_of_two().unwrap()]: {
diff --git a/tests/ui/doc/doc.stderr b/tests/ui/doc/doc.stderr
index 7eab8a85f09..161407a6a72 100644
--- a/tests/ui/doc/doc.stderr
+++ b/tests/ui/doc/doc.stderr
@@ -186,5 +186,11 @@ error: you should put `mycrate::Collection` between ticks in the documentation
 LL | /// An iterator over mycrate::Collection's values.
    |                      ^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 31 previous errors
+error: you should put `text][path::to::item` between ticks in the documentation
+  --> $DIR/doc.rs:208:12
+   |
+LL | /// [plain text][path::to::item]
+   |            ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 32 previous errors