diff options
| author | Tor Hovland <tor.hovland@bekk.no> | 2021-04-04 13:33:33 +0200 |
|---|---|---|
| committer | Tor Hovland <tor.hovland@bekk.no> | 2021-11-02 22:43:48 +0100 |
| commit | bde794dadabd294b8a8a8a9157dbc52d0d469c15 (patch) | |
| tree | bf5e4ae1c9e38af027edac84ae96a9f2aba6d62b /compiler/rustc_interface/src | |
| parent | 5d1e09f44ab0bd3ca29acf44d92e884ec140d00a (diff) | |
| download | rust-bde794dadabd294b8a8a8a9157dbc52d0d469c15.tar.gz rust-bde794dadabd294b8a8a8a9157dbc52d0d469c15.zip | |
Create temps_dir before it's needed.
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index b14b1c4f1e6..e0b0a2195f5 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -723,6 +723,13 @@ pub fn prepare_outputs( } } + 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); + } + } + write_out_deps(sess, boxed_resolver, &outputs, &output_paths); let only_dep_info = sess.opts.output_types.contains_key(&OutputType::DepInfo) @@ -735,12 +742,6 @@ 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) |
