From fb80b9e0061b10c186638bc97534a7e4509f370f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 25 Sep 2019 08:18:05 -0700 Subject: [PATCH] Don't ever capture CPU state if timings are disabled This should initially help with the panic in #7427 but doesn't solve it. --- src/cargo/core/compiler/timings.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/core/compiler/timings.rs b/src/cargo/core/compiler/timings.rs index 1a3fe45052b..6098e6dfa2c 100644 --- a/src/cargo/core/compiler/timings.rs +++ b/src/cargo/core/compiler/timings.rs @@ -138,7 +138,7 @@ impl<'a, 'cfg> Timings<'a, 'cfg> { unit_times: Vec::new(), active: HashMap::new(), concurrency: Vec::new(), - last_cpu_state: State::current().ok(), + last_cpu_state: if enabled { State::current().ok() } else { None }, last_cpu_recording: Instant::now(), cpu_usage: Vec::new(), }