Skip to content

Commit 329fa50

Browse files
committed
Add entry to unstable.md
1 parent 8250a90 commit 329fa50

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/doc/src/reference/unstable.md

+18
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Each new feature described below should explain how to use it.
9191
* [checksum-freshness](#checksum-freshness) --- When passed, the decision as to whether a crate needs to be rebuilt is made using file checksums instead of the file mtime.
9292
* [panic-abort-tests](#panic-abort-tests) --- Allows running tests with the "abort" panic strategy.
9393
* [host-config](#host-config) --- Allows setting `[target]`-like configuration settings for host build targets.
94+
* [no-embed-metadata](#no-embed-metadata) --- Passes `-Zembed-metadata=no` to the compiler, which avoid embedding metadata into rlib and dylib artifacts, to save disk space.
9495
* [target-applies-to-host](#target-applies-to-host) --- Alters whether certain flags will be passed to host build targets.
9596
* [gc](#gc) --- Global cache garbage collection.
9697
* [open-namespaces](#open-namespaces) --- Allow multiple packages to participate in the same API namespace
@@ -1914,6 +1915,23 @@ The `-Z rustdoc-depinfo` flag leverages rustdoc's dep-info files to determine
19141915
whether documentations are required to re-generate. This can be combined with
19151916
`-Z checksum-freshness` to detect checksum changes rather than file mtime.
19161917

1918+
## no-embed-metadata
1919+
* Original Pull Request: [#15378](https://github.com/rust-lang/cargo/pull/15378)
1920+
* Tracking Issue: [#15495](https://github.com/rust-lang/cargo/issues/15495)
1921+
1922+
The default behavior of Rust is to embed crate metadata into `rlib` and `dylib` artifacts.
1923+
Since Cargo also passes `--emit=metadata` to these intermediate artifacts to enable pipelined
1924+
compilation, this means that a lot of metadata ends up being duplicated on disk, which wastes
1925+
disk space in the target directory.
1926+
1927+
This feature tells Cargo to pass the `-Zembed-metadata=no` flag to the compiler, which instructs
1928+
it not to embed metadata within rlib and dylib artifacts. In this case, the metadata will only
1929+
be stored in `.rmeta` files.
1930+
1931+
```console
1932+
cargo +nightly -Zno-embed-metadata build
1933+
```
1934+
19171935
# Stabilized and removed features
19181936

19191937
## Compile progress

0 commit comments

Comments
 (0)