Skip to content

Commit b63cc5c

Browse files
author
Lukas Markeffsky
committed
rustdoc: add regression test for broken link due to double backticks
1 parent cb2ba42 commit b63cc5c

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Diff for: tests/rustdoc-ui/unescaped_backticks.rs

+12
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,15 @@ id! {
340340
/// level changes.
341341
pub mod tracing_macro {}
342342
}
343+
344+
/// Regression test for <https://github.com/rust-lang/rust/issues/111117>
345+
pub mod trillium_server_common {
346+
/// One-indexed, because the first CloneCounter is included. If you don't
347+
/// want the original to count, construct a [``CloneCounterObserver`]
348+
/// instead and use [`CloneCounterObserver::counter`] to increment.
349+
//~^ ERROR unescaped backtick
350+
pub struct CloneCounter;
351+
352+
/// This is used by the above.
353+
pub struct CloneCounterObserver;
354+
}

Diff for: tests/rustdoc-ui/unescaped_backticks.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,18 @@ LL | | /// level changes.
341341
change: [`rebuild_interest_cache`][rebuild] is called after the value of the max
342342
to this: [`rebuild_interest_cache\`][rebuild] is called after the value of the max
343343

344+
error: unescaped backtick
345+
--> $DIR/unescaped_backticks.rs:348:56
346+
|
347+
LL | /// instead and use [`CloneCounterObserver::counter`] to increment.
348+
| ^
349+
|
350+
= help: the opening or closing backtick of an inline code may be missing
351+
help: if you meant to use a literal backtick, escape it
352+
|
353+
LL | /// instead and use [`CloneCounterObserver::counter\`] to increment.
354+
| +
355+
344356
error: unescaped backtick
345357
--> $DIR/unescaped_backticks.rs:11:5
346358
|
@@ -955,5 +967,5 @@ help: if you meant to use a literal backtick, escape it
955967
LL | /// | table`( | )\`body |
956968
| +
957969

958-
error: aborting due to 63 previous errors
970+
error: aborting due to 64 previous errors
959971

0 commit comments

Comments
 (0)