Skip to contentSkip to conversation

rust: rbtree: fix overindented list item

PATCH Applied Miguel Ojeda 4 participants 4 messages Feb 6, 2025 – Feb 12, 2025

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 rust: rbtree: fix overindented list item

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have a new lint, doc_overindented_list_items [1], which catches cases of overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928deada1 ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a single case in the kernel, apart from the one already fixed in the commit above:

error: doc list item overindented
--> rust/kernel/rbtree.rs:1152:5
|
1152 | /// null, it is a pointer to the root of the [RBTree].
| ^^^^ help: try using ` ` (2 spaces)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
= note: -D clippy::doc-overindented-list-items implied by -D warnings
= help: to override -D warnings add #[allow(clippy::doc_overindented_list_items)]

Thus clean it up.

Cc Yutaro Ohno <[email protected]>
Cc <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes a335e9591404 ("rust: rbtree: add `RBTree::entry`")
---
 rust/kernel/rbtree.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/rbtree.rs +1 -1
index ee2731dad72d..0d1e75810664 100644
@@ -1149,7 +1149,7 @@ pub struct VacantEntry<'a, K, V> {
 /// # Invariants
 /// - `parent` may be null if the new node becomes the root.
 /// - `child_field_of_parent` is a valid pointer to the left-child or right-child of `parent`. If `parent` is
-///     null, it is a pointer to the root of the [`RBTree`].
+///   null, it is a pointer to the root of the [`RBTree`].
 struct RawVacantEntry<'a, K, V> {
     rbtree: *mut RBTree<K, V>,
     /// The node that will become the parent of the new node if we insert one.
Signature · 1 line
2.48.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Miguel Ojeda

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have a new lint, doc_overindented_list_items [1], which catches cases of overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928deada1 ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a single case in the kernel, apart from the one already fixed in the commit above:

error: doc list item overindented
--> rust/kernel/rbtree.rs:1152:5
|
1152 | /// null, it is a pointer to the root of the [RBTree].
| ^^^^ help: try using ` ` (2 spaces)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
= note: -D clippy::doc-overindented-list-items implied by -D warnings
= help: to override -D warnings add #[allow(clippy::doc_overindented_list_items)]

Quoted 8 lines

Thus clean it up.

Cc Yutaro Ohno <[email protected]>
Cc <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes a335e9591404 ("rust: rbtree: add `RBTree::entry`")
Reviewed-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 21 lines · Miguel Ojeda

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have a new lint, doc_overindented_list_items [1], which catches cases of overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928deada1 ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a single case in the kernel, apart from the one already fixed in the commit above:

error: doc list item overindented
--> rust/kernel/rbtree.rs:1152:5
|
1152 | /// null, it is a pointer to the root of the [RBTree].
| ^^^^ help: try using ` ` (2 spaces)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
= note: -D clippy::doc-overindented-list-items implied by -D warnings
= help: to override -D warnings add #[allow(clippy::doc_overindented_list_items)]

Quoted 8 lines

Thus clean it up.

Cc Yutaro Ohno <[email protected]>
Cc <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes a335e9591404 ("rust: rbtree: add `RBTree::entry`")

Hi Miguel,
Nice to see this change so quickly.

Cheers,
Yutaro

Applied
#3 lore raw
In reply to Miguel Ojeda
Quoted 22 lines · Miguel Ojeda

Starting with Rust 1.86.0 (to be released 2025-04-03), Clippy will have a new lint, doc_overindented_list_items [1], which catches cases of overindented list items.

The lint has been added by Yutaro Ohno, based on feedback from the kernel
[2] on a patch that fixed a similar case -- commit 0c5928deada1 ("rust:
block: fix formatting in GenDisk doc").

Clippy reports a single case in the kernel, apart from the one already fixed in the commit above:

error: doc list item overindented
--> rust/kernel/rbtree.rs:1152:5
|
1152 | /// null, it is a pointer to the root of the [RBTree].
| ^^^^ help: try using ` ` (2 spaces)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
= note: -D clippy::doc-overindented-list-items implied by -D warnings
= help: to override -D warnings add #[allow(clippy::doc_overindented_list_items)]

Quoted 8 lines

Thus clean it up.

Cc Yutaro Ohno <[email protected]>
Cc <[email protected]> # Needed in 6.12.y and 6.13.y only (Rust is pinned in older LTSs).
Fixes a335e9591404 ("rust: rbtree: add `RBTree::entry`")

Applied to rust-fixes -- thanks everyone!

[ There are a few other cases, so updated message. - Miguel ]

Cheers,
Miguel