Skip to content

Commit

Permalink
Auto merge of #37151 - alexcrichton:fix-master, r=alexcrichton
Browse files Browse the repository at this point in the history
rustbuild: Less panics in musl_root

Don't panic if the target wasn't configured.
  • Loading branch information
bors authored Oct 13, 2016
2 parents d34318d + 651bb69 commit 098d228
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
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 098d228

Please sign in to comment.