Description
Describe the problem you are trying to solve
I try to run an example from https://github.com/Rahix/avr-hal.
$ cargo +nightly-2021-01-07 run --example leonardo-blink
Output:
error: "/home/<redacted>/.rustup/toolchains/nightly-2021-01-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add rust-src
So I try the suggested fix:
$ rustup component add rust-src
Output:
info: component 'rust-src' is up to date
After a while I realised that the last command tries to install the component for the default toolchain instead of the nightly toolchain. This is the first time I use a toolchain other than the default, and therefore the first time I use rustup
.
Entering the following command solved the issue:
$ rustup component add --toolchain nightly-2021-01-07 rust-src
Describe the solution you'd like
It would be much clearer to include the toolchain specification in the suggested command.
$ cargo +nightly-2021-01-07 run --example leonardo-blink
Desired output:
error: "/home/<redacted>/.rustup/toolchains/nightly-2021-01-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add --toolchain nightly-2021-01-07 rust-src