about summary refs log tree commit diff
path: root/src/compiletest
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2014-12-22 19:02:11 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-05 23:58:32 +0100
commit1e8e7dcdd00b552ef78ce83f6dc5f24a45d91b8f (patch)
tree48dde93e7d19c3ba46ded2f17e3e4af266cbc242 /src/compiletest
parent189930fcae287565dcef856ae8d60a83190a4b92 (diff)
downloadrust-1e8e7dcdd00b552ef78ce83f6dc5f24a45d91b8f.tar.gz
rust-1e8e7dcdd00b552ef78ce83f6dc5f24a45d91b8f.zip
improve `compiletest` error message when path option missing.
(I often run `compiletest` by hand by cut-and-pasting from what `make`
runs, but then I need to tweak it (cut out options) and its useful to
be told when I have removed an option that is actually required, such
as `--android-cross-path=path`.)
Diffstat (limited to 'src/compiletest')
-rw-r--r--src/compiletest/compiletest.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index e3e7ca76911..e6d2a691cf5 100644
--- a/src/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
@@ -118,7 +118,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
     }
 
     fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
-        Path::new(m.opt_str(nm).unwrap())
+        match m.opt_str(nm) {
+            Some(s) => Path::new(s),
+            None => panic!("no option (=path) found for {}", nm),
+        }
     }
 
     let filter = if !matches.free.is_empty() {