Use intrinsics::catch_unwind instead of intrinsics::try

intrinsics::try has been renamed in https://github.com/rust-lang/rust/pull/121598.
This commit is contained in:
Taiki Endo 2024-02-29 00:01:29 +09:00 committed by Gary Guo
parent 6720a34c66
commit d7cd46e009

View File

@ -39,7 +39,7 @@ pub fn catch_unwind<E: Exception, R, F: FnOnce() -> R>(f: F) -> Result<R, Option
let data_ptr = &mut data as *mut _ as *mut u8;
unsafe {
return if core::intrinsics::r#try(do_call::<F, R>, data_ptr, do_catch::<E>) == 0 {
return if core::intrinsics::catch_unwind(do_call::<F, R>, data_ptr, do_catch::<E>) == 0 {
Ok(ManuallyDrop::into_inner(data.r))
} else {
Err(ManuallyDrop::into_inner(data.p))