Skip to content

Commit edf7d1c

Browse files
committed
dedup code a bit
1 parent 6dadb94 commit edf7d1c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/compiletest.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ fn rustc_lib_path() -> PathBuf {
2525
}
2626

2727
fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
28-
// Some flags we always want.
29-
if rustc_test_suite().is_none() {
28+
let in_rustc_test_suite = rustc_test_suite().is_some();
29+
// Add some flags we always want.
30+
if !in_rustc_test_suite {
3031
// Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful.
3132
// (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.)
3233
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
@@ -40,7 +41,7 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
4041
let mut config = compiletest::Config::default().tempdir();
4142
config.mode = mode.parse().expect("Invalid mode");
4243
config.rustc_path = miri_path();
43-
if rustc_test_suite().is_some() {
44+
if in_rustc_test_suite {
4445
config.run_lib_path = rustc_lib_path();
4546
config.compile_lib_path = rustc_lib_path();
4647
}

0 commit comments

Comments
 (0)