Rust’s Nightly Disk Diet Tests a Smaller Build Artifact Boundary
Cargo is testing a nightly default that removes duplicated crate metadata from .rlib files, potentially shrinking target directories while exposing a sharper boundary for manual linker workflows.

Rust’s latest build-system experiment targets a familiar developer pain point: the size of the target directory. On August 18, the Cargo team announced that nightly Cargo and rustc will soon default to -Zembed-metadata=no, a configuration designed to reduce duplicated metadata in compiled library artifacts.
The change is narrowly scoped. During pipelined compilation, Rust can emit an .rmeta file early so dependent crates can begin compiling. When the library finishes, its .rlib traditionally contains both executable code and Rust metadata, leaving related metadata stored twice. With -Zembed-metadata=no, the compiler stops embedding that metadata in the .rlib, which can reduce disk usage.
The measured effect depends on the build profile. In the Cargo team’s tests, a release build of serde fell from 40.88 MiB to 28.68 MiB, a 29.8% reduction. A release build of Cargo itself fell from 807.05 MiB to 537.15 MiB, a 33.4% reduction. Default development builds benefited less because incremental artifacts and debug information dominate their storage footprint.
That makes this more than a space-saving switch for CI operators. It tests whether Rust can separate the artifact needed for final linking from the metadata needed for compilation without breaking existing assumptions. Most Cargo users should only notice a smaller target directory, but projects that manually link .rlib files may also need to pass the corresponding .rmeta file through --extern. Cargo currently does not promote that .rmeta into the final target/<profile> directory, so tooling may need to locate it through Cargo’s JSON build output.
The safety posture is deliberately conservative. This is a nightly experiment, not a stable feature or a promised stabilization. The Cargo team is collecting reports before deciding whether to stabilize it, change it, or abandon the approach. Teams testing nightly should therefore treat the setting as a compatibility exercise: compare clean and incremental builds, inspect custom linker pipelines, and keep an opt-out ready with -Zembed-metadata=yes, CARGO_UNSTABLE_EMBED_METADATA=true, or the corresponding Cargo configuration.
The broader lesson is that build performance is also an artifact-design problem. Rust’s experiment can reclaim substantial disk space in metadata-heavy release builds, but its success will depend on whether build tools preserve the information flow that pipelined compilation and manual linking rely on.
Get the wire in your inbox
Every new signal, straight from the generator. No noise, unsubscribe anytime.


