about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-07-11 16:59:19 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-07-11 16:59:19 -0700
commitc9f7a3d2060a7b2c6f691f4f4b32328edffcf5bd (patch)
tree18674ec831dfedb3218155643a354ab6d9df2520 /src/librustc_errors
parent4bb6b4a5ed1cd377c5cfd97721ad12f52e63dd41 (diff)
downloadrust-c9f7a3d2060a7b2c6f691f4f4b32328edffcf5bd.tar.gz
rust-c9f7a3d2060a7b2c6f691f4f4b32328edffcf5bd.zip
Emit dropped unemitted errors to aid in ICE debugging
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/diagnostic_builder.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs
index fc74e43ff57..41d0638f7c6 100644
--- a/src/librustc_errors/diagnostic_builder.rs
+++ b/src/librustc_errors/diagnostic_builder.rs
@@ -380,10 +380,13 @@ impl<'a> Debug for DiagnosticBuilder<'a> {
 impl<'a> Drop for DiagnosticBuilder<'a> {
     fn drop(&mut self) {
         if !panicking() && !self.cancelled() {
-            let mut db = DiagnosticBuilder::new(self.handler,
-                                                Level::Bug,
-                                                "Error constructed but not emitted");
+            let mut db = DiagnosticBuilder::new(
+                self.handler,
+                Level::Bug,
+                "the following error was constructed but not emitted",
+            );
             db.emit();
+            self.emit();
             panic!();
         }
     }