Skip to content

Commit

Permalink
Create temps_dir before it's needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tor Hovland committed Nov 2, 2021
1 parent 5d1e09f commit bde794d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions compiler/rustc_interface/src/passes.rs
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit bde794d

Please sign in to comment.