Skip to content

Commit b2b428e

Browse files
committed
Respect the line length limit
Signed-off-by: Miguel Ojeda <[email protected]>
1 parent fd87fe1 commit b2b428e

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

Documentation/rust/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Rust
22
====
33

4-
Documentation related to Rust within the kernel. If you are starting out, read the :ref:`Documentation/rust/quick-start.rst <rust_quick_start>` guide.
4+
Documentation related to Rust within the kernel. If you are starting out,
5+
read the :ref:`Documentation/rust/quick-start.rst <rust_quick_start>` guide.
56

67
.. toctree::
78
:maxdepth: 1

Documentation/rust/quick-start.rst

+19-6
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,56 @@ Quick Start
55

66
This document describes how to get started with Rust kernel development.
77

8+
89
Requirements
910
------------
1011

11-
A recent nightly Rust toolchain (at least ``rustc``, ``cargo`` and ``rustfmt``) is required, e.g. `nightly-2020-08-27`. In the future, this restriction will be lifted. If you are using ``rustup``, run::
12+
A recent nightly Rust toolchain (at least ``rustc``, ``cargo`` and ``rustfmt``)
13+
is required, e.g. ``nightly-2020-08-27``. In the future, this restriction
14+
will be lifted. If you are using ``rustup``, run::
1215

1316
rustup toolchain install nightly
1417

1518
Otherwise, fetch a standalone installer from:
1619

1720
https://www.rust-lang.org
1821

19-
The sources for the compiler are required to be available. If you are using ``rustup``, run::
22+
The sources for the compiler are required to be available. If you are using
23+
``rustup``, run::
2024

2125
rustup component add rust-src
2226

23-
Otherwise, if you used a standalone installer, you can clone the Rust compiler sources and create a symlink to them in the installation folder of your nightly toolchain::
27+
Otherwise, if you used a standalone installer, you can clone the Rust compiler
28+
sources and create a symlink to them in the installation folder of
29+
your nightly toolchain::
2430

2531
git clone https://github.com/rust-lang/rust
2632
ln -s rust .../rust-nightly/lib/rustlib/src
2733

34+
2835
Testing a simple driver
2936
-----------------------
3037

31-
If the kernel configuration system is able to find ``rustc`` and ``cargo``, it will enable Rust support (``CONFIG_HAS_RUST``). In turn, this will make visible the rest of options that depend on Rust.
38+
If the kernel configuration system is able to find ``rustc`` and ``cargo``,
39+
it will enable Rust support (``CONFIG_HAS_RUST``). In turn, this will make
40+
visible the rest of options that depend on Rust.
3241

33-
A simple driver you can compile to test things out is at ``drivers/char/rust_example`` (``CONFIG_RUST_EXAMPLE``). Enable it and compile the kernel with:
42+
A simple driver you can compile to test things out is at
43+
``drivers/char/rust_example`` (``CONFIG_RUST_EXAMPLE``). Enable it and compile
44+
the kernel with:
3445

3546
make LLVM=1
3647

3748
TODO: drop LLVM=1, allowing to mix GCC with LLVM
3849

50+
3951
Avoiding the network
4052
--------------------
4153

4254
You can prefetch the dependencies that ``cargo`` will download by running::
4355

4456
cargo fetch
4557

46-
in the kernel sources root. After this step, a network connection is not needed anymore.
58+
in the kernel sources root. After this step, a network connection is
59+
not needed anymore.
4760

0 commit comments

Comments
 (0)