You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a complicated topic, so correct me if I'm wrong here, but #[ffi_function] states:
/// # Safety
///
/// ⚠️ You _must_ ensure that methods exported with `#[ffi_function]` will never panic. We highly encourage you
/// to wrap all your code in panic guards. This is a standard Rust FFI concern and has nothing to do with Interoptopus.
/// Failure to follow this advice will probably lead to undefined behavior down the road. The author has been there and does not recommend it.
I believe this is no longer the case now that c_unwind was stabilized and the default behavior for extern "C" was changed in Rust 1.81. See rust-lang/rust#116088
It still may be a good idea to use panic guards for functionality's sake, but I believe it's no longer UB as any extern "C" function that hits a panic will abort rather than let the unwind cross the FFI boundary now.
The text was updated successfully, but these errors were encountered:
People using older compilers might still run into that issue, but with the next release(s) we could bump our MSRV to 1.81 and remove some auto-generated panic guards to increase performance a bit.
This is a complicated topic, so correct me if I'm wrong here, but
#[ffi_function]
states:I believe this is no longer the case now that
c_unwind
was stabilized and the default behavior forextern "C"
was changed in Rust 1.81. See rust-lang/rust#116088It still may be a good idea to use panic guards for functionality's sake, but I believe it's no longer UB as any
extern "C"
function that hits a panic will abort rather than let the unwind cross the FFI boundary now.The text was updated successfully, but these errors were encountered: