about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-26 00:19:51 +0000
committerbors <bors@rust-lang.org>2015-10-26 00:19:51 +0000
commitc3db627cbf354ba02311fb0c523e365e8d017b00 (patch)
tree77c00e61735c252be2b5c11c1514333ee4a6fd57 /src
parentf7bde94ea896397739d1e4503ead20e7ab644d76 (diff)
parent351efd55e90332d0b045324774ffc987d549c0a8 (diff)
downloadrust-c3db627cbf354ba02311fb0c523e365e8d017b00.tar.gz
rust-c3db627cbf354ba02311fb0c523e365e8d017b00.zip
Auto merge of #29296 - zazdxscf:compiletest_noargs_show_help, r=alexcrichton
instead of this panic:
```
thread '<main>' panicked at 'index out of bounds: the len is 1 but the
index is 1', src/libcollections/vec.rs:1110
```

It still panics, just like `-h` does, so it should be okay in this
regard.
Diffstat (limited to 'src')
-rw-r--r--src/compiletest/compiletest.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index 3b9eec12ba3..dfd99a9beae 100644
--- a/src/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
@@ -90,7 +90,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
           optflag("h", "help", "show this message"));
 
     let (argv0, args_) = args.split_first().unwrap();
-    if args[1] == "-h" || args[1] == "--help" {
+    if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
         let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
         println!("{}", getopts::usage(&message, &groups));
         println!("");