@@ -508,12 +508,12 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
508
508
// Access to the union's fields: this is `std` and we know that the `r#try`
509
509
// intrinsic fills in the `r` or `p` union field based on its return value.
510
510
//
511
- // The call to `intrinsics::r#try ` is made safe by:
511
+ // The call to `intrinsics::catch_unwind ` is made safe by:
512
512
// - `do_call`, the first argument, can be called with the initial `data_ptr`.
513
513
// - `do_catch`, the second argument, can be called with the `data_ptr` as well.
514
514
// See their safety preconditions for more information
515
515
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 {
517
517
Ok ( ManuallyDrop :: into_inner ( data. r ) )
518
518
} else {
519
519
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>>
540
540
// Its must contains a valid `f` (type: F) value that can be use to fill
541
541
// `data.r`.
542
542
//
543
- // This function cannot be marked as `unsafe` because `intrinsics::r#try `
543
+ // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind `
544
544
// expects normal function pointers.
545
545
#[ inline]
546
546
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>>
562
562
// Since this uses `cleanup` it also hinges on a correct implementation of
563
563
// `__rustc_panic_cleanup`.
564
564
//
565
- // This function cannot be marked as `unsafe` because `intrinsics::r#try `
565
+ // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind `
566
566
// expects normal function pointers.
567
567
#[ inline]
568
568
#[ rustc_nounwind] // `intrinsic::r#try` requires catch fn to be nounwind
0 commit comments