浏览代码

Use intrinsics::catch_unwind instead of intrinsics::try

intrinsics::try has been renamed in https://github.com/rust-lang/rust/pull/121598.
Taiki Endo 1 年之前
父节点
当前提交
d7cd46e009
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/panicking.rs

+ 1 - 1
src/panicking.rs

@@ -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))