Rustup toolchains taking up space on your Mac? What's safe to delete

Yes, but read this firstDiskmack safety tier: Caution
~/.rustup/toolchains

Yes, you can reclaim this space, but remove toolchains with rustup itself, not by dragging folders to the Trash. Every Rust compiler version you have ever installed lives in ~/.rustup/toolchains, and each one is often more than a gigabyte once documentation is included. Keep the toolchain you actually build with, uninstall the rest, and rustup will re-download anything a project needs later.

What it is

rustup is Rust's installer and version manager. Every time you try a dated nightly, install a pinned version, or run cargo in a project whose rust-toolchain file demands a specific compiler, rustup drops a complete toolchain into ~/.rustup/toolchains. A toolchain is not just the rustc compiler. It bundles cargo, the standard library, and components like clippy and rustfmt, plus the rust-docs component, which alone is around 700 MB per toolchain.

The folder grows because nothing in it is removed automatically. The stable channel updates in place, so plain stable stays a single folder, but every pinned version (say 1.72.0) and every dated nightly (nightly-2024-03-11 and friends) gets its own full install and sits there forever. Work through a few projects that each pin their own compiler, or experiment with nightlies for a while, and this directory quietly climbs to several gigabytes, sometimes past 10 GB on heavy setups.

Is it safe to delete?

Old toolchains are safe to remove as long as you keep the one you actually use. Run rustup toolchain list in Terminal: your active one is marked (default). Everything else, dated nightlies you tried once, superseded pinned versions, is fair game. If a project turns out to need a toolchain you removed, rustup re-downloads it on demand, so the worst case is a slow first build, not a broken Rust install.

The one thing to avoid is deleting folders inside ~/.rustup/toolchains by hand in Finder. rustup owns this directory, and rustup toolchain uninstall removes a toolchain cleanly, including its entry in rustup's own bookkeeping. Manual deletion usually works but can leave rustup confused about what is installed. Diskmack identifies this folder automatically and cleans it the safe way.

How to check its size

In Finder: In Finder, choose Go > Go to Folder (Shift-Command-G), type ~/.rustup/toolchains and press Return. Select everything inside (Command-A), then press Command-Option-I to see the combined size. To size a single toolchain, click its folder and press Command-I.

In Terminal:

du -sh ~/.rustup/toolchains

Append /* to the path, as in du -sh ~/.rustup/toolchains/*, to size each toolchain separately.

How to clean it

  1. Open Terminal and run: rustup toolchain list. The toolchain marked (default) is the one your builds use. Keep it.
  2. Uninstall each toolchain you no longer need: rustup toolchain uninstall nightly-2024-03-11-aarch64-apple-darwin (swap in the exact name from your list).
  3. If you want to keep a toolchain but drop its offline documentation, run: rustup component remove rust-docs. That targets your default toolchain and frees around 700 MB. For any other toolchain, add --toolchain and its exact name from the list.
  4. Run rustup toolchain list again to confirm, then check the result with du -sh ~/.rustup/toolchains.

The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.

rustup toolchain list (remove old ones)

Removing your default toolchain leaves you without a working rustc until you install a replacement, so keep the default unless you are removing Rust entirely (that job belongs to rustup self uninstall).

Will it come back?

Yes, and that is by design. rustup installs toolchains on demand: update to a new stable, test a nightly, or build a project with a rust-toolchain.toml pin, and the matching toolchain lands right back in this folder. Nightly users regrow it fastest, since each dated nightly is its own full install. A quick rustup toolchain list every few months, followed by uninstalling the strays, keeps the folder honest.

Common questions

Can I just drag ~/.rustup/toolchains to the Trash?

You can, and rustup will re-download what you need the next time you build, but you lose every toolchain at once, including your default, and the re-download runs a gigabyte or more. Use rustup toolchain uninstall to remove only the dead weight.

How big is one Rust toolchain?

Usually 1 to 2 GB installed. The rust-docs component alone is around 700 MB per toolchain, and components like clippy and rustfmt add more on top of the compiler and standard library.

Will removing old toolchains break my projects?

Not permanently. If a project pins a version through rust-toolchain.toml or a rust-toolchain file, rustup notices on your next cargo command and re-downloads that exact toolchain. The first build after that waits on the download, and that is the whole cost.

How do I remove Rust from my Mac completely?

Run rustup self uninstall. It removes the whole ~/.rustup directory, toolchains included, along with the cargo shims rustup installed. That is cleaner than deleting the folders by hand, which leaves stray PATH entries in your shell profile.

Related folders