about summary refs log tree commit diff
diff options
context:
space:
mode:
authornahuakang <kangnahua@gmail.com>2020-10-02 20:13:01 +0200
committernahuakang <kangnahua@gmail.com>2020-10-02 22:05:40 +0200
commitf302af33bc1901ddd0226c8d3a6433682a85f69b (patch)
tree08fcc12d90d1a9261bf840aeb8c685279f8f30ae
parent8c9800a3a9026aa3cc1071276d0672585ba2175e (diff)
downloadrust-f302af33bc1901ddd0226c8d3a6433682a85f69b.tar.gz
rust-f302af33bc1901ddd0226c8d3a6433682a85f69b.zip
Add doc comment issue of #5834 to known problems of lint doc_markdown
-rw-r--r--clippy_lints/src/doc.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs
index 62bb70af06e..07f604cf714 100644
--- a/clippy_lints/src/doc.rs
+++ b/clippy_lints/src/doc.rs
@@ -32,6 +32,11 @@ declare_clippy_lint! {
     /// **Known problems:** Lots of bad docs won’t be fixed, what the lint checks
     /// for is limited, and there are still false positives.
     ///
+    /// In addition, when writing documentation comments, including `[]` brackets
+    /// inside a link text would trip the parser. Therfore, documenting link with
+    /// `[`SmallVec<[T; INLINE_CAPACITY]>`]` and then [`SmallVec<[T; INLINE_CAPACITY]>`]: SmallVec
+    /// would fail.
+    ///
     /// **Examples:**
     /// ```rust
     /// /// Do something with the foo_bar parameter. See also
@@ -39,6 +44,14 @@ declare_clippy_lint! {
     /// // ^ `foo_bar` and `that::other::module::foo` should be ticked.
     /// fn doit(foo_bar: usize) {}
     /// ```
+    ///
+    /// ```rust
+    /// // Link text with `[]` brackets should be written as following:
+    /// /// Consume the array and return the inner
+    /// /// [`SmallVec<[T; INLINE_CAPACITY]>`][SmallVec].
+    /// /// [SmallVec]: SmallVec
+    /// fn main() {}
+    /// ```
     pub DOC_MARKDOWN,
     pedantic,
     "presence of `_`, `::` or camel-case outside backticks in documentation"