Skip to content

Commit 098d228

Browse files
authored
Auto merge of #37151 - alexcrichton:fix-master, r=alexcrichton
rustbuild: Less panics in musl_root Don't panic if the target wasn't configured.
2 parents d34318d + 651bb69 commit 098d228

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bootstrap/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,8 @@ impl Build {
991991

992992
/// Returns the "musl root" for this `target`, if defined
993993
fn musl_root(&self, target: &str) -> Option<&Path> {
994-
self.config.target_config[target].musl_root.as_ref()
994+
self.config.target_config.get(target)
995+
.and_then(|t| t.musl_root.as_ref())
995996
.or(self.config.musl_root.as_ref())
996997
.map(|p| &**p)
997998
}

0 commit comments

Comments
 (0)