From 388c42e72a832aae836f8e9b885137a73646f718 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 3 Dec 2025 14:10:54 +0300 Subject: [PATCH] linker: Remove special case for `rust-lld` in `detect_self_contained_mingw` `rust-lld` is supposed to live in sysroot, so it doesn't change the behavior of the function, only removes a potential micro-optimization. --- compiler/rustc_codegen_ssa/src/back/link.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 878b333580e1c..d35c3b6bb189e 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1763,10 +1763,6 @@ fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind { // Returns true if linker is located within sysroot fn detect_self_contained_mingw(sess: &Session, linker: &Path) -> bool { - // Assume `-C linker=rust-lld` as self-contained mode - if linker == Path::new("rust-lld") { - return true; - } let linker_with_extension = if cfg!(windows) && linker.extension().is_none() { linker.with_extension("exe") } else {