-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Unwinding intrinsics use non-unwinding ABI #104451
Comments
Are these intrinsics the only ones that unwind? Maybe we should just make them abort instead by calling the (fairly recent) However, AFAIK |
|
My current idea is to change |
It should be a nice abort via I am honestly not sure why the intrinsics are panicking rather than returning a boolean... I think I tried that and it didn't work? But yeah bool-returning intrinsics sound better (less magic) ayway. |
One possible reason is that in CTFE and Miri, these intrinsics will actually abort instead of panic. Getting the So given that we want something different implementations for Miri, CTFE, and runtime, maybe going with 'call |
With #105997, I think But as determined in rust-lang/miri#2839, we still have const_eval_select, which very much can unwind. |
Yeah, I originally thought that we can remove all unwinding intrinsics, but unfortunately that's not true. I am working on a PR to change the ABI to be unwindable and stick |
That sounds like the cleanest approach, thanks! |
There are intrinsics like
assert_inhabited
, which can unwind, but userust-intrinsic
ABI that never unwinds:rust/compiler/rustc_middle/src/ty/layout.rs
Lines 1091 to 1093 in 6d651a2
An example demonstrating the issue. The argument passed to function
f
is never dropped, whenassert_inhabited
unwinds:The text was updated successfully, but these errors were encountered: