Skip to content

Commit

Permalink
Use intrinsics::catch_unwind instead of intrinsics::try
Browse files Browse the repository at this point in the history
intrinsics::try has been renamed in rust-lang/rust#121598.
  • Loading branch information
taiki-e committed Feb 28, 2024
1 parent 6720a34 commit 8584d55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8584d55

Please sign in to comment.