]> git.lizzy.rs Git - rust.git/commitdiff
rustc_driver: Catch ICEs on the main thread too
authorJosh Stone <jistone@redhat.com>
Tue, 10 Apr 2018 00:30:43 +0000 (17:30 -0700)
committerJosh Stone <jistone@redhat.com>
Fri, 27 Apr 2018 21:57:00 +0000 (14:57 -0700)
src/librustc_driver/lib.rs

index b203f387e4662d2f3c5f94664d672c2948875b65..3f166daac717e082a15548b3b7019e935af46e7b 100644 (file)
@@ -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)
     }
 }