Skip to content

Commit

Permalink
doc/rust: Update to cover beta installation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Apr 7, 2022
1 parent 0712d59 commit c9c9e8f
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions doc/doxygen/src/using-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,26 @@ Toolchain {#toolchain}

To install the necessary Rust components, it is easiest use [**rustup**, installed as described on its website].

Using most of Rust on RIOT requires a nightly version of Rust,
because some transpiled expressions for RIOT make use of unstable features,
and because the RIOT wrappers use some unstable idioms.
Using Rust on RIOT needs the latest beta or nightly version of Rust,
depending on the precise example used.
(On ARM Cortex the beta examples even work with stable Rust 1.59,
but that is not regularly tested).

@note
Building on stable is supported for some examples and platforms starting with Rust 1.59
(e.g., the rust-hello-world on any ARM Cortex, but not yet on native).
Try it out by adding `CARGO_CHANNEL=stable` to the project's Makefile;
where it doesn't work, rustc will complain that "`#![feature]` may not be used on the stable release channel".

@note
A stable version of Rust is not currently provided with the Docker images;
consequently, builds on stable are not tested as regularly as builds on nightly.

Make sure you have both the nightly **toolchain**
Make sure you have both the nightly and beta **toolchains**
and the core library for the CPU (**target**) of your choice available:

```
$ rustup toolchain add nightly
$ rustup toolchain add beta
$ rustup target add thumbv7m-none-eabi --toolchain nightly
$ rustup target add thumbv7m-none-eabi --toolchain beta
```

(Substitute thumbv7m-none-eavi with the value of `RUST_TARGET`
Substitute thumbv7m-none-eabi with the value of `RUST_TARGET`
in the output of `make info-build` of an application that has your current board selected,
or just add it later whenever the Rust compiler complains about not finding the core library for a given target).
Installing only nightly will work just as well,
but you will need to adjust examples' `CARGO_CHANNEL = beta` lines with a reference to nightly.


While Rust comes with its own [cargo] dependency tracker for any Rust code,
Expand Down

0 comments on commit c9c9e8f

Please sign in to comment.