1
Fork 0

Some cleanups around EarlyDiagCtxt

All callers of EarlyDiagCtxt::early_error now emit a fatal error.
This commit is contained in:
bjorn3 2025-02-02 15:17:29 +00:00
parent 984cc68c1c
commit abdee777c2

View file

@ -197,7 +197,7 @@ pub fn main() {
});
exit(rustc_driver::catch_with_exit_code(move || {
let mut orig_args = rustc_driver::args::raw_args(&early_dcx)?;
let mut orig_args = rustc_driver::args::raw_args(&early_dcx);
let has_sysroot_arg = |args: &mut [String]| -> bool {
if has_arg(args, "--sysroot") {
@ -239,7 +239,7 @@ pub fn main() {
pass_sysroot_env_if_given(&mut args, sys_root_env);
rustc_driver::run_compiler(&args, &mut DefaultCallbacks);
return Ok(());
return;
}
if orig_args.iter().any(|a| a == "--version" || a == "-V") {
@ -301,7 +301,6 @@ pub fn main() {
} else {
rustc_driver::run_compiler(&args, &mut RustcCallbacks { clippy_args_var });
}
Ok(())
}))
}