File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
src/libstd/sys/common/unwind Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -148,15 +148,17 @@ pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>> {
148
148
// care of exposing correctly.
149
149
unsafe fn inner_try ( f : fn ( * mut u8 ) , data : * mut u8 )
150
150
-> Result < ( ) , Box < Any + Send > > {
151
- let prev = PANICKING . with ( |s| s. get ( ) ) ;
152
- PANICKING . with ( |s| s. set ( false ) ) ;
153
- let ep = intrinsics:: try ( f, data) ;
154
- PANICKING . with ( |s| s. set ( prev) ) ;
155
- if ep. is_null ( ) {
156
- Ok ( ( ) )
157
- } else {
158
- Err ( imp:: cleanup ( ep) )
159
- }
151
+ PANICKING . with ( |s| {
152
+ let prev = s. get ( ) ;
153
+ s. set ( false ) ;
154
+ let ep = intrinsics:: try ( f, data) ;
155
+ s. set ( prev) ;
156
+ if ep. is_null ( ) {
157
+ Ok ( ( ) )
158
+ } else {
159
+ Err ( imp:: cleanup ( ep) )
160
+ }
161
+ } )
160
162
}
161
163
162
164
fn try_fn < F : FnOnce ( ) > ( opt_closure : * mut u8 ) {
You can’t perform that action at this time.
0 commit comments