]> git.lizzy.rs Git - rust.git/blob - library/std/src/personality/emcc.rs
Auto merge of #105426 - flba-eb:fix_tls_destructor_unwinding, r=m-ou-se
[rust.git] / library / std / src / personality / emcc.rs
1 //! On Emscripten Rust panics are wrapped in C++ exceptions, so we just forward
2 //! to `__gxx_personality_v0` which is provided by Emscripten.
3
4 use libc::c_int;
5 use unwind as uw;
6
7 // This is required by the compiler to exist (e.g., it's a lang item), but it's
8 // never actually called by the compiler.  Emscripten EH doesn't use a
9 // personality function at all, it instead uses __cxa_find_matching_catch.
10 // Wasm error handling would use __gxx_personality_wasm0.
11 #[lang = "eh_personality"]
12 unsafe extern "C" fn rust_eh_personality(
13     _version: c_int,
14     _actions: uw::_Unwind_Action,
15     _exception_class: uw::_Unwind_Exception_Class,
16     _exception_object: *mut uw::_Unwind_Exception,
17     _context: *mut uw::_Unwind_Context,
18 ) -> uw::_Unwind_Reason_Code {
19     core::intrinsics::abort()
20 }