Auto merge of #36442 - alexcrichton:rustbuild-cross, r=brson
rustbuild: Nicer error for host builds of targets If a triple is configured only as a target, not a host, then trying to build that triple with host artifacts would cause a panic. Fail a little nicer instead. Closes #36268
This commit is contained in:
commit
95abee1a68
@ -950,7 +950,11 @@ fn ar(&self, target: &str) -> Option<&Path> {
|
||||
/// Returns the path to the C++ compiler for the target specified, may panic
|
||||
/// if no C++ compiler was configured for the target.
|
||||
fn cxx(&self, target: &str) -> &Path {
|
||||
self.cxx[target].path()
|
||||
match self.cxx.get(target) {
|
||||
Some(p) => p.path(),
|
||||
None => panic!("\n\ntarget `{}` is not configured as a host,
|
||||
only as a target\n\n", target),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns flags to pass to the compiler to generate code for `target`.
|
||||
|
Loading…
Reference in New Issue
Block a user