diff --git a/src/cargo/util/cpu.rs b/src/cargo/util/cpu.rs index 6d462c231b3..5def01032d2 100644 --- a/src/cargo/util/cpu.rs +++ b/src/cargo/util/cpu.rs @@ -72,7 +72,7 @@ mod imp { let nice = next.nice - prev.nice; let system = next.system - prev.system; let idle = next.idle - prev.idle; - let iowait = next.iowait - prev.iowait; + let iowait = next.iowait.checked_sub(prev.iowait).unwrap_or(0); let irq = next.irq - prev.irq; let softirq = next.softirq - prev.softirq; let steal = next.steal - prev.steal;