Skip to content

Commit 5bbf673

Browse files
committed
Auto merge of #869 - RalfJung:tests, r=oli-obk
test suite: be fine with warnings when running on rustc CI r? @oli-obk
2 parents e276676 + a414492 commit 5bbf673

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/compiletest.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ 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-
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
28+
let in_rustc_test_suite = rustc_test_suite().is_some();
29+
// Add some flags we always want.
3030
flags.push("--edition 2018".to_owned());
31+
if !in_rustc_test_suite {
32+
// Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful.
33+
// (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.)
34+
flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
35+
}
3136
if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") {
3237
flags.push(format!("--sysroot {}", sysroot));
3338
}
@@ -36,7 +41,7 @@ fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec<String>) {
3641
let mut config = compiletest::Config::default().tempdir();
3742
config.mode = mode.parse().expect("Invalid mode");
3843
config.rustc_path = miri_path();
39-
if rustc_test_suite().is_some() {
44+
if in_rustc_test_suite {
4045
config.run_lib_path = rustc_lib_path();
4146
config.compile_lib_path = rustc_lib_path();
4247
}

0 commit comments

Comments
 (0)