Skip to content

Commit 2e28e14

Browse files
committed
reorder lets so that build_dir is deleted last
1 parent df20c06 commit 2e28e14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/compiletest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
3737
path,
3838
target
3939
);
40+
let build_dir = TempDir::new("miri-tests").unwrap();
4041
let mut config = compiletest::Config::default();
4142
config.mode = "compile-fail".parse().expect("Invalid mode");
42-
let build_dir = TempDir::new("miri-tests").unwrap();
4343
config.build_base = build_dir.path().to_owned();
4444
config.rustc_path = miri_path();
4545
let mut flags = Vec::new();
@@ -70,9 +70,9 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
7070

7171
fn run_pass(path: &str) {
7272
eprintln!("## Running run-pass tests in {} against rustc", path);
73+
let build_dir = TempDir::new("miri-tests").unwrap();
7374
let mut config = compiletest::Config::default();
7475
config.mode = "run-pass".parse().expect("Invalid mode");
75-
let build_dir = TempDir::new("miri-tests").unwrap();
7676
config.build_base = build_dir.path().to_owned();
7777
config.src_base = PathBuf::from(path);
7878
if let Some(rustc_path) = rustc_test_suite() {
@@ -95,9 +95,9 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) {
9595
target,
9696
opt_str
9797
);
98+
let build_dir = TempDir::new("miri-tests").unwrap();
9899
let mut config = compiletest::Config::default();
99100
config.mode = "mir-opt".parse().expect("Invalid mode");
100-
let build_dir = TempDir::new("miri-tests").unwrap();
101101
config.build_base = build_dir.path().to_owned();
102102
config.src_base = PathBuf::from(path);
103103
config.target = target.to_owned();

0 commit comments

Comments
 (0)