]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Documentation: rust: add coding guidelines on lints
authorMiguel Ojeda <ojeda@kernel.org>
Fri, 7 Mar 2025 22:49:22 +0000 (23:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:01:42 +0000 (13:01 +0100)
commita24a26adbaaf829a1aeac524dc490a8fd5768bab
tree147c444e7df25663a2258d5becd82d0c873b6021
parent87052e24eb46815a9f89696fe4c520430fea409e
Documentation: rust: add coding guidelines on lints

commit 139d396572ec4ba6e8cc5c02f5c8d5d1139be4b7 upstream.

In the C side, disabling diagnostics locally, i.e. within the source code,
is rare (at least in the kernel). Sometimes warnings are manipulated
via the flags at the translation unit level, but that is about it.

In Rust, it is easier to change locally the "level" of lints
(e.g. allowing them locally). In turn, this means it is easier to
globally enable more lints that may trigger a few false positives here
and there that need to be allowed locally, but that generally can spot
issues or bugs.

Thus document this.

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-17-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/rust/coding-guidelines.rst