Skip to content

Commit c3db627

Browse files
committed
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.
2 parents f7bde94 + 351efd5 commit c3db627

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiletest/compiletest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
9090
optflag("h", "help", "show this message"));
9191

9292
let (argv0, args_) = args.split_first().unwrap();
93-
if args[1] == "-h" || args[1] == "--help" {
93+
if args.len() == 1 || args[1] == "-h" || args[1] == "--help" {
9494
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9595
println!("{}", getopts::usage(&message, &groups));
9696
println!("");

0 commit comments

Comments
 (0)