#![feature(staged_api)]
#![feature(rustc_attrs)]
-// Rust's "try" function, but if we're aborting on panics we just call the
-// function as there's nothing else we need to do here.
+use core::any::Any;
+
#[rustc_std_internal_symbol]
-pub unsafe extern "C" fn __rust_maybe_catch_panic(
- f: fn(*mut u8),
- data: *mut u8,
- _data_ptr: *mut usize,
- _vtable_ptr: *mut usize,
-) -> u32 {
- f(data);
- 0
+pub unsafe extern "C" fn __rust_panic_cleanup(_: *mut u8) -> *mut (dyn Any + Send + 'static) {
+ unreachable!()
}
// "Leak" the payload and shim to the relevant abort on the platform in
// binaries, but it should never be called as we don't link in an unwinding
// runtime at all.
pub mod personalities {
- #[no_mangle]
+ #[rustc_std_internal_symbol]
#[cfg(not(any(
all(target_arch = "wasm32", not(target_os = "emscripten"),),
all(target_os = "windows", target_env = "gnu", target_arch = "x86_64",),
// On x86_64-pc-windows-gnu we use our own personality function that needs
// to return `ExceptionContinueSearch` as we're passing on all our frames.
- #[no_mangle]
+ #[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86_64"))]
pub extern "C" fn rust_eh_personality(
_record: usize,
//
// Note that we don't execute landing pads, so this is never called, so it's
// body is empty.
- #[no_mangle]
- #[cfg(all(target_os = "windows", target_env = "gnu"))]
+ #[rustc_std_internal_symbol]
+ #[cfg(all(bootstrap, target_os = "windows", target_env = "gnu"))]
pub extern "C" fn rust_eh_unwind_resume() {}
// These two are called by our startup objects on i686-pc-windows-gnu, but
// they don't need to do anything so the bodies are nops.
- #[no_mangle]
+ #[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
pub extern "C" fn rust_eh_register_frames() {}
- #[no_mangle]
+ #[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
pub extern "C" fn rust_eh_unregister_frames() {}
}