committed by
GitHub
parent
7e7ccb25b4
commit
42a44a04ee
@@ -160,16 +160,11 @@ pub macro unreachable_2021 {
|
|||||||
/// to prevent unwinds. However, note that `extern "C" fn` will automatically
|
/// to prevent unwinds. However, note that `extern "C" fn` will automatically
|
||||||
/// convert unwinds to aborts, so using this function isn't necessary for FFI.
|
/// convert unwinds to aborts, so using this function isn't necessary for FFI.
|
||||||
#[unstable(feature = "abort_unwind", issue = "130338")]
|
#[unstable(feature = "abort_unwind", issue = "130338")]
|
||||||
pub fn abort_unwind<F: FnOnce() -> R, R>(f: F) -> R {
|
|
||||||
// This attribute adds the "unwinding out of nounwind function" guard.
|
|
||||||
#[rustc_nounwind]
|
#[rustc_nounwind]
|
||||||
fn abort_unwind_inner<F: FnOnce() -> R, R>(f: F) -> R {
|
pub fn abort_unwind<F: FnOnce() -> R, R>(f: F) -> R {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|
||||||
abort_unwind_inner(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// An internal trait used by std to pass data from std to `panic_unwind` and
|
/// An internal trait used by std to pass data from std to `panic_unwind` and
|
||||||
/// other panic runtimes. Not intended to be stabilized any time soon, do not
|
/// other panic runtimes. Not intended to be stabilized any time soon, do not
|
||||||
/// use.
|
/// use.
|
||||||
|
|||||||
Reference in New Issue
Block a user