From 80408ef8dc00d4add3a76e27d93cf4ed8b50727e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 5 Oct 2021 23:48:41 -0700 Subject: [PATCH] Add regression test for #7758 --- tests/ui/doc/doc.rs | 5 +++++ tests/ui/doc/doc.stderr | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/ui/doc/doc.rs b/tests/ui/doc/doc.rs index 8b0c0f304fce0..342208e52b8e9 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 where [(); N.checked_next_power_of_two().unwrap()]: { diff --git a/tests/ui/doc/doc.stderr b/tests/ui/doc/doc.stderr index 7eab8a85f093d..161407a6a722e 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