Rollup merge of #149590 - petrochenkov:norlld, r=mati865

linker: Remove special case for `rust-lld` in `detect_self_contained_mingw`

`rust-lld` is supposed to live inside sysroot, so it doesn't change the behavior of the function, only removes a potential micro-optimization.

https://github.com/rust-lang/rust/pull/149178#issuecomment-3570619496
r? `@mati865`
This commit is contained in:
Matthias Krüger 2025-12-03 13:05:16 +01:00 committed by GitHub
commit 2cc93b898b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {