Diskzyv0.1
Delete with care

What is ~/.rustup/toolchains on Mac? Can you delete it?

Short answer

You can remove toolchains you no longer use, but do it with rustup and keep the one your projects build with. Each folder is a complete Rust compiler and standard library, not a cache.

Where it is

~/.rustup/toolchains

What it is

rustup is the installer and version manager for Rust. Every toolchain it installs, such as stable, beta, a nightly from a certain date or a pinned version number, gets its own folder in ~/.rustup/toolchains with the compiler, Cargo, the standard library and any extra targets and components.

It grows because projects can pin a specific toolchain in a rust-toolchain file, and rustup installs that version automatically the first time you build. Dated nightlies and old pinned versions then stay on disk.

This is separate from ~/.cargo, which holds downloaded crates and the tools you installed with cargo install.

How big it gets

Each toolchain takes from several hundred MB to more than a GB, so a handful of old ones adds up to several GB.

How to clear it by hand

  1. Run the command below to list the installed toolchains. The one marked as default is the one used when a project does not ask for another.
  2. Remove one you do not need with rustup toolchain uninstall followed by its name, exactly as shown in the list.
  3. Keep stable, or whichever toolchain is your default, and any version a current project pins.
  4. Do not drag folders out of ~/.rustup/toolchains in Finder. Using rustup keeps its records correct.
In Terminal
rustup toolchain list

What happens afterwards

A removed toolchain is downloaded again automatically if a project asks for it, which needs the network and takes a few minutes. Your source code and downloaded crates are not affected.

How Diskzy handles it

Diskzy shows ~/.rustup on the disk map with the size of each toolchain, so old ones are easy to spot before you remove them with rustup. The Cargo cache next to it is listed in the Clean up tab.

Related guides

See where your Mac's space went

Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.

Try Diskzy for free
Read this in:EnglishEspañolDeutschPortuguêsFrançaisTürkçe日本語