about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/doc.rs2
-rw-r--r--tests/ui/doc.rs4
-rw-r--r--tests/ui/doc.stderr8
3 files changed, 12 insertions, 2 deletions
diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs
index a3278159ef5..d6c96fa62a9 100644
--- a/clippy_lints/src/doc.rs
+++ b/clippy_lints/src/doc.rs
@@ -238,7 +238,7 @@ fn check_doc<'a, Events: Iterator<Item = (usize, pulldown_cmark::Event<'a>)>>(
 }
 
 fn check_text(cx: &EarlyContext<'_>, valid_idents: &[String], text: &str, span: Span) {
-    for word in text.split_whitespace() {
+    for word in text.split(|c: char| c.is_whitespace() || c == '\'') {
         // Trim punctuation as in `some comment (see foo::bar).`
         //                                                   ^^
         // Or even as in `_foo bar_` which is emphasized.
diff --git a/tests/ui/doc.rs b/tests/ui/doc.rs
index 8935e3f01d5..c09cacd6be0 100644
--- a/tests/ui/doc.rs
+++ b/tests/ui/doc.rs
@@ -177,3 +177,7 @@ fn issue_1832() {}
 
 /// Ok: CamelCase (It should not be surrounded by backticks)
 fn issue_2395() {}
+
+/// An iterator over mycrate::Collection's values.
+/// It should not lint a `'static` lifetime in ticks.
+fn issue_2210() {}
diff --git a/tests/ui/doc.stderr b/tests/ui/doc.stderr
index 85c0fd898c7..26ac8103558 100644
--- a/tests/ui/doc.stderr
+++ b/tests/ui/doc.stderr
@@ -180,5 +180,11 @@ error: you should put bare URLs between `<`/`>` or make a proper Markdown link
 175 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 30 previous errors
+error: you should put `mycrate::Collection` between ticks in the documentation
+   --> $DIR/doc.rs:181:22
+    |
+181 | /// An iterator over mycrate::Collection's values.
+    |                      ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 31 previous errors