Lines Matching full:code
6 This document describes how to write Rust code in the kernel.
12 The code should be formatted using ``rustfmt``. In this way, a person
39 even work with broken code.
45 "Normal" comments (i.e. ``//``, rather than code documentation which starts
51 .. code-block:: rust
60 .. code-block:: rust
73 .. code-block:: rust
89 before every ``unsafe`` block, and they explain why the code inside the block is
92 .. code-block:: rust
98 in code documentation. ``# Safety`` sections specify the contract that callers
105 Code documentation
108 Rust kernel code is not documented like C kernel code (i.e. via kernel-doc).
109 Instead, the usual system for documenting Rust code is used: the ``rustdoc``
119 .. code-block:: rust
168 describing why the code inside is sound.
183 .. code-block:: rust
189 .. code-block:: rust
197 Rust kernel code follows the usual Rust naming conventions:
211 .. code-block:: c
218 .. code-block:: rust
242 .. code-block:: c
255 .. code-block:: rust
270 .. code-block:: rust
308 - Inside macros, when the different invocations may create expanded code that
311 - When code may trigger a warning for some architectures but not others, such
316 .. code-block:: rust
325 Here, function ``g()`` is dead code if ``CONFIG_X`` is not set. Can we use
328 .. code-block:: rust
338 This would emit a lint if ``CONFIG_X`` is set, since it is not dead code in that
343 .. code-block:: rust
355 .. code-block:: rust
366 (e.g. unconditionally), then it would be spotted that it is not dead code