From b3218d3d5d4aeed5f08bf761bbeabdbadb922f02 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 21 May 2021 10:48:36 -0400 Subject: [PATCH] facepalm: operator precedence fail on my part. This bug was only visible on mac. Also, print_step_rusage is a relatively new internal feature, that is not heavily used, and has no tests. All of these factors contributed to how this went uncaught this long. Thanks to Josh Triplett for pointing it out! --- src/bootstrap/bin/rustc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index d462dc4d1165c..4b98abfb308bf 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -305,7 +305,7 @@ fn format_rusage_data(_child: Child) -> Option { }; // Mac OS X reports the maxrss in bytes, not kb. let divisor = if env::consts::OS == "macos" { 1024 } else { 1 }; - let maxrss = rusage.ru_maxrss + (divisor - 1) / divisor; + let maxrss = (rusage.ru_maxrss + (divisor - 1)) / divisor; let mut init_str = format!( "user: {USER_SEC}.{USER_USEC:03} \