Skip to content

Commit fb80b9e

Browse files
committed
Don't ever capture CPU state if timings are disabled
This should initially help with the panic in #7427 but doesn't solve it.
1 parent 400221e commit fb80b9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cargo/core/compiler/timings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'a, 'cfg> Timings<'a, 'cfg> {
138138
unit_times: Vec::new(),
139139
active: HashMap::new(),
140140
concurrency: Vec::new(),
141-
last_cpu_state: State::current().ok(),
141+
last_cpu_state: if enabled { State::current().ok() } else { None },
142142
last_cpu_recording: Instant::now(),
143143
cpu_usage: Vec::new(),
144144
}

0 commit comments

Comments
 (0)