From 4e99b682ce126f0f8e736d110474baf0acb9c989 Mon Sep 17 00:00:00 2001 From: Jynn Nelson Date: Thu, 30 Apr 2026 07:49:37 +0200 Subject: [PATCH] Trim MSVC output even if it doesn't start with whitespace I copied this from Chromium and I think Chromium was just wrong. --- compiler/rustc_codegen_ssa/src/back/link.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index a5b3df6deb40..b3857cc34e42 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -729,9 +729,10 @@ fn for_each(bytes: &[u8], mut f: impl FnMut(&str, &mut String)) -> String { escaped_stdout = for_each(&stdout, |line, output| { // Hide some progress messages from link.exe that we don't care about. // See https://github.com/chromium/chromium/blob/bfa41e41145ffc85f041384280caf2949bb7bd72/build/toolchain/win/tool_wrapper.py#L144-L146 - if line.starts_with(" Creating library") - || line.starts_with("Generating code") - || line.starts_with("Finished generating code") + let trimmed = line.trim_start(); + if trimmed.starts_with("Creating library") + || trimmed.starts_with("Generating code") + || trimmed.starts_with("Finished generating code") { linker_info += line; linker_info += "\r\n";