Skip to content

Commit bde794d

Browse files
author
Tor Hovland
committed
Create temps_dir before it's needed.
1 parent 5d1e09f commit bde794d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ pub fn prepare_outputs(
723723
}
724724
}
725725

726+
if let Some(ref dir) = compiler.temps_dir {
727+
if fs::create_dir_all(dir).is_err() {
728+
sess.err("failed to find or create the directory specified by `--temps-dir`");
729+
return Err(ErrorReported);
730+
}
731+
}
732+
726733
write_out_deps(sess, boxed_resolver, &outputs, &output_paths);
727734

728735
let only_dep_info = sess.opts.output_types.contains_key(&OutputType::DepInfo)
@@ -735,12 +742,6 @@ pub fn prepare_outputs(
735742
return Err(ErrorReported);
736743
}
737744
}
738-
if let Some(ref dir) = compiler.temps_dir {
739-
if fs::create_dir_all(dir).is_err() {
740-
sess.err("failed to find or create the directory specified by `--temps-dir`");
741-
return Err(ErrorReported);
742-
}
743-
}
744745
}
745746

746747
Ok(outputs)

0 commit comments

Comments
 (0)