diff options
| -rw-r--r-- | clippy_lints/src/doc/mod.rs | 5 | ||||
| -rw-r--r-- | tests/ui/doc/footnote_issue_13183.rs | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/clippy_lints/src/doc/mod.rs b/clippy_lints/src/doc/mod.rs index 5b6a5b08aa9..7adffb09eb5 100644 --- a/clippy_lints/src/doc/mod.rs +++ b/clippy_lints/src/doc/mod.rs @@ -768,7 +768,7 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize ); } }, - FootnoteReference(text) | Text(text) => { + Text(text) => { paragraph_range.end = range.end; let range_ = range.clone(); ticks_unbalanced |= text.contains('`') @@ -812,7 +812,8 @@ fn check_doc<'a, Events: Iterator<Item = (pulldown_cmark::Event<'a>, Range<usize } text_to_check.push((text, range, code_level)); } - }, + } + FootnoteReference(_) => {} } } headers diff --git a/tests/ui/doc/footnote_issue_13183.rs b/tests/ui/doc/footnote_issue_13183.rs new file mode 100644 index 00000000000..a18b4c3ac53 --- /dev/null +++ b/tests/ui/doc/footnote_issue_13183.rs @@ -0,0 +1,10 @@ +// This is a regression test for <https://github.com/rust-lang/rust-clippy/issues/13183>. +// It should not warn on missing backticks on footnote references. + +#![warn(clippy::doc_markdown)] +// Should not warn! +//! Here's a footnote[^example_footnote_identifier] +//! +//! [^example_footnote_identifier]: This is merely an example. + +fn main() {} |
