diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 12938b8326e79..30983869c2e3b 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -991,7 +991,8 @@ impl Build { /// Returns the "musl root" for this `target`, if defined fn musl_root(&self, target: &str) -> Option<&Path> { - self.config.target_config[target].musl_root.as_ref() + self.config.target_config.get(target) + .and_then(|t| t.musl_root.as_ref()) .or(self.config.musl_root.as_ref()) .map(|p| &**p) }