Skip to content

Commit bd9b9ff

Browse files
Add regression test for #9473
1 parent ee375e4 commit bd9b9ff

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tests/ui/doc/issue_9473.fixed

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![warn(clippy::doc_markdown)]
2+
3+
// Should not warn!
4+
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>.
5+
pub struct Foo(u32);
6+
7+
// Should warn.
8+
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
9+
pub struct FooBar(u32);

tests/ui/doc/issue_9473.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![warn(clippy::doc_markdown)]
2+
3+
// Should not warn!
4+
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>.
5+
pub struct Foo(u32);
6+
7+
// Should warn.
8+
/// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
9+
pub struct FooBar(u32);

tests/ui/doc/issue_9473.stderr

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: item in documentation is missing backticks
2+
--> tests/ui/doc/issue_9473.rs:8:58
3+
|
4+
LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[FooBar].
5+
| ^^^^^^
6+
|
7+
= note: `-D clippy::doc-markdown` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
9+
help: try
10+
|
11+
LL | /// Blah blah blah <code>[FooBar]&lt;[FooBar]&gt;</code>[`FooBar`].
12+
| ~~~~~~~~
13+
14+
error: aborting due to 1 previous error
15+

0 commit comments

Comments
 (0)