rust/src/doc
bors 8c35f4a85e Auto merge of #137535 - Kobzol:split-metadata, r=petrochenkov
Introduce `-Zembed-metadata` to allow omitting full metadata from rlibs and dylibs

This is a continuation of https://github.com/rust-lang/rust/pull/120855 (I was mentored by `@bjorn3` to move it forward). Most of the original code was written by bjorn3, I tried to clean it up a bit and add some documentation and tests.

This PR introduces a new unstable compiler flag called `-Zembed-metadata=[no|yes]`, with the default being `yes` (see https://github.com/rust-lang/rust/issues/57076 for context). When set to `no`, rustc will only store a small metadata stub inside rlibs/dylibs instead of the full metadata, to keep their size smaller. It should be used in combination with `--emit=metadata`, so that the users of such a compiled library can still read the metadata from the corresponding `.rmeta` file. [This comment](https://github.com/rust-lang/rust/pull/120855#issuecomment-1937018169) shows an example of binary/artifact size wins that can be achieved using this approach.

Contrary to https://github.com/rust-lang/rust/pull/120855, this PR only introduces the new flag, along with a couple of run-make tests and documentation, but does not yet use it in bootstrap to actually compile rustc. I plan to do that as a follow-up step (along with integration in Cargo, which should ideally just always pass this flag to reduce the size of target directories).

Fixes https://github.com/rust-lang/rust/issues/23366
Closes https://github.com/rust-lang/rust/issues/29511
Fixes https://github.com/rust-lang/rust/issues/57076

Another attempt of https://github.com/rust-lang/rust/pull/93945 and https://github.com/rust-lang/rust/pull/120855.

r? `@petrochenkov`
2025-04-01 10:40:06 +00:00
..
book@45f0536736 Update books 2025-03-24 18:00:58 +01:00
edition-guide@1e27e5e6d5 Update books 2025-03-10 18:01:15 +01:00
embedded-book@0b8219ac23 Update books 2025-02-10 18:00:41 +01:00
man Update rustc man page to match rustc --help 2022-08-01 22:03:18 +00:00
nomicon@b4448fa406 Update books 2025-03-10 18:01:15 +01:00
reference@e95ebdfee0 Update books 2025-03-24 18:00:58 +01:00
rust-by-example@6f69823c28 Update books 2025-03-10 18:01:15 +01:00
rustc Rollup merge of #139038 - adamgreig:thumb-target-maintainers, r=Noratrieb 2025-03-28 12:59:57 +01:00
rustc-dev-guide compiletest: Support matching diagnostics on lines below 2025-03-29 13:30:20 +03:00
rustdoc Add missing case explanation for doc inlined re-export of doc hidden item 2025-02-27 11:53:30 +01:00
style-guide Revert "[style 2024] Combine all last arg delimited exprs" 2025-01-30 18:08:45 +00:00
unstable-book Auto merge of #137535 - Kobzol:split-metadata, r=petrochenkov 2025-04-01 10:40:06 +00:00
complement-design-faq.md
complement-lang-faq.md
complement-project-faq.md
favicon.inc doc: no shortcut in rel="icon" 2022-01-28 13:42:48 +01:00
footer.inc avoid reuse tripping over copyright notices 2023-03-09 12:24:43 +01:00
full-toc.inc
grammar.md Remove legacy grammar 2019-09-30 07:46:10 +02:00
guide-crates.md
guide-error-handling.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-ffi.md
guide-macros.md
guide-ownership.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-plugins.md Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
guide-pointers.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-strings.md
guide-tasks.md
guide-testing.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-unsafe.md
guide.md
index.md doc: add release notes to standalone doc bundle 2023-11-13 16:00:31 -07:00
intro.md
not_found.md rustdoc: consistentify #TOC and #ModNav to lowercase 2024-08-20 16:51:40 -07:00
redirect.inc doc: no shortcut in rel="icon" 2022-01-28 13:42:48 +01:00
reference.md Update reference.md 2021-07-10 19:51:36 +02:00
robots.txt Block version-specific docs from search engines 2020-03-14 02:29:35 +00:00
rust.css Fix heading anchors in doc pages. 2024-03-18 09:13:18 -07:00
rust.md
rustdoc.md
tutorial.md
version_info.html.template