Skip to content

Commit 9ed9ef8

Browse files
committed
Fix tests
1 parent 39a7e5f commit 9ed9ef8

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -863,25 +863,26 @@ impl Config {
863863

864864
let mut target = Target::from_triple(&triple);
865865

866-
if (target_default_linker.is_some() || rust_default_linker.is_some())
867-
&& target_default_linker_linux.is_some()
868-
{
869-
panic!(
870-
"cannot set both `default-linker` and `default-linker-linux` for target {triple}"
871-
);
872-
}
873-
if !triple.contains("linux") {
874-
panic!(
875-
"`default-linker-linux` can only be set for Linux targets, not for {triple}"
876-
);
877-
}
878-
if target_default_linker_linux.as_ref()
879-
== Some(&DefaultLinuxLinkerOverride::SelfContainedLldCc)
880-
&& !lld_enabled
881-
{
882-
panic!(
883-
"Trying to override the default Linux linker for {triple} to be self-contained LLD, but LLD is not being built. Enable it with rust.lld = true."
884-
);
866+
if let Some(linux_override) = target_default_linker_linux.as_ref() {
867+
if target_default_linker.is_some() || rust_default_linker.is_some() {
868+
panic!(
869+
"cannot set both `default-linker` and `default-linker-linux` for target {triple}"
870+
);
871+
}
872+
if !triple.contains("linux") {
873+
panic!(
874+
"`default-linker-linux` can only be set for Linux targets, not for {triple}"
875+
);
876+
}
877+
match linux_override {
878+
DefaultLinuxLinkerOverride::SelfContainedLldCc => {
879+
if !lld_enabled {
880+
panic!(
881+
"Trying to override the default Linux linker for {triple} to be self-contained LLD, but LLD is not being built. Enable it with rust.lld = true."
882+
);
883+
}
884+
}
885+
}
885886
}
886887

887888
if let Some(ref s) = target_llvm_config {

0 commit comments

Comments
 (0)