diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 30c34746c34e4..39a9ac8569ad0 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -439,6 +439,8 @@ pub fn parse_opts(args: &[String]) -> Option { let test_threads = match matches.opt_str("test-threads") { Some(n_str) => match n_str.parse::() { + Ok(0) => + return Some(Err(format!("argument for --test-threads must not be 0"))), Ok(n) => Some(n), Err(e) => return Some(Err(format!("argument for --test-threads must be a number > 0 \