Skip to content

Cargo unpacked sources

Last updated 1 November 2026

What it is, where it lives on your Mac, and whether it’s safe to delete.

Check before deleting

Usually, but look first. Cargo unpacks crates again from its cache on the next build.

Where it is

~/.cargo/registry/src

What it is

Cargo unpacks each downloaded crate here before building; it unpacks them again from registry/cache when they're gone.

Kept while cargo, rustc or rust-analyzer runs (rust-analyzer reads these sources live) and for 30 days after the last change. Review only: unpacking again takes time.

Is it safe to delete?

Usually, but look first. Cargo unpacks crates again from its cache on the next build.

How big is it?

In Terminal, this shows its size without changing anything:

du -sh "$HOME/.cargo/registry/src"

How to remove it

  1. Quit cargo, rustc, rust-analyzer first.
  2. In Finder, choose Go > Go to Folder (Shift-Command-G), paste the path above and press Return.
  3. Leave anything opened or changed less than 30 days ago (for a folder, its newest file counts). DiskCity waits that long too.
  4. Move only what passes these checks to the Trash.
  5. Empty the Trash to get the space back. Until then, you can still put things back.

What DiskCity does with it

DiskCity labels it as rebuildable and removes it only when you approve. It only suggests it once it hasn't been used for 30 days. It waits until cargo is closed.

Sources

Checked 2026-10-24.