Correctly handle closing parens in missing_backticks doc lint
This commit is contained in:
parent
0b1bf37722
commit
4f98cc6d55
4 changed files with 86 additions and 0 deletions
9
tests/ui/doc/issue_12795.fixed
Normal file
9
tests/ui/doc/issue_12795.fixed
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![warn(clippy::doc_markdown)]
|
||||
|
||||
//! A comment with `a_b(x)` and `a_c` in it and (`a_b((c))` ) too and (maybe `a_b((c))`)
|
||||
//~^ ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
|
||||
pub fn main() {}
|
||||
9
tests/ui/doc/issue_12795.rs
Normal file
9
tests/ui/doc/issue_12795.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#![warn(clippy::doc_markdown)]
|
||||
|
||||
//! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
//~^ ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
//~| ERROR: item in documentation is missing backticks
|
||||
|
||||
pub fn main() {}
|
||||
48
tests/ui/doc/issue_12795.stderr
Normal file
48
tests/ui/doc/issue_12795.stderr
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
error: item in documentation is missing backticks
|
||||
--> tests/ui/doc/issue_12795.rs:3:20
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: `-D clippy::doc-markdown` implied by `-D warnings`
|
||||
= help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`
|
||||
help: try
|
||||
|
|
||||
LL | //! A comment with `a_b(x)` and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ~~~~~~~~
|
||||
|
||||
error: item in documentation is missing backticks
|
||||
--> tests/ui/doc/issue_12795.rs:3:31
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ^^^
|
||||
|
|
||||
help: try
|
||||
|
|
||||
LL | //! A comment with a_b(x) and `a_c` in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ~~~~~
|
||||
|
||||
error: item in documentation is missing backticks
|
||||
--> tests/ui/doc/issue_12795.rs:3:46
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: try
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (`a_b((c))` ) too and (maybe a_b((c)))
|
||||
| ~~~~~~~~~~
|
||||
|
||||
error: item in documentation is missing backticks
|
||||
--> tests/ui/doc/issue_12795.rs:3:72
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe a_b((c)))
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: try
|
||||
|
|
||||
LL | //! A comment with a_b(x) and a_c in it and (a_b((c)) ) too and (maybe `a_b((c))`)
|
||||
| ~~~~~~~~~~
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue