Rustup guide

Rustup on Windows — manage Rust toolchains, targets & components

rustup is the official Rust toolchain installer and version manager for Windows. It installs rustc (compiler), cargo (build system), and manages multiple toolchain versions, targets and components from the command line.

Essential rustup commands on Windows

PowerShell
# Update Rust to latest stable:
PS> rustup update
# Show installed toolchains:
PS> rustup show
# Install a specific version:
PS> rustup install 1.78.0
# Switch default toolchain:
PS> rustup default stable
# Add a compilation target:
PS> rustup target add x86_64-unknown-linux-musl
# Add a component (e.g. clippy, rustfmt):
PS> rustup component add clippy rustfmt

Manage toolchain channels on Windows

stable
The default recommended channel. Released every 6 weeks. Use for production.
beta
Next stable release candidate. Updated weekly.
nightly
Latest development build. New features first, less stable. Updated daily.
PowerShell
# Install nightly (for features like async traits):
PS> rustup install nightly
PS> rustup default nightly
# Use nightly for just one project:
PS> rustup override set nightly
# (run from inside the project directory)

Rust targets on Windows

TargetLinkerUse when
x86_64-pc-windows-msvcMSVC link.exeDefault — native Windows development
x86_64-pc-windows-gnuGNU ld (via MSYS2)No Visual Studio, cross-platform codebase
i686-pc-windows-msvcMSVC 32-bit32-bit Windows binaries
aarch64-pc-windows-msvcMSVC ARM64Windows on ARM devices

Rustup questions

How to update Rust on Windows?

Run rustup update in PowerShell. This updates all installed toolchains to their latest patch release. Rust releases a new stable version every 6 weeks. rustup also updates itself automatically.

How to uninstall Rust on Windows?

Run rustup self uninstall. This removes rustup, all toolchains, cargo and their configuration. It does not remove projects you created or packages installed with cargo install into custom locations.

rustup is very slow on Windows — how to speed it up?

rustup downloads from static.rust-lang.org. If downloads are slow, set the RUSTUP_DIST_SERVER environment variable to a closer mirror. The Tuna mirror (China) and other regional mirrors are listed at forge.rust-lang.org/infra/mirrors.html.