Documentation: rust: add coding guidelines on lints
authorMiguel Ojeda <ojeda@kernel.org>
Wed, 4 Sep 2024 20:43:44 +0000 (22:43 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 7 Oct 2024 19:39:57 +0000 (21:39 +0200)
commit139d396572ec4ba6e8cc5c02f5c8d5d1139be4b7
treeec65eb0317fbdaa7106ed5438de0ca7a7942d37d
parent624063b9ac97f40cadca32a896aafeb28b1220fd
Documentation: rust: add coding guidelines on lints

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>
Documentation/rust/coding-guidelines.rst