]> git.proxmox.com Git - rustc.git/blame - library/std/src/personality/emcc.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / library / std / src / personality / emcc.rs
CommitLineData
f2b60f7d
FG
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
9ffffee4 4use crate::ffi::c_int;
f2b60f7d
FG
5use 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"]
12unsafe 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}