Skip to content

Commit c0e8578

Browse files
author
Tor Hovland
committed
Create temps_dir before it's needed.
1 parent 4191853 commit c0e8578

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/rustc_interface/src/passes.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,13 @@ pub fn prepare_outputs(
691691
}
692692
}
693693

694+
if let Some(ref dir) = compiler.temps_dir {
695+
if fs::create_dir_all(dir).is_err() {
696+
sess.err("failed to find or create the directory specified by `--temps-dir`");
697+
return Err(ErrorReported);
698+
}
699+
}
700+
694701
write_out_deps(sess, boxed_resolver, &outputs, &output_paths);
695702

696703
let only_dep_info = sess.opts.output_types.contains_key(&OutputType::DepInfo)
@@ -703,12 +710,6 @@ pub fn prepare_outputs(
703710
return Err(ErrorReported);
704711
}
705712
}
706-
if let Some(ref dir) = compiler.temps_dir {
707-
if fs::create_dir_all(dir).is_err() {
708-
sess.err("failed to find or create the directory specified by `--temps-dir`");
709-
return Err(ErrorReported);
710-
}
711-
}
712713
}
713714

714715
Ok(outputs)

0 commit comments

Comments
 (0)