-
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
#[should_panic]
stopped catching panics from extern "C"
functions
#130864
Comments
Possibly related: #130024 (that issue involves an allocator, but is also about |
The message of that panic is important: "panic in a function that cannot unwind" -- and since it cannot unwind, it aborts. Thus the test harness has no chance to catch it. This is an intended consequence of #116088 that |
Aha! This was mentioned in the 1.81.0 release blog post, but when I looked there I didn't realise that's what the problem was, because I was focused on the |
If this is expected then I'm happy for this issue to just be closed. But perhaps there's a slightly less noisy way the test can report its error? Without |
I'm not sure how we would do that without a total rewrite of libtest, which may or may not be happening but in any case is beyond the scope of this issue, so I'm closing this as wontfix (since the sudden abrupt detonation of threads that panic inside |
Code
Minimal reproduction (playground):
Our codebase has a test that checks passing a null ptr into an
extern "C"
function causes it to panic. The test now panics, i.e.#[should_panic]
is not capturing the panic.Version it worked on
It most recently worked on: 1.80.1
Version with regression
rustc --version --verbose
:Backtrace
Backtrace
The text was updated successfully, but these errors were encountered: