From bb229865fa6f1178dcb2c87279336f9bf36d7282 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 16 Sep 2019 13:27:38 +1000 Subject: [PATCH] Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given. Fixes #64339. --- src/librustc_driver/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index a912ea3c35821..dc2592d164098 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); } }