Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f302af3

Browse files
committed
Add doc comment issue of rust-lang#5834 to known problems of lint doc_markdown
1 parent 8c9800a commit f302af3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

clippy_lints/src/doc.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,26 @@ declare_clippy_lint! {
3232
/// **Known problems:** Lots of bad docs won’t be fixed, what the lint checks
3333
/// for is limited, and there are still false positives.
3434
///
35+
/// In addition, when writing documentation comments, including `[]` brackets
36+
/// inside a link text would trip the parser. Therfore, documenting link with
37+
/// `[`SmallVec<[T; INLINE_CAPACITY]>`]` and then [`SmallVec<[T; INLINE_CAPACITY]>`]: SmallVec
38+
/// would fail.
39+
///
3540
/// **Examples:**
3641
/// ```rust
3742
/// /// Do something with the foo_bar parameter. See also
3843
/// /// that::other::module::foo.
3944
/// // ^ `foo_bar` and `that::other::module::foo` should be ticked.
4045
/// fn doit(foo_bar: usize) {}
4146
/// ```
47+
///
48+
/// ```rust
49+
/// // Link text with `[]` brackets should be written as following:
50+
/// /// Consume the array and return the inner
51+
/// /// [`SmallVec<[T; INLINE_CAPACITY]>`][SmallVec].
52+
/// /// [SmallVec]: SmallVec
53+
/// fn main() {}
54+
/// ```
4255
pub DOC_MARKDOWN,
4356
pedantic,
4457
"presence of `_`, `::` or camel-case outside backticks in documentation"

0 commit comments

Comments
 (0)