From b63cc5c307e515daffae65e344848710d4ce57e2 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Wed, 3 May 2023 20:33:49 +0200 Subject: [PATCH] rustdoc: add regression test for broken link due to double backticks --- tests/rustdoc-ui/unescaped_backticks.rs | 12 ++++++++++++ tests/rustdoc-ui/unescaped_backticks.stderr | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/rustdoc-ui/unescaped_backticks.rs b/tests/rustdoc-ui/unescaped_backticks.rs index f1ad7c8d4c78..e99cd1f3d58f 100644 --- a/tests/rustdoc-ui/unescaped_backticks.rs +++ b/tests/rustdoc-ui/unescaped_backticks.rs @@ -340,3 +340,15 @@ id! { /// level changes. pub mod tracing_macro {} } + +/// Regression test for +pub mod trillium_server_common { + /// One-indexed, because the first CloneCounter is included. If you don't + /// want the original to count, construct a [``CloneCounterObserver`] + /// instead and use [`CloneCounterObserver::counter`] to increment. + //~^ ERROR unescaped backtick + pub struct CloneCounter; + + /// This is used by the above. + pub struct CloneCounterObserver; +} diff --git a/tests/rustdoc-ui/unescaped_backticks.stderr b/tests/rustdoc-ui/unescaped_backticks.stderr index e629dbc34e9b..bf1f18889c40 100644 --- a/tests/rustdoc-ui/unescaped_backticks.stderr +++ b/tests/rustdoc-ui/unescaped_backticks.stderr @@ -341,6 +341,18 @@ LL | | /// level changes. change: [`rebuild_interest_cache`][rebuild] is called after the value of the max to this: [`rebuild_interest_cache\`][rebuild] is called after the value of the max +error: unescaped backtick + --> $DIR/unescaped_backticks.rs:348:56 + | +LL | /// instead and use [`CloneCounterObserver::counter`] to increment. + | ^ + | + = help: the opening or closing backtick of an inline code may be missing +help: if you meant to use a literal backtick, escape it + | +LL | /// instead and use [`CloneCounterObserver::counter\`] to increment. + | + + error: unescaped backtick --> $DIR/unescaped_backticks.rs:11:5 | @@ -955,5 +967,5 @@ help: if you meant to use a literal backtick, escape it LL | /// | table`( | )\`body | | + -error: aborting due to 63 previous errors +error: aborting due to 64 previous errors