about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2019-07-18 01:02:22 -0700
committerJeremy Fitzhardinge <jeremy@goop.org>2019-07-18 01:02:22 -0700
commitf7d53a96ca9e74f00355951c03384184464ebbc2 (patch)
tree3665f0a30f9a24129a1af4925090485de9dca913
parentefb74579150a6ea0ad99a8568aa02a1aa23f6dd5 (diff)
downloadrust-f7d53a96ca9e74f00355951c03384184464ebbc2.tar.gz
rust-f7d53a96ca9e74f00355951c03384184464ebbc2.zip
Emit artifact notifications for dependency files
-rw-r--r--src/librustc_interface/passes.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs
index bb58d134989..bb11657d0c4 100644
--- a/src/librustc_interface/passes.rs
+++ b/src/librustc_interface/passes.rs
@@ -688,12 +688,20 @@ fn write_out_deps(sess: &Session, outputs: &OutputFilenames, out_filenames: &[Pa
         Ok(())
     })();
 
-    if let Err(e) = result {
-        sess.fatal(&format!(
-            "error writing dependencies to `{}`: {}",
-            deps_filename.display(),
-            e
-        ));
+    match result {
+        Ok(_) => {
+            if sess.opts.debugging_opts.emit_artifact_notifications {
+                 sess.parse_sess.span_diagnostic
+                    .emit_artifact_notification(&deps_filename, "dep-info");
+            }
+        },
+        Err(e) => {
+            sess.fatal(&format!(
+                "error writing dependencies to `{}`: {}",
+                deps_filename.display(),
+                e
+            ))
+        }
     }
 }