A Rust toolchain is 858 MB before you compile anything
Toolchains, the registry cache and a target folder per project. Where each lives on Windows and what is safe.
Rust compiles everything from source and keeps every intermediate artefact so the next build is fast. The result is predictable once you know where it goes.
The three places
Get-ChildItem "$env:USERPROFILE\.rustup\toolchains","$env:USERPROFILE\.cargo" -EA SilentlyContinue |
ForEach-Object {
$s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
'{0,8:N0} MB {1}' -f ($s/1MB), $_.FullName
}
rustup toolchain list
rustup target list --installed| Location | What it is | Typical size |
|---|---|---|
target in each project | Compiled output and dependencies | Hundreds of MB to several GB |
.rustup\toolchains | One full compiler per toolchain | Around 850 MB each |
.cargo\registry | Downloaded crate sources | Tens to hundreds of MB |
Finding every target folder
Get-ChildItem $env:USERPROFILE -Recurse -Directory -Filter target -Depth 5 -EA SilentlyContinue |
Where-Object { Test-Path (Join-Path $_.FullName '..\Cargo.toml') } |
ForEach-Object {
$s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
[PSCustomObject]@{ MB = [math]::Round($s/1MB); Path = $_.FullName }
} | Sort-Object MB -Descending | Select-Object -First 20The test for a Cargo.toml alongside is what stops this matching every other folder called target on a Windows machine, of which there are several.
Toolchains and targets
rustup toolchain uninstall <name>
rustup target remove <triple>Each toolchain is a full compiler and standard library. Installing a nightly to try one feature leaves 850 MB behind indefinitely, and each cross compilation target adds a standard library for a platform you may no longer build for.
The MSVC dependency
Rust on Windows needs the MSVC build tools, which is why a Rust machine also carries the Windows SDK and the linker. That is often larger than Rust itself and is covered in the Windows SDK and build tools.
Common questions
How much space does Rust use on Windows?
A single toolchain measured 858 MB in September 2026, plus a registry cache of 170 MB. Compiled projects are extra and each target folder can be several gigabytes.
Is it safe to delete a Rust target folder?
Yes. Everything in it is regenerated by the next build. Use cargo clean inside the project where you can, since it removes exactly what the build system created.
How do I remove unused Rust toolchains?
rustup toolchain list to see them, then rustup toolchain uninstall with the name. Each is a complete compiler of around 850 MB, so an experimental nightly is worth removing.
Why does Rust need Visual Studio build tools on Windows?
Because the default toolchain links with MSVC. That brings the Windows SDK and linker, which together are often larger than Rust itself.