Skip to content

Commit 54307cd

Browse files
committed
bump compiletest so that we can share the tempdir() call
1 parent 97302e8 commit 54307cd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ cargo_miri = ["cargo_metadata"]
4646
rustc_tests = []
4747

4848
[dev-dependencies]
49-
compiletest_rs = { version = "0.3.16", features = ["tmp"] }
49+
compiletest_rs = { version = "0.3.17", features = ["tmp"] }
5050
colored = "1.6"

tests/compiletest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ fn have_fullmir() -> bool {
2929
std::env::var("MIRI_SYSROOT").is_ok() || rustc_test_suite().is_some()
3030
}
3131

32-
fn mk_config(mode: &str) -> compiletest::Config {
33-
let mut config = compiletest::Config::default();
32+
fn mk_config(mode: &str) -> compiletest::common::ConfigWithTemp {
33+
let mut config = compiletest::Config::default().tempdir();
3434
config.mode = mode.parse().expect("Invalid mode");
3535
config.rustc_path = miri_path();
3636
if rustc_test_suite().is_some() {
@@ -74,7 +74,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, need_fullm
7474
config.target = target.to_owned();
7575
config.host = host.to_owned();
7676
config.target_rustcflags = Some(flags.join(" "));
77-
compiletest::run_tests(&config.tempdir()); // FIXME: `tempdir` can be done by `mk_config` once `ConfigWithTemp` is exposed as type from compiletest
77+
compiletest::run_tests(&config);
7878
}
7979

8080
fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir: bool, opt: bool) {
@@ -107,7 +107,7 @@ fn miri_pass(sysroot: &Path, path: &str, target: &str, host: &str, need_fullmir:
107107
config.target = target.to_owned();
108108
config.host = host.to_owned();
109109
config.target_rustcflags = Some(flags.join(" "));
110-
compiletest::run_tests(&config.tempdir()); // FIXME: `tempdir` can be done by `mk_config` once `ConfigWithTemp` is exposed as type from compiletest
110+
compiletest::run_tests(&config);
111111
}
112112

113113
fn is_target_dir<P: Into<PathBuf>>(path: P) -> bool {

0 commit comments

Comments
 (0)