提交 95abee1a 编写于 作者: B bors 提交者: GitHub

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
......@@ -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`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册