Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: programming-language: add Rust programming language section

Following the C text in the file, add a mention about the Rust
programming language, the currently supported compiler and
the edition used (similar to the "dialect" mention for C).

Similarly, add a mention about the unstable features used (similar
to the "extensions" mentions for C).

In addition, add some links to complement the information.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/r/20230306191712.230658-2-ojeda@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Miguel Ojeda and committed by
Jonathan Corbet
0b02076f 38484a1d

+18 -1
+18 -1
Documentation/process/programming-language.rst
··· 31 31 32 32 Please refer to ``include/linux/compiler_attributes.h`` for more information. 33 33 34 + Rust 35 + ---- 36 + 37 + The kernel has experimental support for the Rust programming language 38 + [rust-language]_ under ``CONFIG_RUST``. It is compiled with ``rustc`` [rustc]_ 39 + under ``--edition=2021`` [rust-editions]_. Editions are a way to introduce 40 + small changes to the language that are not backwards compatible. 41 + 42 + On top of that, some unstable features [rust-unstable-features]_ are used in 43 + the kernel. Unstable features may change in the future, thus it is an important 44 + goal to reach a point where only stable features are used. 45 + 46 + Please refer to Documentation/rust/index.rst for more information. 47 + 34 48 .. [c-language] http://www.open-std.org/jtc1/sc22/wg14/www/standards 35 49 .. [gcc] https://gcc.gnu.org 36 50 .. [clang] https://clang.llvm.org ··· 52 38 .. [gnu-extensions] https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html 53 39 .. [gcc-attribute-syntax] https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html 54 40 .. [n2049] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2049.pdf 55 - 41 + .. [rust-language] https://www.rust-lang.org 42 + .. [rustc] https://doc.rust-lang.org/rustc/ 43 + .. [rust-editions] https://doc.rust-lang.org/edition-guide/editions/ 44 + .. [rust-unstable-features] https://github.com/Rust-for-Linux/linux/issues/2