From 95dafab66045bdad26fdb7b72e09e15d24c1ada9 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Thu, 27 Mar 2025 10:45:05 -0400 Subject: [PATCH 1/4] feat(unstable): add `-Zrustdoc-depinfo` flag --- src/cargo/core/features.rs | 2 ++ tests/testsuite/cargo/z_help/stdout.term.svg | 30 +++++++++++--------- tests/testsuite/doc.rs | 17 +++++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index f5aab9dc60b..152d308d832 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -790,6 +790,7 @@ unstable_cli_options!( public_dependency: bool = ("Respect a dependency's `public` field in Cargo.toml to control public/private dependencies"), publish_timeout: bool = ("Enable the `publish.timeout` key in .cargo/config.toml file"), root_dir: Option = ("Set the root directory relative to which paths are printed (defaults to workspace root)"), + rustdoc_depinfo: bool = ("Use dep-info files in rustdoc rebuild detection"), rustdoc_map: bool = ("Allow passing external documentation mappings to rustdoc"), rustdoc_scrape_examples: bool = ("Allows Rustdoc to scrape code examples from reverse-dependencies"), sbom: bool = ("Enable the `sbom` option in build config in .cargo/config.toml file"), @@ -1303,6 +1304,7 @@ impl CliUnstable { "trim-paths" => self.trim_paths = parse_empty(k, v)?, "publish-timeout" => self.publish_timeout = parse_empty(k, v)?, "root-dir" => self.root_dir = v.map(|v| v.into()), + "rustdoc-depinfo" => self.rustdoc_depinfo = parse_empty(k, v)?, "rustdoc-map" => self.rustdoc_map = parse_empty(k, v)?, "rustdoc-scrape-examples" => self.rustdoc_scrape_examples = parse_empty(k, v)?, "sbom" => self.sbom = parse_empty(k, v)?, diff --git a/tests/testsuite/cargo/z_help/stdout.term.svg b/tests/testsuite/cargo/z_help/stdout.term.svg index c7791176d58..c152f663f20 100644 --- a/tests/testsuite/cargo/z_help/stdout.term.svg +++ b/tests/testsuite/cargo/z_help/stdout.term.svg @@ -1,4 +1,4 @@ - +