I don't want to use anything but the stable toolchain for my normal work but would like to be able to debug my macros using cargo expand
. I don't even now how to use anything but the default stable toolchain.
How to install +nightly?
Asked Answered
All explained in the How Rust is Made and “Nightly Rust” appendix to The Rust Programming Language. –
Arrive
You can install nightly rust with rustup toolchain install nightly
, then you can run cargo
as nightly with rustup run nightly cargo [...more arguments here]
or cargo +nightly [...more arguments here]
. If you want your normal cargo
command to be replaced with nightly as well then you can run rustup default nightly
.
On Alpine Linux,
apk add rustup
then
rustup-init
followed by y, x86_64-unknown-linux-musl, nightly, default and finally 1 and y to do the interactive installation.
refresh shell with source "$HOME/.cargo/env"
and now it would build.
PS: I'll update the answer with a non interactive option.
Installing Rust via <insert your OS package manager here> is not recommended. Install it from
rustup
from the official site. –
Assessment © 2022 - 2025 — McMap. All rights reserved.