about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-19 10:23:58 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-22 08:03:47 +1100
commit4da67fff61ccc460370df6047563f8091c7e66bd (patch)
tree761249125161b8904d059dadc89e77225b664114 /compiler/rustc_errors/src/lib.rs
parent44006444c8c85a0102984a4323755da0084a681e (diff)
downloadrust-4da67fff61ccc460370df6047563f8091c7e66bd.tar.gz
rust-4da67fff61ccc460370df6047563f8091c7e66bd.zip
Replace unnecessary `abort_if_errors`.
Replace `abort_if_errors` calls that are certain to abort -- because
we emit an error immediately beforehand -- with `FatalErro.raise()`.
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
-rw-r--r--compiler/rustc_errors/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index fafd636bb70..7e3d15ffc92 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -876,6 +876,10 @@ impl DiagCtxt {
         }
     }
 
+    /// This excludes delayed bugs and stashed errors. Used for early aborts
+    /// after errors occurred -- e.g. because continuing in the face of errors is
+    /// likely to lead to bad results, such as spurious/uninteresting
+    /// additional errors -- when returning an error `Result` is difficult.
     pub fn abort_if_errors(&self) {
         if self.has_errors().is_some() {
             FatalError.raise();