about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorTor Hovland <tor.hovland@bekk.no>2021-11-07 00:14:54 +0100
committerTor Hovland <tor.hovland@bekk.no>2021-11-07 09:32:05 +0100
commitede76c40d1f1d32e6e1536b1e08122debc52ab00 (patch)
treefe34d1268d82a95d8081bf1741ff1813411e9c22 /compiler/rustc_interface
parentd4bcee9638cf8fdf7e9297438e70e20b212c6535 (diff)
downloadrust-ede76c40d1f1d32e6e1536b1e08122debc52ab00.tar.gz
rust-ede76c40d1f1d32e6e1536b1e08122debc52ab00.zip
Made temps-dir an unstable option.
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/interface.rs5
-rw-r--r--compiler/rustc_interface/src/tests.rs1
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 7b235be48b3..2904b3f5b70 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -143,7 +143,6 @@ pub struct Config {
     pub input_path: Option<PathBuf>,
     pub output_dir: Option<PathBuf>,
     pub output_file: Option<PathBuf>,
-    pub temps_dir: Option<PathBuf>,
     pub file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
     pub diagnostic_output: DiagnosticOutput,
 
@@ -198,6 +197,8 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
         );
     }
 
+    let temps_dir = sess.opts.debugging_opts.temps_dir.as_ref().map(|o| PathBuf::from(&o));
+
     let compiler = Compiler {
         sess,
         codegen_backend,
@@ -205,7 +206,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R
         input_path: config.input_path,
         output_dir: config.output_dir,
         output_file: config.output_file,
-        temps_dir: config.temps_dir,
+        temps_dir,
         register_lints: config.register_lints,
         override_queries: config.override_queries,
     };
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index 2d3cb52f5fd..eed2e07e890 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -685,6 +685,7 @@ fn test_debugging_options_tracking_hash() {
     untracked!(span_debug, true);
     untracked!(span_free_formats, true);
     untracked!(strip, Strip::Debuginfo);
+    untracked!(temps_dir, Some(String::from("abc")));
     untracked!(terminal_width, Some(80));
     untracked!(threads, 99);
     untracked!(time, true);