For a rustup-managed installation, rustup self uninstall is the documented full-removal command. If you only want to remove one toolchain or a Cargo-installed command-line app, use that narrower operation instead—and first check whether Homebrew owns a separate Rust installation.

“Remove Rust” can mean removing a compiler, the version manager, or a binary that happened to be written in Rust. Confusing those jobs is how a small cleanup becomes a broken developer setup or the loss of a utility you still use.

Identify the installation owner before choosing a command

Start with these read-only shell checks:

type -a rustup rustc cargo
printf 'RUSTUP_HOME=%s\n' "${RUSTUP_HOME:-not explicitly set}"
printf 'CARGO_HOME=%s\n' "${CARGO_HOME:-not explicitly set}"
printf 'CARGO_INSTALL_ROOT=%s\n' "${CARGO_INSTALL_ROOT:-not explicitly set}"

The rustup installation documentation says it installs standard tools into Cargo's bin directory, normally $HOME/.cargo/bin on Unix. That is also where cargo install normally puts Rust programs and Cargo plugins.[1] One directory can therefore contain both toolchain entry points and third-party utilities.

The environment-variable reference defines RUSTUP_HOME, normally ~/.rustup, as the home for toolchains and configuration. The installation documentation also supports customizing CARGO_HOME.[2][1] An unset variable means you should check the documented default, not assume every Rust-related file on your Mac is there.

If Homebrew is installed, inspect it separately:

type -a brew
# Example only: use the absolute executable you identified above.
BREW_BIN=/opt/homebrew/bin/brew
"$BREW_BIN" --prefix
"$BREW_BIN" list --formula

The Homebrew manual documents prefix inspection, formula listing, and package-specific uninstall commands.[5] Look for the actual package names installed, not just a filename resembling Rust. The first cargo in your shell path does not rule out a second installation later in that path.

Use the absolute BREW_BIN you inventoried, and confirm its reported prefix before removal. Homebrew's usual Apple Silicon prefix is /opt/homebrew; Intel (including a separate Rosetta installation on Apple Silicon) normally uses /usr/local. These are examples, not a hardware-based instruction to pick one. If both exist, inventory /opt/homebrew/bin/brew and /usr/local/bin/brew separately with --prefix and list --formula, then keep the executable that owns the intended formula. Stop if the prefix differs from the installation you intended. Do not switch to a bare brew command later.[5][8]

Decide which of these three jobs you need

  1. Remove one old toolchain: retain rustup and your other compiler versions.
  2. Remove one installed binary package: retain Rust and Cargo, remove a utility installed with Cargo.
  3. Remove the rustup-managed installation: give up that manager and its installed tooling, after reviewing everything stored under its homes.

If the problem is merely space from builds or downloads, uninstalling the runtime may be unnecessary. Inventory local-only build inputs and dependencies before choosing a separate cleanup workflow. This article focuses on ownership and removal, not a promise to reclaim a particular number of gigabytes.

Remove one toolchain, not the entire manager

Read the installed toolchains and project selection before choosing a removal target. The rustup examples document rustup show for the toolchain used in the current directory and rustup toolchain uninstall nightly for removing a given toolchain.[6]

Inventory installed toolchains and the selection for the current project:

rustup toolchain list
rustup show

The official CLI source defines toolchain list as “List installed toolchains.”[9] Use the previously identified rustup executable and the same recorded home variables; stop if a path is ambiguous. Inspect each relevant project's rust-toolchain.toml or rust-toolchain file. A project can require a toolchain different from your global default. The override documentation describes project files, directory overrides, and RUSTUP_TOOLCHAIN as separate selection mechanisms.[7]

Once you have confirmed that an installed nightly is no longer needed, the official example is:

rustup toolchain uninstall nightly

This is a removal command, not a preview. Use the exact installed toolchain identifier for your own case; do not remove nightly just because it appears in this example. If a project still pins it, expect that project to need the toolchain again. Do not delete its pin merely to silence an error: it may encode a genuine compatibility requirement.

Custom linked toolchains need their own ownership review. Rustup's examples include linking an existing external installation.[6] Do not assume removing a registration guarantees removal of the external compiler directory.

Remove a Cargo-installed utility with Cargo

To list installed binary packages without installing a new one, use:

cargo install --list

The Cargo install reference documents that listing option. For a custom installation root, make it explicit after identifying it:

cargo install --list --root /absolute/identified/cargo-install-root

That absolute path is a placeholder: replace it with your inspected root. Use the inventoried Cargo executable. One root's list is not a filesystem-wide inventory; record each root separately.[4]

The Cargo uninstall reference says cargo uninstall removes a package installed by cargo install. Its example is:

cargo uninstall --root /absolute/identified/cargo-install-root ripgrep

Run that only if Cargo installed ripgrep into the root you intend to change and you no longer want it. It is not a Rust compiler uninstall command. By default it removes that crate's installed binaries; the documented --bin option can limit removal to a particular binary.[3]

Cargo's installation-root precedence matters: an explicit --root, then CARGO_INSTALL_ROOT, then install.root configuration, then CARGO_HOME, then $HOME/.cargo.[3] A custom root can hold a utility outside the usual Cargo home. Likewise, a Homebrew-installed utility is not owned by Cargo just because it is written in Rust or uses the same executable name.

Before full rustup removal, preserve what is not disposable

Back up your project repositories, including uncommitted work and local-only data. Preserve manifests, lockfiles, toolchain pins, and any configuration needed to rebuild. Keep source separate from toolchain homes, and inspect custom homes for files you placed there yourself.

Also record the installed utility list and inspect Cargo configuration before you remove the tools needed to read it. If you keep private-registry credentials or other sensitive configuration in the Cargo home, preserve only what you need in secure backup storage. Do not paste those files into a support ticket or a public uninstall checklist.

A compiler removal is not a migration for projects that depend on it. If you are switching to a different installation, verify that setup with the projects you still use before removing the old one. A working editor window is not proof that its selected compiler path will remain valid.

Remove rustup—or the Homebrew package that actually owns Rust

After inventory and backup, the rustup book documents:

rustup self uninstall

This is destructive, not a Trash operation. The retrieved upstream implementation deletes RUSTUP_HOME, deletes non-bin entries in CARGO_HOME, and removes rustup and its tool links from CARGO_HOME/bin; it removes the remaining bin/home directories only when empty.[10] This includes configuration, caches, and install metadata outside bin. Custom homes are in scope too: restore the recorded RUSTUP_HOME and CARGO_HOME values in the removal shell and use the identified rustup executable. Do not unset them and accidentally target defaults.

The source is evidence for that retrieved revision, not a guarantee for your installed version. Even where unrelated binaries remain, their metadata or dependencies may not. Securely back up needed files and credentials, retain the utility/root inventory, and plan reinstallations. No source, utility, or custom-home survival guarantee is made. Review the confirmation and stop if ownership is unclear.[1][10]

Do not substitute a broad deletion of .cargo or .rustup. Custom homes and shared contents make guessed-path removal unreliable, and this guide makes no guarantee that one command removes every Rust-related file on the Mac.

For a separately confirmed Homebrew rust formula, the package-specific path is:

"$BREW_BIN" --prefix
"$BREW_BIN" list --formula
"$BREW_BIN" uninstall rust

Compare the prefix to your recorded owning prefix and confirm rust in that executable's formula list before running the last line. Stop on a mismatch. It is not a command to remove arbitrary rustup toolchains. If Homebrew reports dependencies, review them instead of forcing removal or suppressing the check.[5]

Check a fresh shell, then stop at the intended boundary

Open a new Terminal session and repeat type -a rustup rustc cargo. Review your startup files for entries pointing to a removed Cargo home or its environment script. Preserve entries still needed by retained tools; do not strip every mention of Cargo indiscriminately.

If Rust still resolves, identify its path. A separate Homebrew compiler or another custom installation can remain after removing rustup. Conversely, a remaining standalone utility does not prove the compiler remains installed. Verify the specific layer you intended to remove.

For GUI apps, our complete app-uninstall guide covers a different workflow. SwoopByte Uninstaller is still in development; its planned Pro toolchain removal includes Rust, with detection and sizes free. That is not a backup or deletion-completeness guarantee. Join its waitlist if the planned toolchain review interests you.

FAQ

Does cargo uninstall remove Cargo itself?

No. It removes packages installed with cargo install, such as an installed command-line utility. Rustup or the owning package manager handles the compiler/tooling layer.[3]

Can I remove nightly while keeping stable?

Yes, use the scoped toolchain operation after checking project pins and overrides. The official rustup examples show removing nightly without self-uninstalling rustup.[6][7]

Will rustup removal delete my project source?

Keep repositories backed up and outside the installation homes. Do not promise source preservation based only on the command name: custom homes may contain user files, and projects can still stop building after their compiler is removed.

Why does rustc still exist after uninstalling rustup?

Inspect its path. A separate Homebrew or custom installation may supply it. Rustup removal is not proof that every independently installed compiler has been removed.

Are all Cargo-installed utilities inside ~/.cargo/bin?

No. Cargo supports custom installation roots with documented precedence. Check the relevant root before listing or uninstalling a package.[3][4]

Sources

[1] Official source [2] Official source [3] Official source [4] Official source [5] Official source [6] Official source [7] Official source [8] Official upstream documentation/source [9] Official upstream documentation/source [10] Official upstream documentation/source