@@ -499,13 +499,13 @@ pub use realstd::rt::panic_count;
499
499
500
500
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
501
501
#[ cfg( feature = "panic_immediate_abort" ) ]
502
- pub unsafe fn r#try < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
502
+ pub unsafe fn catch_unwind < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
503
503
Ok ( f ( ) )
504
504
}
505
505
506
506
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
507
507
#[ cfg( not( feature = "panic_immediate_abort" ) ) ]
508
- pub unsafe fn r#try < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
508
+ pub unsafe fn catch_unwind < R , F : FnOnce ( ) -> R > ( f : F ) -> Result < R , Box < dyn Any + Send > > {
509
509
union Data < F , R > {
510
510
f : ManuallyDrop < F > ,
511
511
r : ManuallyDrop < R > ,
@@ -541,7 +541,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
541
541
let data_ptr = ( & raw mut data) as * mut u8 ;
542
542
// SAFETY:
543
543
//
544
- // Access to the union's fields: this is `std` and we know that the `r#try `
544
+ // Access to the union's fields: this is `std` and we know that the `catch_unwind `
545
545
// intrinsic fills in the `r` or `p` union field based on its return value.
546
546
//
547
547
// The call to `intrinsics::catch_unwind` is made safe by:
@@ -602,7 +602,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
602
602
// This function cannot be marked as `unsafe` because `intrinsics::catch_unwind`
603
603
// expects normal function pointers.
604
604
#[ inline]
605
- #[ rustc_nounwind] // `intrinsic::r#try ` requires catch fn to be nounwind
605
+ #[ rustc_nounwind] // `intrinsic::catch_unwind ` requires catch fn to be nounwind
606
606
fn do_catch < F : FnOnce ( ) -> R , R > ( data : * mut u8 , payload : * mut u8 ) {
607
607
// SAFETY: this is the responsibility of the caller, see above.
608
608
//
0 commit comments