mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-01 00:49:30 +00:00
6de87829da
This change addresses cases where doc comments are separated by blank lines, comments, or non-doc-comment attributes, like this: ```rust /// - first line // not part of doc comment /// second line ``` Before this commit, Clippy gave a pedantically-correct warning about how you needed to indent the second line. This is unlikely to be what the user intends, and has been described as a "false positive" (since Clippy is warning you about a highly unintuitive behavior that Rustdoc actually has, we definitely want it to output *something*, but the suggestion to indent was poor). https://github.com/rust-lang/rust-clippy/issues/12917
56 lines
1.5 KiB
Text
56 lines
1.5 KiB
Text
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_blank_line.rs:23:5
|
|
|
|
|
LL | /// This is yet another constant.
|
|
| ^
|
|
|
|
|
= help: if this is intended to be part of the list, indent 3 spaces
|
|
= note: `-D clippy::doc-lazy-continuation` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]`
|
|
help: if this should be its own paragraph, add a blank doc comment line
|
|
|
|
|
LL ~ /// - Second reason
|
|
LL + ///
|
|
|
|
|
|
|
error: doc list item without indentation
|
|
--> tests/ui/doc/doc_lazy_blank_line.rs:32:5
|
|
|
|
|
LL | /// This is still in use.
|
|
| ^
|
|
|
|
|
= help: if this is intended to be part of the list, indent 4 spaces
|
|
help: if this should be its own paragraph, add a blank doc comment line
|
|
|
|
|
LL ~ /// 2. Second reason
|
|
LL + ///
|
|
|
|
|
|
|
error: doc quote line without `>` marker
|
|
--> tests/ui/doc/doc_lazy_blank_line.rs:37:5
|
|
|
|
|
LL | /// bottom text
|
|
| ^
|
|
|
|
|
= help: if this not intended to be a quote at all, escape it with `\>`
|
|
help: if this should be its own paragraph, add a blank doc comment line
|
|
|
|
|
LL ~ /// > blockquote code path
|
|
LL + ///
|
|
|
|
|
|
|
error: doc quote line without `>` marker
|
|
--> tests/ui/doc/doc_lazy_blank_line.rs:42:5
|
|
|
|
|
LL | /// bottom text
|
|
| ^
|
|
|
|
|
= help: if this not intended to be a quote at all, escape it with `\>`
|
|
help: if this should be its own paragraph, add a blank doc comment line
|
|
|
|
|
LL ~ /// > blockquote code path
|
|
LL + ///
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|