Added the --temps-dir option.

This commit is contained in:
Tor Hovland 2021-11-02 22:41:34 +01:00
parent 18bc4bee97
commit 5d1e09f44a
7 changed files with 49 additions and 4 deletions

View file

@ -692,6 +692,7 @@ pub fn prepare_outputs(
&compiler.input,
&compiler.output_dir,
&compiler.output_file,
&compiler.temps_dir,
&krate.attrs,
sess,
);
@ -734,6 +735,12 @@ 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)