Remove RunCompiler
It has become nothing other than a wrapper around run_compiler.
This commit is contained in:
parent
974db1a6e4
commit
a77776cc1d
9 changed files with 16 additions and 32 deletions
|
@ -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(())
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue