-// This must be kept in sync with the implementations in libpanic_unwind.
-//
-// This is *not* checked in anyway; the compiler does not allow us to use a
-// type/macro/anything from panic_unwind, since we're then linking in the
-// panic_unwind runtime even during -Cpanic=abort.
-//
-// Essentially this must be the type of `imp::Payload` in libpanic_unwind.
-cfg_if::cfg_if! {
- if #[cfg(not(feature = "panic_unwind"))] {
- type Payload = ();
- } else if #[cfg(target_os = "emscripten")] {
- type Payload = *mut u8;
- } else if #[cfg(target_arch = "wasm32")] {
- type Payload = *mut u8;
- } else if #[cfg(target_os = "hermit")] {
- type Payload = *mut u8;
- } else if #[cfg(all(target_env = "msvc", target_arch = "aarch64"))] {
- type Payload = *mut u8;
- } else if #[cfg(target_env = "msvc")] {
- type Payload = [u64; 2];
- } else {
- type Payload = *mut u8;
- }
-}
+// Include the definition of UnwindPayload from libpanic_unwind.
+include!("../libpanic_unwind/payload.rs");