Add regression test for #9473
This commit is contained in:
parent
ee375e48be
commit
bd9b9ffa04
9
tests/ui/doc/issue_9473.fixed
Normal file
9
tests/ui/doc/issue_9473.fixed
Normal file
@ -0,0 +1,9 @@
|
||||
#![warn(clippy::doc_markdown)]
|
||||
|
||||
// Should not warn!
|
||||
/// Blah blah blah <code>[FooBar]<[FooBar]></code>.
|
||||
pub struct Foo(u32);
|
||||
|
||||
// Should warn.
|
||||
/// Blah blah blah <code>[FooBar]<[FooBar]></code>[`FooBar`].
|
||||
pub struct FooBar(u32);
|
9
tests/ui/doc/issue_9473.rs
Normal file
9
tests/ui/doc/issue_9473.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#![warn(clippy::doc_markdown)]
|
||||
|
||||
// Should not warn!
|
||||
/// Blah blah blah <code>[FooBar]<[FooBar]></code>.
|
||||
pub struct Foo(u32);
|
||||
|
||||
// Should warn.
|
||||
/// Blah blah blah <code>[FooBar]<[FooBar]></code>[FooBar].
|
||||
pub struct FooBar(u32);
|
15
tests/ui/doc/issue_9473.stderr
Normal file
15
tests/ui/doc/issue_9473.stderr
Normal 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]<[FooBar]></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]<[FooBar]></code>[`FooBar`].
|
||||
| ~~~~~~~~
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user