Skip to content

Commit f396849

Browse files
CAD97dtolnay
andauthored
simplify abort_unwind
Co-authored-by: David Tolnay <[email protected]>
1 parent 9c71d4e commit f396849

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

core/src/panic.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,9 @@ pub macro unreachable_2021 {
160160
/// to prevent unwinds. However, note that `extern "C" fn` will automatically
161161
/// convert unwinds to aborts, so using this function isn't necessary for FFI.
162162
#[unstable(feature = "abort_unwind", issue = "130338")]
163+
#[rustc_nounwind]
163164
pub fn abort_unwind<F: FnOnce() -> R, R>(f: F) -> R {
164-
// This attribute adds the "unwinding out of nounwind function" guard.
165-
#[rustc_nounwind]
166-
fn abort_unwind_inner<F: FnOnce() -> R, R>(f: F) -> R {
167-
f()
168-
}
169-
170-
abort_unwind_inner(f)
165+
f()
171166
}
172167

173168
/// An internal trait used by std to pass data from std to `panic_unwind` and

0 commit comments

Comments
 (0)