Skip to content

Commit 32b6ac5

Browse files
committed
Check allow_unstable before checking environment variables
1 parent a6738c7 commit 32b6ac5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/test/src/cli.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn get_time_options(
339339

340340
fn get_shuffle(matches: &getopts::Matches, allow_unstable: bool) -> OptPartRes<bool> {
341341
let mut shuffle = unstable_optflag!(matches, allow_unstable, "shuffle");
342-
if !shuffle {
342+
if !shuffle && allow_unstable {
343343
shuffle = match env::var("RUST_TEST_SHUFFLE") {
344344
Ok(val) => &val != "0",
345345
Err(_) => false,
@@ -364,7 +364,7 @@ fn get_shuffle_seed(matches: &getopts::Matches, allow_unstable: bool) -> OptPart
364364
None => None,
365365
};
366366

367-
if shuffle_seed.is_none() {
367+
if shuffle_seed.is_none() && allow_unstable {
368368
shuffle_seed = match env::var("RUST_TEST_SHUFFLE_SEED") {
369369
Ok(val) => match val.parse::<u64>() {
370370
Ok(n) => Some(n),

0 commit comments

Comments
 (0)