From 64bcbca81b25a8c7192ffa5a16c824c59aa2b0a2 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 9 Apr 2018 17:30:43 -0700 Subject: [PATCH] rustc_driver: Catch ICEs on the main thread too --- src/librustc_driver/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index b203f387e4662..3f166daac717e 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -1526,7 +1526,8 @@ pub fn in_rustc_thread(f: F) -> Result> let thread = cfg.spawn(f); thread.unwrap().join() } else { - Ok(f()) + let f = panic::AssertUnwindSafe(f); + panic::catch_unwind(f) } }