Skip to content

Commit 0657c1b

Browse files
committed
Give Handler::fatal and Session::fatal the same return type.
Currently, `Handler::fatal` returns `FatalError`. But `Session::fatal` returns `!`, because it calls `Handler::fatal` and then calls `raise` on the result. This inconsistency is unfortunate. This commit changes `Handler::fatal` to do the `raise` itself, changing its return type to `!`. This is safe because there are only two calls to `Handler::fatal`, one in `rustc_session` and one in `rustc_codegen_cranelift`, and they both call `raise` on the result. `HandlerInner::fatal` still returns `FatalError`, so I renamed it `fatal_no_raise` to emphasise the return type difference.
1 parent 400cd47 commit 0657c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/concurrency_limiter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl ConcurrencyLimiter {
6464
// Make sure to drop the mutex guard first to prevent poisoning the mutex.
6565
drop(state);
6666
if let Some(err) = err {
67-
handler.fatal(err).raise();
67+
handler.fatal(err);
6868
} else {
6969
// The error was already emitted, but compilation continued. Raise a silent
7070
// fatal error.

0 commit comments

Comments
 (0)