Create temps_dir before it's needed.

This commit is contained in:
Tor Hovland 2021-04-04 13:33:33 +02:00
parent 5d1e09f44a
commit bde794dada

View file

@ -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)