-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression: compiler had non-unwinding abort #123286
Comments
The regression in InfiniteCoder01/GarbageCollector2 is a failing precondition check in a library used in a proc macro:
The regression in
At most this is asking for proc-macros to be able to report panic messages, but really these are just more of #123285. People were executing UB, we now prevent that and try to tell them about it. |
Why doesn't the panic message get printed somewhere? That feels surprising to me. |
proc-macros deliberately remove the default panic hook, and the panic hook is responsible for printing the panic message: rust/library/proc_macro/src/bridge/client.rs Lines 280 to 287 in 3d5528c
I think this is done because proc-macros want to use |
I'm working on a change to let the compiler report panics even when proc-macros are compiled with if force_show_panics || !is_available() {
prev(info) To this: (UB-preventing panics always have if force_show_panics || !is_available() || !info.can_unwind() {
prev(info) The experience isn't optimal; you're forced into a very verbose backtrace because the ICE setup uses I'm only suggesting this because it's such a tiny change that it's a plausible beta backport. @rustbot label +I-compiler-nominated |
…=petrochenkov Call the panic hook for non-unwind panics in proc-macros As I suggested in rust-lang#123286 (comment). If a proc macro causes a non-unwinding panic, `proc_macro` isn't able to catch the unwind and report the panic as a compile error by passing control back to the compiler. Our only chance to produce any diagnostic is the panic hook, so we should call it. This scenario has already existed, but has become a lot more interesting now that we're adding more UB-detecting panics to the standard library, and such panics do not unwind.
Rollup merge of rust-lang#123825 - saethlin:report-nounwind-panics, r=petrochenkov Call the panic hook for non-unwind panics in proc-macros As I suggested in rust-lang#123286 (comment). If a proc macro causes a non-unwinding panic, `proc_macro` isn't able to catch the unwind and report the panic as a compile error by passing control back to the compiler. Our only chance to produce any diagnostic is the panic hook, so we should call it. This scenario has already existed, but has become a lot more interesting now that we're adding more UB-detecting panics to the standard library, and such panics do not unwind.
Since #123825 was merged and backported I think we should close this? |
The text was updated successfully, but these errors were encountered: