Lines Matching +full:trigger +full:- +full:sources
1 .. SPDX-License-Identifier: GPL-2.0
10 ------------------
27 the entire kernel Rust sources is needed at some point, the following can be
37 Like ``clang-format`` for the rest of the kernel, ``rustfmt`` works on
43 --------
51 .. code-block:: rust
60 .. code-block:: rust
73 .. code-block:: rust
84 pub fn f(x: i32) -> Foo {
90 correct/sound, i.e. why it cannot trigger undefined behavior in any case, e.g.:
92 .. code-block:: rust
106 ------------------
108 Rust kernel code is not documented like C kernel code (i.e. via kernel-doc).
117 This is how a well-documented Rust function may look like:
119 .. code-block:: rust
128 /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
136 pub unsafe fn unwrap_unchecked(self) -> T {
148 - The first paragraph must be a single sentence briefly describing what
151 - Unsafe functions must document their safety preconditions under
154 - While not shown here, if a function may panic, the conditions under which
161 - If providing examples of usage would help readers, they must be written in
164 - Rust items (functions, types, constants...) must be linked appropriately
167 - Any ``unsafe`` block must be preceded by a ``// SAFETY:`` comment
178 https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html
183 .. code-block:: rust
189 .. code-block:: rust
195 ------
199 https://rust-lang.github.io/api-guidelines/naming.html
211 .. code-block:: c
218 .. code-block:: rust
233 -----
242 .. code-block:: c
245 #pragma GCC diagnostic ignored "-Wunused-function"
255 .. code-block:: rust
270 .. code-block:: rust
278 --> x.rs:3:10
288 - Temporary attributes added while developing.
290 - Improvements in lints in the compiler, Clippy or custom tools which may
293 - When the lint is not needed anymore because it was expected that it would be
301 - Conditional compilation triggers the warning in some cases but not others.
304 trigger) compared to the total number of cases, then one may consider using
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
328 .. code-block:: rust
339 configuration. Therefore, in cases like this, we cannot use ``expect`` as-is.
343 .. code-block:: rust
355 .. code-block:: rust
371 triggered due to non-local changes (such as ``dead_code``).
375 https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html