about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2019-08-12 14:49:12 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2019-08-14 05:39:53 -0400
commitf7ff36dcb27b48329e9b1c12f5b78d469fafc067 (patch)
tree911351c0deb8a9b95fb72fbd2632da32ee7df608 /src/bootstrap
parent6575a96198765d4fb38d9abf7d64fc817ef8e80b (diff)
Update error-format to match new Cargo flags for pipelining
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bin/rustc.rs12
-rw-r--r--src/bootstrap/builder.rs3
-rw-r--r--src/bootstrap/compile.rs20
3 files changed, 6 insertions, 29 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 1436096dd6e..9c01de8aa82 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -45,18 +45,6 @@ fn main() {
         }
     }
 
-    // Drop `--error-format json` because despite our desire for json messages
-    // from Cargo we don't want any from rustc itself.
-    if let Some(n) = args.iter().position(|n| n == "--error-format") {
-        args.remove(n);
-        args.remove(n);
-    }
-
-    if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
-        args.push("--error-format".into());
-        args.push(s);
-    }
-
     // Detect whether or not we're a build script depending on whether --target
     // is passed (a bit janky...)
     let target = args.windows(2)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 9e4cd5ebca7..8dad5f2ef46 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -980,9 +980,6 @@ impl<'a> Builder<'a> {
         if let Some(target_linker) = self.linker(target) {
             cargo.env("RUSTC_TARGET_LINKER", target_linker);
         }
-        if let Some(ref error_format) = self.config.rustc_error_format {
-            cargo.env("RUSTC_ERROR_FORMAT", error_format);
-        }
         if !(["build", "check", "clippy", "fix", "rustc"].contains(&cmd)) && want_rustdoc {
             cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler));
         }
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 4cd793adaf5..4b4b072cc1c 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -1116,10 +1116,6 @@ pub fn run_cargo(builder: &Builder<'_>,
                 },
                 ..
             } => (filenames, crate_types),
-            CargoMessage::CompilerMessage { message } => {
-                eprintln!("{}", message.rendered);
-                return;
-            }
             _ => return,
         };
         for filename in filenames {
@@ -1256,8 +1252,12 @@ pub fn stream_cargo(
     }
     // Instruct Cargo to give us json messages on stdout, critically leaving
     // stderr as piped so we can get those pretty colors.
-    cargo.arg("--message-format").arg("json")
-         .stdout(Stdio::piped());
+    let mut message_format = String::from("json-render-diagnostics");
+    if let Some(s) = &builder.config.rustc_error_format  {
+        message_format.push_str(",json-diagnostic-");
+        message_format.push_str(s);
+    }
+    cargo.arg("--message-format").arg(message_format).stdout(Stdio::piped());
 
     for arg in tail_args {
         cargo.arg(arg);
@@ -1310,12 +1310,4 @@ pub enum CargoMessage<'a> {
     BuildScriptExecuted {
         package_id: Cow<'a, str>,
     },
-    CompilerMessage {
-        message: ClippyMessage<'a>
-    }
-}
-
-#[derive(Deserialize)]
-pub struct ClippyMessage<'a> {
-    rendered: Cow<'a, str>,
 }