@@ -508,12 +508,12 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
508508 // Access to the union's fields: this is `std` and we know that the `r#try`
509509 // intrinsic fills in the `r` or `p` union field based on its return value.
510510 //
511- // The call to `intrinsics::r#try ` is made safe by:
511+ // The call to `intrinsics::catch_unwind ` is made safe by:
512512 // - `do_call`, the first argument, can be called with the initial `data_ptr`.
513513 // - `do_catch`, the second argument, can be called with the `data_ptr` as well.
514514 // See their safety preconditions for more information
515515 unsafe {
516- return if intrinsics:: r#try ( do_call :: < F , R > , data_ptr, do_catch :: < F , R > ) == 0 {
516+ return if intrinsics:: catch_unwind ( do_call :: < F , R > , data_ptr, do_catch :: < F , R > ) == 0 {
517517 Ok ( ManuallyDrop :: into_inner ( data. r ) )
518518 } else {
519519 Err ( ManuallyDrop :: into_inner ( data. p ) )
@@ -540,7 +540,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
540540 // Its must contains a valid `f` (type: F) value that can be use to fill
541541 // `data.r`.
542542 //
543- // This function cannot be marked as `unsafe` because `intrinsics::r#try `
543+ // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind `
544544 // expects normal function pointers.
545545 #[ inline]
546546 fn do_call < F : FnOnce ( ) -> R , R > ( data : * mut u8 ) {
@@ -562,7 +562,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
562562 // Since this uses `cleanup` it also hinges on a correct implementation of
563563 // `__rustc_panic_cleanup`.
564564 //
565- // This function cannot be marked as `unsafe` because `intrinsics::r#try `
565+ // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind `
566566 // expects normal function pointers.
567567 #[ inline]
568568 #[ rustc_nounwind] // `intrinsic::r#try` requires catch fn to be nounwind
0 commit comments