We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0c05492 + cf10296 commit 2a6f6f2Copy full SHA for 2a6f6f2
src/libstd/sys/common/unwind/mod.rs
@@ -148,15 +148,17 @@ pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>> {
148
// care of exposing correctly.
149
unsafe fn inner_try(f: fn(*mut u8), data: *mut u8)
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
- }
+ PANICKING.with(|s| {
+ let prev = s.get();
+ s.set(false);
+ let ep = intrinsics::try(f, data);
+ s.set(prev);
+ if ep.is_null() {
+ Ok(())
+ } else {
+ Err(imp::cleanup(ep))
160
+ }
161
+ })
162
}
163
164
fn try_fn<F: FnOnce()>(opt_closure: *mut u8) {
0 commit comments