diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-02 15:17:29 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-02 16:06:43 +0000 |
| commit | d237378cd164e1bf2fd6f91271abd49c8573ded7 (patch) | |
| tree | d2826e5c2f93a15120ac21e21ce13aabb095591a /compiler/rustc_driver_impl/src/lib.rs | |
| parent | 6dd75f0d6802f56564f5f9c947a85ded286d3986 (diff) | |
| download | rust-d237378cd164e1bf2fd6f91271abd49c8573ded7.tar.gz rust-d237378cd164e1bf2fd6f91271abd49c8573ded7.zip | |
Some cleanups around EarlyDiagCtxt
All callers of EarlyDiagCtxt::early_error now emit a fatal error.
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index c9d38a0f932..b6fd15f0e06 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -1212,9 +1212,9 @@ pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, FatalError> { /// Variant of `catch_fatal_errors` for the `interface::Result` return type /// that also computes the exit code. -pub fn catch_with_exit_code(f: impl FnOnce() -> interface::Result<()>) -> i32 { +pub fn catch_with_exit_code(f: impl FnOnce()) -> i32 { match catch_fatal_errors(f) { - Ok(Ok(())) => EXIT_SUCCESS, + Ok(()) => EXIT_SUCCESS, _ => EXIT_FAILURE, } } @@ -1499,10 +1499,8 @@ pub fn main() -> ! { install_ice_hook(DEFAULT_BUG_REPORT_URL, |_| ()); install_ctrlc_handler(); - let exit_code = catch_with_exit_code(|| { - run_compiler(&args::raw_args(&early_dcx)?, &mut callbacks); - Ok(()) - }); + let exit_code = + catch_with_exit_code(|| run_compiler(&args::raw_args(&early_dcx), &mut callbacks)); if let Some(format) = callbacks.time_passes { let end_rss = get_resident_set_size(); |
