about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-12-06 18:56:28 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-01-16 08:03:06 +0000
commitf5c601492ee520d2ee4f6c133f7f4dfa7b0c13e2 (patch)
treefd9f62b7b1b684f0ed4f85c209c51c22da8db833 /compiler/rustc_interface/src
parent6b1a789fb69f832d2b3df53b9e42c08c919c7487 (diff)
downloadrust-f5c601492ee520d2ee4f6c133f7f4dfa7b0c13e2.tar.gz
rust-f5c601492ee520d2ee4f6c133f7f4dfa7b0c13e2.zip
Remove redundant `input_path` field from `Config`
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/interface.rs5
-rw-r--r--compiler/rustc_interface/src/passes.rs2
2 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs
index 7f761b005ed..22a01db5e75 100644
--- a/compiler/rustc_interface/src/interface.rs
+++ b/compiler/rustc_interface/src/interface.rs
@@ -36,7 +36,6 @@ pub struct Compiler {
     pub(crate) sess: Lrc<Session>,
     codegen_backend: Lrc<Box<dyn CodegenBackend>>,
     pub(crate) input: Input,
-    pub(crate) input_path: Option<PathBuf>,
     pub(crate) output_dir: Option<PathBuf>,
     pub(crate) output_file: Option<PathBuf>,
     pub(crate) temps_dir: Option<PathBuf>,
@@ -244,7 +243,6 @@ pub struct Config {
     pub crate_check_cfg: CheckCfg,
 
     pub input: Input,
-    pub input_path: Option<PathBuf>,
     pub output_dir: Option<PathBuf>,
     pub output_file: Option<PathBuf>,
     pub file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
@@ -292,7 +290,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
                 config.crate_cfg,
                 config.crate_check_cfg,
                 config.file_loader,
-                config.input_path.clone(),
+                config.input.opt_path(),
                 config.lint_caps,
                 config.make_codegen_backend,
                 registry.clone(),
@@ -308,7 +306,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
                 sess: Lrc::new(sess),
                 codegen_backend: Lrc::new(codegen_backend),
                 input: config.input,
-                input_path: config.input_path,
                 output_dir: config.output_dir,
                 output_file: config.output_file,
                 temps_dir,
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 5dd758c9451..bba0a50a93f 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -686,7 +686,7 @@ pub fn prepare_outputs(
         generated_output_paths(sess, &outputs, compiler.output_file.is_some(), crate_name);
 
     // Ensure the source file isn't accidentally overwritten during compilation.
-    if let Some(ref input_path) = compiler.input_path {
+    if let Some(ref input_path) = compiler.input.opt_path() {
         if sess.opts.will_create_output_file() {
             if output_contains_path(&output_paths, input_path) {
                 let reported = sess.emit_err(InputFileWouldBeOverWritten { path: input_path });