Skip to content

Commit

Permalink
Some cleanups around EarlyDiagCtxt
Browse files Browse the repository at this point in the history
All callers of EarlyDiagCtxt::early_error now emit a fatal error.
  • Loading branch information
bjorn3 committed Feb 2, 2025
1 parent 984cc68 commit abdee77
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -301,7 +301,6 @@ pub fn main() {
} else {
rustc_driver::run_compiler(&args, &mut RustcCallbacks { clippy_args_var });
}
Ok(())
}))
}

Expand Down

0 comments on commit abdee77

Please sign in to comment.