about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-05-07 09:11:10 +0000
committerGitHub <noreply@github.com>2025-05-07 09:11:10 +0000
commit67f67268ab7dffde82c286e8f3ec074d67e3bf3d (patch)
treed3f63116023e2b24c4a93afd5564ae4f714fbc98 /src
parent4b8f88b2515e6f3032ca2143e98aab28d335dda3 (diff)
parent0d5df707f51891b28f62e9264f02e45739731bde (diff)
downloadrust-67f67268ab7dffde82c286e8f3ec074d67e3bf3d.tar.gz
rust-67f67268ab7dffde82c286e8f3ec074d67e3bf3d.zip
Merge pull request #4313 from RalfJung/CARGO_TARGET_TMPDIR
test suite: use CARGO_TARGET_TMPDIR for temporary build artifacts
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/ui.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs
index c37cf15d40a..a7b889d966c 100644
--- a/src/tools/miri/tests/ui.rs
+++ b/src/tools/miri/tests/ui.rs
@@ -44,8 +44,7 @@ pub fn flagsplit(flags: &str) -> Vec<String> {
 fn build_native_lib() -> PathBuf {
     let cc = env::var("CC").unwrap_or_else(|_| "cc".into());
     // Target directory that we can write to.
-    let so_target_dir =
-        Path::new(&env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri-native-lib");
+    let so_target_dir = Path::new(env!("CARGO_TARGET_TMPDIR")).join("miri-native-lib");
     // Create the directory if it does not already exist.
     std::fs::create_dir_all(&so_target_dir)
         .expect("Failed to create directory for shared object file");
@@ -101,7 +100,7 @@ fn miri_config(
     let mut config = Config {
         target: Some(target.to_owned()),
         program,
-        out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri_ui"),
+        out_dir: PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join("miri_ui"),
         threads: std::env::var("MIRI_TEST_THREADS")
             .ok()
             .map(|threads| NonZero::new(threads.parse().unwrap()).unwrap()),