Skip to content

Commit

Permalink
rustdoc: add regression test for broken link due to double backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Markeffsky committed May 22, 2023
1 parent cb2ba42 commit b63cc5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/rustdoc-ui/unescaped_backticks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,15 @@ id! {
/// level changes.
pub mod tracing_macro {}
}

/// Regression test for <https://github.com/rust-lang/rust/issues/111117>
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;
}
14 changes: 13 additions & 1 deletion tests/rustdoc-ui/unescaped_backticks.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
Expand Down Expand Up @@ -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

0 comments on commit b63cc5c

Please sign in to comment.