+fn run_tests(mode: &str, path: &str, target: &str) {
+ let in_rustc_test_suite = option_env!("RUSTC_STAGE").is_some();
+ // Add some flags we always want.
+ let mut flags = Vec::new();
+ flags.push("--edition 2018".to_owned());
+ if in_rustc_test_suite {
+ // Less aggressive warnings 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("-Astable-features".to_owned());
+ } else {
+ flags.push("-Dwarnings -Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs
+ }
+ if let Ok(sysroot) = env::var("MIRI_SYSROOT") {
+ flags.push(format!("--sysroot {}", sysroot));
+ }
+ if let Ok(extra_flags) = env::var("MIRIFLAGS") {
+ flags.push(extra_flags);
+ }