rustbuild: Less panics in musl_root
Don't panic if the target wasn't configured.
This commit is contained in:
parent
9cb01365ee
commit
651bb69ecd
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user