about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-09-16 17:09:43 +0200
committerGitHub <noreply@github.com>2019-09-16 17:09:43 +0200
commitacbbcda39974636ee3838063373ec0ce68d454cf (patch)
treebb0a00eee3dde14d16ed2c02e66763f044659f95
parent75db5711a4a97a6120542f46a0adebd960506854 (diff)
parentbb229865fa6f1178dcb2c87279336f9bf36d7282 (diff)
downloadrust-acbbcda39974636ee3838063373ec0ce68d454cf.tar.gz
rust-acbbcda39974636ee3838063373ec0ce68d454cf.zip
Rollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given

Fixes #64339.
-rw-r--r--src/librustc_driver/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 005cdcfaf68..8c5d8536c32 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -134,8 +134,11 @@ pub struct TimePassesCallbacks {
 
 impl Callbacks for TimePassesCallbacks {
     fn config(&mut self, config: &mut interface::Config) {
+        // If a --prints=... option has been given, we don't print the "total"
+        // time because it will mess up the --prints output. See #64339.
         self.time_passes =
-            config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time;
+            config.opts.prints.is_empty() &&
+            (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);
     }
 }