Is it safe to delete Rust target folder?

<project>/target · Safe to delete

What it is

Cargo's build output for a Rust project: compiled dependencies, incremental data and binaries.

Can you delete it?

Yes, it is rebuilt automatically. cargo build recreates it. Note: Maven Java projects also use a folder called target, also build output.

How to clean it safely

  1. Check the project has no work you need: git status
  2. In the project, run: cargo clean

Step-by-step guide: Rust target folders →

Questions

Is it safe to delete <project>/target?

Yes, it is rebuilt automatically. cargo build recreates it. Note: Maven Java projects also use a folder called target, also build output.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.

Download for Mac