about summary refs log tree commit diff
path: root/src/librustc_interface
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-07-24 11:00:09 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-07-24 11:00:09 -0400
commitd749b5e2237abdb79494afc9c8d7c8280db9088c (patch)
treeec914bd100359037adfbd390947fcbf3add766b8 /src/librustc_interface
parenteafb42dc94b191fdd9f38b548f624184101182a2 (diff)
downloadrust-d749b5e2237abdb79494afc9c8d7c8280db9088c.tar.gz
rust-d749b5e2237abdb79494afc9c8d7c8280db9088c.zip
Gate binary dependency information behind -Zbinary-dep-depinfo
Diffstat (limited to 'src/librustc_interface')
-rw-r--r--src/librustc_interface/passes.rs24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs
index 469215563ac..772395bca2b 100644
--- a/src/librustc_interface/passes.rs
+++ b/src/librustc_interface/passes.rs
@@ -677,17 +677,19 @@ fn write_out_deps(compiler: &Compiler, outputs: &OutputFilenames, out_filenames:
             .map(|fmap| escape_dep_filename(&fmap.name))
             .collect();
 
-        for cnum in compiler.cstore.crates_untracked() {
-            let metadata = compiler.cstore.crate_data_as_rc_any(cnum);
-            let metadata = metadata.downcast_ref::<cstore::CrateMetadata>().unwrap();
-            if let Some((path, _)) = &metadata.source.dylib {
-                files.push(escape_dep_filename(&FileName::Real(path.clone())));
-            }
-            if let Some((path, _)) = &metadata.source.rlib {
-                files.push(escape_dep_filename(&FileName::Real(path.clone())));
-            }
-            if let Some((path, _)) = &metadata.source.rmeta {
-                files.push(escape_dep_filename(&FileName::Real(path.clone())));
+        if sess.binary_dep_depinfo() {
+            for cnum in compiler.cstore.crates_untracked() {
+                let metadata = compiler.cstore.crate_data_as_rc_any(cnum);
+                let metadata = metadata.downcast_ref::<cstore::CrateMetadata>().unwrap();
+                if let Some((path, _)) = &metadata.source.dylib {
+                    files.push(escape_dep_filename(&FileName::Real(path.clone())));
+                }
+                if let Some((path, _)) = &metadata.source.rlib {
+                    files.push(escape_dep_filename(&FileName::Real(path.clone())));
+                }
+                if let Some((path, _)) = &metadata.source.rmeta {
+                    files.push(escape_dep_filename(&FileName::Real(path.clone())));
+                }
             }
         }