Skip to content

Commit afa4ffa

Browse files
authored
Merge pull request #4313 from RalfJung/CARGO_TARGET_TMPDIR
test suite: use CARGO_TARGET_TMPDIR for temporary build artifacts
2 parents 4632c61 + 7542e02 commit afa4ffa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/ui.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ pub fn flagsplit(flags: &str) -> Vec<String> {
4444
fn build_native_lib() -> PathBuf {
4545
let cc = env::var("CC").unwrap_or_else(|_| "cc".into());
4646
// Target directory that we can write to.
47-
let so_target_dir =
48-
Path::new(&env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri-native-lib");
47+
let so_target_dir = Path::new(env!("CARGO_TARGET_TMPDIR")).join("miri-native-lib");
4948
// Create the directory if it does not already exist.
5049
std::fs::create_dir_all(&so_target_dir)
5150
.expect("Failed to create directory for shared object file");
@@ -101,7 +100,7 @@ fn miri_config(
101100
let mut config = Config {
102101
target: Some(target.to_owned()),
103102
program,
104-
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri_ui"),
103+
out_dir: PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join("miri_ui"),
105104
threads: std::env::var("MIRI_TEST_THREADS")
106105
.ok()
107106
.map(|threads| NonZero::new(threads.parse().unwrap()).unwrap()),

0 commit comments

Comments
 (0)