From 9ccb85d7dbeca051c7dc2a406fd9be5368f87d20 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 a3ed1800bf8..a03b89e832b 100644 --- a/src/cargo/core/compiler/timings.rs +++ b/src/cargo/core/compiler/timings.rs @@ -142,7 +142,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(), }