rustup & Toolchain Management
rustup installs and switches Rust toolchains, components (clippy, rustfmt), and cross-compilation targets. It is the supported way to manage Rust on developer machines and CI.
Busca en todas las páginas de la documentación
rustup installs and switches Rust toolchains, components (clippy, rustfmt), and cross-compilation targets. It is the supported way to manage Rust on developer machines and CI.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
rustup toolchain install 1.97.0
rustup component add rustfmt clippy rust-analyzer
rustup target add wasm32-unknown-unknownWhen to reach for this:
# rust-toolchain.toml (repo root)
[toolchain]
channel = "1.97.0"
components = ["rustfmt", "clippy"]
targets = ["x86_64-unknown-linux-gnu"]cd my-repo
rustc --version # 1.97.0 via override
cargo clippyWhat this demonstrates:
rust-toolchain.toml auto-selects toolchain in directorydtolnay/rust-toolchain| Channel | Use |
|---|---|
stable | Production MSRV alignment |
beta | Preview upcoming stable |
nightly | Miri, unstable features |
rustup set profile minimal on CI agents; default on dev laptops includes rust-docs.
apt install rustc - ancient version. Fix: rustup only; remove apt rust.clippy not found. Fix: rustup component add clippy.rust-toolchain.toml.rustup toolchain list and prune old.| Alternative | Use When | Don't Use When |
|---|---|---|
| Nix flake | Reproducible dev shells | Team has no Nix |
| Docker dev image | Identical CI/dev | Native IDE speed preferred |
asdf rust plugin | Polyglot version managers | Standard rustup suffices |
rustup toolchain uninstall 1.75.0
Ensure VS Code uses rustup rust-analyzer component, not standalone binary mismatch.
Each repo's rust-toolchain.toml applies on cd.
Stack versions: This page was written for Rust 1.97.0 (edition 2024), Tokio 1.x, Axum 0.8, serde 1.0, sqlx 0.8, clap 4, and Polars 0.46+.
Revisado por Chris St. John·Última actualización: 16 jul 2026