]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: enable Clippy's `check-private-items`
authorMiguel Ojeda <ojeda@kernel.org>
Fri, 7 Mar 2025 22:49:21 +0000 (23:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:01:42 +0000 (13:01 +0100)
commit87052e24eb46815a9f89696fe4c520430fea409e
tree207d4333337692be8711b59c420730866c6947c0
parent9dd2e0358b03e1061c197bc1f6dec1a62a42975f
rust: enable Clippy's `check-private-items`

commit 624063b9ac97f40cadca32a896aafeb28b1220fd upstream.

In Rust 1.76.0, Clippy added the `check-private-items` lint configuration
option. When turned on (the default is off), it makes several lints
check private items as well.

In our case, it affects two lints we have enabled [1]:
`missing_safety_doc` and `unnecessary_safety_doc`.

It also seems to affect the new `too_long_first_doc_paragraph` lint [2],
even though the documentation does not mention it.

Thus allow the few instances remaining we currently hit and enable
the lint.

Link: https://doc.rust-lang.org/nightly/clippy/lint_configuration.html#check-private-items
Link: https://rust-lang.github.io/rust-clippy/master/index.html#/too_long_first_doc_paragraph
Reviewed-by: Trevor Gross <tmgross@umich.edu>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240904204347.168520-16-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
.clippy.toml
rust/kernel/init.rs
rust/kernel/init/__internal.rs
rust/kernel/init/macros.rs
rust/kernel/print.rs