diff options
| author | Samuel E. Moelius III <sam@moeli.us> | 2021-09-30 12:57:34 -0400 |
|---|---|---|
| committer | Samuel E. Moelius III <sam@moeli.us> | 2021-09-30 12:57:34 -0400 |
| commit | 32b6ac5b44e4f0ffa5e56b9c81407633dc4edb64 (patch) | |
| tree | a7b5bf44a889f5ad4ca3c395d6d15118de7a8e2d | |
| parent | a6738c7231dadb0a84d338ae6f41cc34651518eb (diff) | |
| download | rust-32b6ac5b44e4f0ffa5e56b9c81407633dc4edb64.tar.gz rust-32b6ac5b44e4f0ffa5e56b9c81407633dc4edb64.zip | |
Check `allow_unstable` before checking environment variables
| -rw-r--r-- | library/test/src/cli.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/test/src/cli.rs b/library/test/src/cli.rs index e26b9101011..cb40b4e965b 100644 --- a/library/test/src/cli.rs +++ b/library/test/src/cli.rs @@ -339,7 +339,7 @@ fn get_time_options( fn get_shuffle(matches: &getopts::Matches, allow_unstable: bool) -> OptPartRes<bool> { let mut shuffle = unstable_optflag!(matches, allow_unstable, "shuffle"); - if !shuffle { + if !shuffle && allow_unstable { shuffle = match env::var("RUST_TEST_SHUFFLE") { Ok(val) => &val != "0", Err(_) => false, @@ -364,7 +364,7 @@ fn get_shuffle_seed(matches: &getopts::Matches, allow_unstable: bool) -> OptPart None => None, }; - if shuffle_seed.is_none() { + if shuffle_seed.is_none() && allow_unstable { shuffle_seed = match env::var("RUST_TEST_SHUFFLE_SEED") { Ok(val) => match val.parse::<u64>() { Ok(n) => Some(n), |
