Overview
rustup is the official installer and version multiplexer: it installs toolchains
(a compiler + stdlib + core tools for one channel and host triple), switches between
them, adds optional components and cross-compilation targets, and shims cargo/rustc
so the right toolchain answers per directory. It is the piece the Go world lacked until
the 1.21 toolchain directive and the JVM world solves with third-party managers
(SDKMAN!, jenv) — here it is first-party and assumed by all documentation.
Key points
- Channels:
stable(a release every six weeks),beta(the next stable, soaking),nightly(built daily, the only place#![feature(...)]gates work). Update all withrustup update. - The shims:
~/.cargo/bin/cargoand friends are rustup proxies that resolve which real toolchain to run — which is whyrustup override,rust-toolchain.tomlandcargo +nightly …all work without touchingPATH. rust-toolchain.tomlat the repo root pins channel, components and targets for everyone who clones — the reproducibility move; teammates and CI get the exact toolchain automatically on firstcargoinvocation.- Components:
rustfmt,clippy,rust-analyzer,miri(nightly only),rust-src(needed by rust-analyzer and-Zbuild-std),llvm-tools— added per toolchain withrustup component add. - Targets:
rustup target add x86_64-unknown-linux-muslinstalls a pre-built standard library for another triple — half of Rust's cross-compilation story; the other half (a linker) is yours to provide. - Pinned toolchains:
rustup toolchain install 1.85.0andchannel = "1.85.0"inrust-toolchain.toml— how MSRV-sensitive projects and reproducible builds pin exactly. - There is no "series" channel — and this bites anyone automating pins. A channel
(
stable) or an exact version (1.85.0) are the only two spellings; "latest 1.85.x" cannot be expressed. So a project wanting major-only pinning has to takestable, which floats across majors too, and accept that its Rust version is "current stable by construction" rather than a series it controls. Most other version managers resolve a prefix; rustup is the outlier. rustup docopens the offline copy of the book, reference and stdlib docs matching your installed version — underused and excellent on trains.
Examples
# rust-toolchain.toml — committed at the repo root
[toolchain]
channel = "1.85.0"
components = ["rustfmt", "clippy"]
targets = ["x86_64-unknown-linux-musl"]
rustup update # all installed toolchains
cargo +nightly expand # one-off run on another toolchain
rustup component add miri --toolchain nightly
rustup target add wasm32-wasip1
Related
- The Rust toolchain — parent catalog; where rustup sits in the whole picture.
- How Rust evolves — the release train and feature gates the channels implement.
- cargo — the tool the shims dispatch to.
- Building & releasing — targets in anger: cross-compilation and static musl builds.
- Version managers — rustup's place among the ecosystem-native managers, and the universal ones that can replace it.