diff --git a/tests/ui/doc/issue_9473.fixed b/tests/ui/doc/issue_9473.fixed new file mode 100644 index 00000000000..276ce7620ca --- /dev/null +++ b/tests/ui/doc/issue_9473.fixed @@ -0,0 +1,9 @@ +#![warn(clippy::doc_markdown)] + +// Should not warn! +/// Blah blah blah [FooBar]<[FooBar]>. +pub struct Foo(u32); + +// Should warn. +/// Blah blah blah [FooBar]<[FooBar]>[`FooBar`]. +pub struct FooBar(u32); diff --git a/tests/ui/doc/issue_9473.rs b/tests/ui/doc/issue_9473.rs new file mode 100644 index 00000000000..52527f7106d --- /dev/null +++ b/tests/ui/doc/issue_9473.rs @@ -0,0 +1,9 @@ +#![warn(clippy::doc_markdown)] + +// Should not warn! +/// Blah blah blah [FooBar]<[FooBar]>. +pub struct Foo(u32); + +// Should warn. +/// Blah blah blah [FooBar]<[FooBar]>[FooBar]. +pub struct FooBar(u32); diff --git a/tests/ui/doc/issue_9473.stderr b/tests/ui/doc/issue_9473.stderr new file mode 100644 index 00000000000..35aa2884cc1 --- /dev/null +++ b/tests/ui/doc/issue_9473.stderr @@ -0,0 +1,15 @@ +error: item in documentation is missing backticks + --> tests/ui/doc/issue_9473.rs:8:58 + | +LL | /// Blah blah blah [FooBar]<[FooBar]>[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 [FooBar]<[FooBar]>[`FooBar`]. + | ~~~~~~~~ + +error: aborting due to 1 previous error +