]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
rust: macros: indent list item in `paste!`'s docs
authorMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Jul 2024 16:05:56 +0000 (18:05 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 10 Jul 2024 08:28:51 +0000 (10:28 +0200)
A new style lint, `doc_lazy_continuation` [1], has been introduced in the
upcoming Rust 1.80 (currently in beta), which detects missing indentation
in code documentation.

We have one such case:

    error: doc list item missing indentation
    --> rust/macros/lib.rs:315:5
        |
    315 | /// default the span of the `[< >]` group is used.
        |     ^
        |
        = help: if this is supposed to be its own paragraph, add a blank line
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
        = note: `-D clippy::doc-lazy-continuation` implied by `-D clippy::style`
        = help: to override `-D clippy::style` add `#[allow(clippy::doc_lazy_continuation)]`
    help: indent this line
        |
    315 | ///   default the span of the `[< >]` group is used.
        |     ++

While the rendering of the docs by `rustdoc` is not affected, we apply
this kind of indentation elsewhere since it looks better.

Thus clean it up.

Link: https://rust-lang.github.io/rust-clippy/master/index.html#/doc_lazy_continuation
Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Finn Behrens <me@kloenk.dev>
Tested-by: Benno Lossin <benno.lossin@proton.me>
Tested-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20240709160615.998336-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/macros/lib.rs

index 6dcc72aff111da1e58fbcffd6824d9e5fbe93f4f..159e75292970750e242e29cb9f5db5c327e83c15 100644 (file)
@@ -345,7 +345,7 @@ pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
 ///
 /// Currently supported modifiers are:
 /// * `span`: change the span of concatenated identifier to the span of the specified token. By
-/// default the span of the `[< >]` group is used.
+///   default the span of the `[< >]` group is used.
 /// * `lower`: change the identifier to lower case.
 /// * `upper`: change the identifier to upper case.
 ///