@@ -14,7 +14,7 @@ extern { }
14
14
15
15
extern {
16
16
fn RustObjCExceptionThrow ( exception : * mut c_void ) ;
17
- fn RustObjCExceptionTryCatch ( try : extern fn ( * mut c_void ) ,
17
+ fn RustObjCExceptionTryCatch ( r# try: extern fn ( * mut c_void ) ,
18
18
context : * mut c_void , error : * mut * mut c_void ) -> u8 ; // std::os::raw::c_uchar
19
19
}
20
20
@@ -64,7 +64,7 @@ unsafe fn try_no_ret<F>(closure: F) -> Result<(), *mut Exception>
64
64
///
65
65
/// Unsafe because this encourages unwinding through the closure from
66
66
/// Objective-C, which is not safe.
67
- pub unsafe fn try < F , R > ( closure : F ) -> Result < R , * mut Exception >
67
+ pub unsafe fn r# try< F , R > ( closure : F ) -> Result < R , * mut Exception >
68
68
where F : FnOnce ( ) -> R {
69
69
let mut value = None ;
70
70
let result = {
@@ -82,13 +82,13 @@ mod tests {
82
82
use alloc:: string:: ToString ;
83
83
use core:: ptr;
84
84
85
- use super :: { throw , try } ;
85
+ use super :: { r#try , throw } ;
86
86
87
87
#[ test]
88
88
fn test_try ( ) {
89
89
unsafe {
90
90
let s = "Hello" . to_string ( ) ;
91
- let result = try( move || {
91
+ let result = r# try( move || {
92
92
if s. len ( ) > 0 {
93
93
throw ( ptr:: null_mut ( ) ) ;
94
94
}
@@ -97,7 +97,7 @@ mod tests {
97
97
assert ! ( result. unwrap_err( ) == ptr:: null_mut( ) ) ;
98
98
99
99
let mut s = "Hello" . to_string ( ) ;
100
- let result = try( move || {
100
+ let result = r# try( move || {
101
101
s. push_str ( ", World!" ) ;
102
102
s
103
103
} ) ;
0 commit comments