Skip to content

Commit

Permalink
rustbuild: Less panics in musl_root
Browse files Browse the repository at this point in the history
Don't panic if the target wasn't configured.
  • Loading branch information
alexcrichton committed Oct 13, 2016
1 parent 9cb0136 commit 651bb69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Expand Up @@ -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)
}
Expand Down

0 comments on commit 651bb69

Please sign in to comment.