about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src/lib.rs
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-22 14:13:14 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-23 09:38:58 +0000
commita77776cc1d7c599f4ff9355ffe01bad2e2b5bbad (patch)
treeda03459bc81a07b8a732063c119fd595852a977d /compiler/rustc_driver_impl/src/lib.rs
parent974db1a6e444e2b053f49a8d3242db335669acef (diff)
downloadrust-a77776cc1d7c599f4ff9355ffe01bad2e2b5bbad.tar.gz
rust-a77776cc1d7c599f4ff9355ffe01bad2e2b5bbad.zip
Remove RunCompiler
It has become nothing other than a wrapper around run_compiler.
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs20
1 files changed, 2 insertions, 18 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index c0c4debcda3..3501668afb6 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -207,23 +207,7 @@ pub fn diagnostics_registry() -> Registry {
 }
 
 /// This is the primary entry point for rustc.
-pub struct RunCompiler<'a> {
-    at_args: &'a [String],
-    callbacks: &'a mut (dyn Callbacks + Send),
-}
-
-impl<'a> RunCompiler<'a> {
-    pub fn new(at_args: &'a [String], callbacks: &'a mut (dyn Callbacks + Send)) -> Self {
-        Self { at_args, callbacks }
-    }
-
-    /// Parse args and run the compiler.
-    pub fn run(self) {
-        run_compiler(self.at_args, self.callbacks);
-    }
-}
-
-fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send)) {
+pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send)) {
     let mut default_early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
 
     // Throw away the first argument, the name of the binary.
@@ -1516,7 +1500,7 @@ pub fn main() -> ! {
     install_ctrlc_handler();
 
     let exit_code = catch_with_exit_code(|| {
-        RunCompiler::new(&args::raw_args(&early_dcx)?, &mut callbacks).run();
+        run_compiler(&args::raw_args(&early_dcx)?, &mut callbacks);
         Ok(())
     });