about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
diff options
context:
space:
mode:
authorTor Hovland <tor.hovland@bekk.no>2021-11-02 22:41:34 +0100
committerTor Hovland <tor.hovland@bekk.no>2021-11-02 22:41:34 +0100
commit5d1e09f44ab0bd3ca29acf44d92e884ec140d00a (patch)
tree57ecc54c99e43c3668a72ad77b3d7cb8937cd15c /compiler/rustc_interface/src/passes.rs
parent18bc4bee9710b181b440a472635150f0d6257713 (diff)
downloadrust-5d1e09f44ab0bd3ca29acf44d92e884ec140d00a.tar.gz
rust-5d1e09f44ab0bd3ca29acf44d92e884ec140d00a.zip
Added the --temps-dir option.
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
-rw-r--r--compiler/rustc_interface/src/passes.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 62f5f09aa48..b14b1c4f1e6 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -692,6 +692,7 @@ pub fn prepare_outputs(
         &compiler.input,
         &compiler.output_dir,
         &compiler.output_file,
+        &compiler.temps_dir,
         &krate.attrs,
         sess,
     );
@@ -734,6 +735,12 @@ pub fn prepare_outputs(
                 return Err(ErrorReported);
             }
         }
+        if let Some(ref dir) = compiler.temps_dir {
+            if fs::create_dir_all(dir).is_err() {
+                sess.err("failed to find or create the directory specified by `--temps-dir`");
+                return Err(ErrorReported);
+            }
+        }
     }
 
     Ok(outputs)