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
let thread = cfg.spawn(f);
thread.unwrap().join()
} else {
- Ok(f())
+ let f = panic::AssertUnwindSafe(f);
+ panic::catch_unwind(f)
}
}