mirror-linux/Documentation/rust
Miguel Ojeda 79d04e73ba docs: rust: explain that `///` vs. `//` applies to private items too
Sometimes kernel developers use `//` for documenting private items,
since those do not get rendered at the moment.

That is reasonable, but the intention behind `///` (and `//!`) vs. `//`
is to convey the distinction between documentation and other kinds of
comments, such as implementation details or TODOs.

It also increases consistency with the public items and thus e.g. allows
to change visibility of an item with less changes involved.

It is not just useful for human readers, but also tooling. For instance,
we may want to eventually generate documentation for private items
(perhaps as a toggle in the HTML UI). On top of that, `rustdoc` lints
as usual for those, too, so we may want to do it even if we do not use
the result.

Thus document this explicitly.

Link: https://lore.kernel.org/rust-for-linux/CANiq72n_C7exSOMe5yf-7jKKnhSCv+a9QcD=OE2B_Q2UFBL3Xg@mail.gmail.com/
Link: https://github.com/Rust-for-Linux/linux/issues/1157
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Christian Schrefl <chrisi.schrefl@gmail.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20250416112454.2503872-1-ojeda@kernel.org
[ Fixed typo. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-05-12 00:20:25 +02:00
..
arch-support.rst ARM: 9441/1: rust: Enable Rust support for ARMv7 2025-03-26 13:31:16 +00:00
coding-guidelines.rst docs: rust: explain that `///` vs. `//` applies to private items too 2025-05-12 00:20:25 +02:00
general-information.rst docs: rust: include other expressions in conditional compilation section 2024-09-05 22:45:01 +02:00
index.rst kernel-docs: Add new section for Rust learning materials 2024-10-14 09:50:29 -06:00
quick-start.rst rust: remove leftover mentions of the `alloc` crate 2025-03-05 23:55:56 +01:00
testing.rst Rust changes for v6.15 2025-03-30 17:03:26 -07:00