Rust CLI Cheat Sheet/Run Cargo with a specific toolchain

Use toolchain shorthand for one command.

Section: Bootstrap and versions

Run Cargo with a specific toolchain

bash
bash
cargo +nightly --version
Explanation

Cargo supports `+toolchain` shorthand when installed via rustup.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Bootstrap and versions
Set stable as default toolchain
Use stable globally unless overridden.
OpenIn sheetbashsame section
Show rustup version
Print the rustup version.
OpenIn sheetbashsame section
Show Cargo version
Print the active Cargo version.
OpenIn sheetbashsame section
Update Rust toolchains
Update installed toolchains and rustup itself.
OpenIn sheetbashsame section
Show rustc version
Print the active Rust compiler version.
OpenIn sheetbashsame section
Create a new binary crate
Generate a new package for an executable.
OpenIn sheetbash1 tag match