From 4e758722f4f9ccf9054ebf179b8630a37ce954f1 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 5 Apr 2016 10:00:51 -0700 Subject: [PATCH] rustbuild: Verify flags are configured Building with `--target foo` should fail because that target wasn't actually validated. --- src/bootstrap/build/sanity.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs index be4416c697c..6ce27496388 100644 --- a/src/bootstrap/build/sanity.rs +++ b/src/bootstrap/build/sanity.rs @@ -119,4 +119,16 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake } } } + + for host in build.flags.host.iter() { + if !build.config.host.contains(host) { + panic!("specified host `{}` is not in the ./configure list", host); + } + } + for target in build.flags.target.iter() { + if !build.config.target.contains(target) { + panic!("specified target `{}` is not in the ./configure list", + target); + } + } }