about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoshiki Matsuda <myskjp@gmail.com>2022-06-25 01:12:08 +0900
committerYoshiki Matsuda <myskjp@gmail.com>2022-07-02 22:54:37 +0900
commit7a5e773dc23bb485df1655ca01d59cc55e435b6a (patch)
tree1a41671a50faa27eca24edd436e3927dab2eeb45
parenta206121388524c6b0d5b8c5f97fc732e4ad16709 (diff)
downloadrust-7a5e773dc23bb485df1655ca01d59cc55e435b6a.tar.gz
rust-7a5e773dc23bb485df1655ca01d59cc55e435b6a.zip
fall back on the blank path if out_filename is blank
-rw-r--r--compiler/rustc_metadata/src/fs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_metadata/src/fs.rs b/compiler/rustc_metadata/src/fs.rs
index 7661eec7006..e6072901aaa 100644
--- a/compiler/rustc_metadata/src/fs.rs
+++ b/compiler/rustc_metadata/src/fs.rs
@@ -64,7 +64,7 @@ pub fn encode_and_write_metadata(
     // which is why we create it inside the output directory specifically.
     let metadata_tmpdir = TempFileBuilder::new()
         .prefix("rmeta")
-        .tempdir_in(out_filename.parent().unwrap_or_else(|| Path::new("tmp")))
+        .tempdir_in(out_filename.parent().unwrap_or_else(|| Path::new("")))
         .unwrap_or_else(|err| tcx.sess.fatal(&format!("couldn't create a temp dir: {}", err)));
     let metadata_tmpdir = MaybeTempDir::new(metadata_tmpdir, tcx.sess.opts.cg.save_temps);
     let metadata_filename = metadata_tmpdir.as_ref().join(METADATA_FILENAME);