We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa6a697 commit 036e538Copy full SHA for 036e538
library/proc_macro/src/bridge/client.rs
@@ -283,7 +283,11 @@ fn maybe_install_panic_hook(force_show_panics: bool) {
283
HIDE_PANICS_DURING_EXPANSION.call_once(|| {
284
let prev = panic::take_hook();
285
panic::set_hook(Box::new(move |info| {
286
- if force_show_panics || !is_available() {
+ // We normally report panics by catching unwinds and passing the payload from the
287
+ // unwind back to the compiler, but if the panic doesn't unwind we'll abort before
288
+ // the compiler has a chance to print an error. So we special-case PanicInfo where
289
+ // can_unwind is false.
290
+ if force_show_panics || !is_available() || !info.can_unwind() {
291
prev(info)
292
}
293
}));
0 commit comments