diff options
| author | bors <bors@rust-lang.org> | 2018-04-28 06:26:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-04-28 06:26:46 +0000 |
| commit | 207bc403799e4a8a04f873be94834ccc09c1412b (patch) | |
| tree | 093df6cf438b7bfc2d8b79897cd8a60661e6ea2c /src | |
| parent | 1eb0cef62b3e83bf7ce6bc7d1b99e130648a55e8 (diff) | |
| parent | 64bcbca81b25a8c7192ffa5a16c824c59aa2b0a2 (diff) | |
| download | rust-207bc403799e4a8a04f873be94834ccc09c1412b.tar.gz rust-207bc403799e4a8a04f873be94834ccc09c1412b.zip | |
Auto merge of #49826 - cuviper:rustc-main-ICE, r=alexcrichton
rustc_driver: Catch ICEs on the main thread too #48575 introduced an optimization to run rustc directly on the main thread when possible. However, the threaded code detects panics when they `join()` to report as an ICE. When running directly, we need to use `panic::catch_unwind` to get the same effect. cc @ishitatsuyuki r? @alexcrichton
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_driver/lib.rs | 3 |
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) } } |
