@@ -36,6 +36,7 @@ pub struct Compiler {
3636 pub ( crate ) input_path : Option < PathBuf > ,
3737 pub ( crate ) output_dir : Option < PathBuf > ,
3838 pub ( crate ) output_file : Option < PathBuf > ,
39+ pub ( crate ) temps_dir : Option < PathBuf > ,
3940 pub ( crate ) register_lints : Option < Box < dyn Fn ( & Session , & mut LintStore ) + Send + Sync > > ,
4041 pub ( crate ) override_queries :
4142 Option < fn ( & Session , & mut ty:: query:: Providers , & mut ty:: query:: ExternProviders ) > ,
@@ -57,6 +58,9 @@ impl Compiler {
5758 pub fn output_file ( & self ) -> & Option < PathBuf > {
5859 & self . output_file
5960 }
61+ pub fn temps_dir ( & self ) -> & Option < PathBuf > {
62+ & self . temps_dir
63+ }
6064 pub fn register_lints ( & self ) -> & Option < Box < dyn Fn ( & Session , & mut LintStore ) + Send + Sync > > {
6165 & self . register_lints
6266 }
@@ -65,7 +69,14 @@ impl Compiler {
6569 sess : & Session ,
6670 attrs : & [ ast:: Attribute ] ,
6771 ) -> OutputFilenames {
68- util:: build_output_filenames ( & self . input , & self . output_dir , & self . output_file , attrs, sess)
72+ util:: build_output_filenames (
73+ & self . input ,
74+ & self . output_dir ,
75+ & self . output_file ,
76+ & self . temps_dir ,
77+ attrs,
78+ sess,
79+ )
6980 }
7081}
7182
@@ -132,6 +143,7 @@ pub struct Config {
132143 pub input_path : Option < PathBuf > ,
133144 pub output_dir : Option < PathBuf > ,
134145 pub output_file : Option < PathBuf > ,
146+ pub temps_dir : Option < PathBuf > ,
135147 pub file_loader : Option < Box < dyn FileLoader + Send + Sync > > ,
136148 pub diagnostic_output : DiagnosticOutput ,
137149
@@ -193,6 +205,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
193205 input_path : config. input_path ,
194206 output_dir : config. output_dir ,
195207 output_file : config. output_file ,
208+ temps_dir : config. temps_dir ,
196209 register_lints : config. register_lints ,
197210 override_queries : config. override_queries ,
198211 } ;
0 commit comments