about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-07 02:58:40 +0000
committerbors <bors@rust-lang.org>2019-05-07 02:58:40 +0000
commitb8fa4cb31dcb2c3ed2c61f80ca6d0b3ede3ac4b4 (patch)
tree3808d1c7a929294cc849168d178874350bddd252 /src/libsyntax
parenteeedd3a6e15d43d0cd3e860f36be737cb2c941ca (diff)
parentc89a13179ea1d8431868508d79d57ab3c6ce0ac7 (diff)
downloadrust-b8fa4cb31dcb2c3ed2c61f80ca6d0b3ede3ac4b4.tar.gz
rust-b8fa4cb31dcb2c3ed2c61f80ca6d0b3ede3ac4b4.zip
Auto merge of #60464 - eddyb:not-overly-specific-pipelining, r=alexcrichton
rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output.

This is my take on #60006 / #60419 (see https://github.com/rust-lang/rust/pull/60006#discussion_r275983732).
I'm not too attached the "notifications" part, it's pretty much bikeshed material.
**EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in https://github.com/rust-lang/rust/pull/60464#issuecomment-488576998)

The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test.

The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in https://github.com/rust-lang/rust/pull/60006#discussion_r279964081).

cc @alexcrichton @nnethercote
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/json.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs
index 65f8d0e77d7..2dd2ecb7493 100644
--- a/src/libsyntax/json.rs
+++ b/src/libsyntax/json.rs
@@ -19,6 +19,7 @@ use errors::emitter::{Emitter, HumanReadableErrorType};
 use syntax_pos::{MacroBacktrace, Span, SpanLabel, MultiSpan};
 use rustc_data_structures::sync::{self, Lrc};
 use std::io::{self, Write};
+use std::path::Path;
 use std::vec;
 use std::sync::{Arc, Mutex};
 
@@ -91,15 +92,15 @@ impl Emitter for JsonEmitter {
         }
     }
 
-    fn maybe_emit_json_directive(&mut self, directive: String) {
-        let data = Directive { directive };
+    fn emit_artifact_notification(&mut self, path: &Path) {
+        let data = ArtifactNotification { artifact: path };
         let result = if self.pretty {
             writeln!(&mut self.dst, "{}", as_pretty_json(&data))
         } else {
             writeln!(&mut self.dst, "{}", as_json(&data))
         };
         if let Err(e) = result {
-            panic!("failed to print message: {:?}", e);
+            panic!("failed to print notification: {:?}", e);
         }
     }
 }
@@ -181,9 +182,9 @@ struct DiagnosticCode {
 }
 
 #[derive(RustcEncodable)]
-struct Directive {
-    /// The directive itself.
-    directive: String,
+struct ArtifactNotification<'a> {
+    /// The path of the artifact.
+    artifact: &'a Path,
 }
 
 impl Diagnostic {