@@ -499,13 +499,13 @@ pub use realstd::rt::panic_count;
499499
500500/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
501501#[ 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 > > {
503503 Ok ( f ( ) )
504504}
505505
506506/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
507507#[ 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 > > {
509509 union Data < F , R > {
510510 f : ManuallyDrop < F > ,
511511 r : ManuallyDrop < R > ,
@@ -541,7 +541,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
541541 let data_ptr = ( & raw mut data) as * mut u8 ;
542542 // SAFETY:
543543 //
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 `
545545 // intrinsic fills in the `r` or `p` union field based on its return value.
546546 //
547547 // 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>>
602602 // This function cannot be marked as `unsafe` because `intrinsics::catch_unwind`
603603 // expects normal function pointers.
604604 #[ 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
606606 fn do_catch < F : FnOnce ( ) -> R , R > ( data : * mut u8 , payload : * mut u8 ) {
607607 // SAFETY: this is the responsibility of the caller, see above.
608608 //
0 commit comments