1.. SPDX-License-Identifier: GPL-2.0
2.. include:: ../disclaimer-zh_CN.rst
3
4:Original: Documentation/rust/general-information.rst
5
6:������:
7
8 ��������� Yanteng Si <siyanteng@loongson.cn>
9
10
11������������
12========
13
14������������������������������������Rust���������������������������������������
15
16
17������������
18--------
19
20Rust��������������������������������������������� ``rustdoc`` ���������������
21
22���������HTML������������������������������������������������������������������������������������������������������������������������
23���TODO���������������������������������������������������������������
24
25	http://kernel.org/
26
27���������������������������������������������������������������������������������������������������������������������������������������
28���������������������������������������������������������������������������������������������������������������������������������������
29��������������� ``rustdoc`` ���������������������������������������������������������::
30
31	make LLVM=1 rustdoc
32
33������������������������������������������������������������������::
34
35	xdg-open rust/doc/kernel/index.html
36
37������������������������������������ coding-guidelines.rst ���
38
39
40���������lints
41-----------
42
43������ ``rustc`` ������������������������������������������������������lints��������������������� ``clippy``
44���������Rust linter������������������������������������CLIPPY=1������������������������������������������������::
45
46	make LLVM=1 CLIPPY=1
47
48������������Clippy���������������������������������������������������������������������������������
49
50���������������
51----------
52
53������������Rust������������������C���������������������
54
55������������������C������������������������������������������������������Rust���������������C���������������������������������
56
57������������������������Rust������������ ``Mutex`` ���������������C��������������� ``Mutex���������`` ������
58������������������������������
59
60������������������������������������������API���������������������������������������������������������������������������Leaf���
61������������������������������������������������������C������������������������������������������������������������������������
62���������������
63
64
65������������������
66------------
67
68Rust������������������������������������������������������:
69
70.. code-block:: rust
71
72	#[cfg(CONFIG_X)]       // Enabled               (`y` or `m`)
73	#[cfg(CONFIG_X="y")]   // Enabled as a built-in (`y`)
74	#[cfg(CONFIG_X="m")]   // Enabled as a module   (`m`)
75	#[cfg(not(CONFIG_X))]  // Disabled
76