about summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-02-26 17:13:30 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-02-26 17:13:30 +0100
commit98eb2e3e5ac1c2de47c63d71cb8d4244f8174b16 (patch)
tree3f8ac005b6cf2baf8bff5b5589bd3e6186632d54 /src/librustdoc/lib.rs
parent745297e7aa714ea4a657adb7403a18d9766ce2bd (diff)
downloadrust-98eb2e3e5ac1c2de47c63d71cb8d4244f8174b16.tar.gz
rust-98eb2e3e5ac1c2de47c63d71cb8d4244f8174b16.zip
Add rustdoc support for `--emit=dep-info[=path]`
Diffstat (limited to 'src/librustdoc/lib.rs')
-rw-r--r--src/librustdoc/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 1f2f8f7d33a..c1e6d324d5a 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -561,7 +561,7 @@ fn opts() -> Vec<RustcOptGroup> {
             "",
             "emit",
             "Comma separated list of types of output for rustdoc to emit",
-            "[unversioned-shared-resources,toolchain-shared-resources,invocation-specific]",
+            "[unversioned-shared-resources,toolchain-shared-resources,invocation-specific,dep-info]",
         ),
         opt(Unstable, FlagMulti, "", "no-run", "Compile doctests without running them", ""),
         opt(
@@ -890,7 +890,13 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) {
                 // if we ran coverage, bail early, we don't need to also generate docs at this point
                 // (also we didn't load in any of the useful passes)
                 return;
-            } else if run_check {
+            }
+
+            if render_opts.dep_info().is_some() {
+                rustc_interface::passes::write_dep_info(tcx);
+            }
+
+            if run_check {
                 // Since we're in "check" mode, no need to generate anything beyond this point.
                 return;
             }