about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-09-16 13:27:38 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-09-16 13:27:38 +1000
commitbb229865fa6f1178dcb2c87279336f9bf36d7282 (patch)
tree1aa98f6a78e57c3fa215f95a74a842830f82de98 /src
parentca3766e2e58f462a20922e42c821a37eaf0e13db (diff)
downloadrust-bb229865fa6f1178dcb2c87279336f9bf36d7282.tar.gz
rust-bb229865fa6f1178dcb2c87279336f9bf36d7282.zip
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given.
Fixes #64339.
Diffstat (limited to 'src')
-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 a912ea3c358..dc2592d1640 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -132,8 +132,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);
     }
 }