From 6dadb941013e901dd8167ee50642d6eba0c08aff Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 31 Jul 2019 13:44:55 +0200 Subject: [PATCH 1/3] test suite: be fine with warnings when running on rustc CI --- tests/compiletest.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 9394084ad34d..f88fb0b6b981 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -26,7 +26,11 @@ fn rustc_lib_path() -> PathBuf { fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec) { // Some flags we always want. - flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs + if rustc_test_suite().is_none() { + // Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful. + // (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.) + flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs + } flags.push("--edition 2018".to_owned()); if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") { flags.push(format!("--sysroot {}", sysroot)); From edf7d1c30c9b53da5f9cd0fa9597d999f0aa1752 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 31 Jul 2019 13:48:15 +0200 Subject: [PATCH 2/3] dedup code a bit --- tests/compiletest.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index f88fb0b6b981..21366c3dbf50 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -25,8 +25,9 @@ fn rustc_lib_path() -> PathBuf { } fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec) { - // Some flags we always want. - if rustc_test_suite().is_none() { + let in_rustc_test_suite = rustc_test_suite().is_some(); + // Add some flags we always want. + if !in_rustc_test_suite { // Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful. // (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.) 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) { let mut config = compiletest::Config::default().tempdir(); config.mode = mode.parse().expect("Invalid mode"); config.rustc_path = miri_path(); - if rustc_test_suite().is_some() { + if in_rustc_test_suite { config.run_lib_path = rustc_lib_path(); config.compile_lib_path = rustc_lib_path(); } From a414492cc736111446a11925aadba5605496624c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 31 Jul 2019 13:48:49 +0200 Subject: [PATCH 3/3] reorder for clarity --- tests/compiletest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 21366c3dbf50..eaf7f8531b8f 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -27,12 +27,12 @@ fn rustc_lib_path() -> PathBuf { fn run_tests(mode: &str, path: &str, target: &str, mut flags: Vec) { let in_rustc_test_suite = rustc_test_suite().is_some(); // Add some flags we always want. + flags.push("--edition 2018".to_owned()); if !in_rustc_test_suite { // Only `-Dwarnings` on the Miri side to make the rustc toolstate management less painful. // (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.) flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs } - flags.push("--edition 2018".to_owned()); if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") { flags.push(format!("--sysroot {}", sysroot)); }