Skip to content

Commit

Permalink
Auto merge of #49826 - cuviper:rustc-main-ICE, r=alexcrichton
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Apr 28, 2018
2 parents 1eb0cef + 64bcbca commit 207bc40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 207bc40

Please sign in to comment.