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) } }