Skip to content

Commit 3c038c0

Browse files
committed
Document emscripten's unwind impl and remove unused function
1 parent badfd62 commit 3c038c0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/libpanic_unwind/emcc.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Unwinding for emscripten
12+
//!
13+
//! Whereas Rust's usual unwinding implementation for Unix platforms
14+
//! calls into the libunwind APIs directly, on emscripten we instead
15+
//! call into the C++ unwinding APIs. This is just an expedience since
16+
//! emscripten's runtime always implements those APIs and does not
17+
//! implement libunwind.
18+
1119
#![allow(private_no_mangle_fns)]
1220

1321
use core::any::Any;
@@ -55,12 +63,6 @@ unsafe extern "C" fn rust_eh_personality(version: c_int,
5563
context)
5664
}
5765

58-
#[lang = "eh_unwind_resume"]
59-
#[unwind]
60-
unsafe extern "C" fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
61-
uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception);
62-
}
63-
6466
extern {
6567
fn __cxa_allocate_exception(thrown_size: libc::size_t) -> *mut libc::c_void;
6668
fn __cxa_free_exception(thrown_exception: *mut libc::c_void);

0 commit comments

Comments
 (0)