Add regression test for #9473

This commit is contained in:
Guillaume Gomez 2024-03-05 12:07:37 +01:00
parent ee375e48be
commit bd9b9ffa04
3 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#![warn(clippy::doc_markdown)]
// Should not warn!
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>.
pub struct Foo(u32);
// Should warn.
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
pub struct FooBar(u32);

View file

@ -0,0 +1,9 @@
#![warn(clippy::doc_markdown)]
// Should not warn!
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>.
pub struct Foo(u32);
// Should warn.
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
pub struct FooBar(u32);

View file

@ -0,0 +1,15 @@
error: item in documentation is missing backticks
--> tests/ui/doc/issue_9473.rs:8:58
|
LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
| ^^^^^^
|
= note: `-D clippy::doc-markdown` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
help: try
|
LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
| ~~~~~~~~
error: aborting due to 1 previous error