about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2018-04-09 17:30:43 -0700
committerJosh Stone <jistone@redhat.com>2018-04-27 14:57:00 -0700
commit64bcbca81b25a8c7192ffa5a16c824c59aa2b0a2 (patch)
tree9d1499b75fa42be06c995e5d308faa1b0bb82f53 /src
parenta9975254ee6510cd1360417d3d145b56fb70b2e7 (diff)
downloadrust-64bcbca81b25a8c7192ffa5a16c824c59aa2b0a2.tar.gz
rust-64bcbca81b25a8c7192ffa5a16c824c59aa2b0a2.zip
rustc_driver: Catch ICEs on the main thread too
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index b203f387e46..3f166daac71 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -1526,7 +1526,8 @@ pub fn in_rustc_thread<F, R>(f: F) -> Result<R, Box<Any + Send>>
         let thread = cfg.spawn(f);
         thread.unwrap().join()
     } else {
-        Ok(f())
+        let f = panic::AssertUnwindSafe(f);
+        panic::catch_unwind(f)
     }
 }