diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-26 10:02:21 -0500 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2020-03-02 11:43:06 +0000 |
| commit | d45ce5aed63fb58385705016dfaff1832a58d7c8 (patch) | |
| tree | 35a9bea734e796c0690399f6ebfc5049994b02f3 /src/libpanic_unwind/dummy.rs | |
| parent | 6b2983af1a85d857ae3a9345ac93ba0564ab7a73 (diff) | |
| download | rust-d45ce5aed63fb58385705016dfaff1832a58d7c8.tar.gz rust-d45ce5aed63fb58385705016dfaff1832a58d7c8.zip | |
Inline catching panics into std::catch_unwind
This allows LLVM to inline the happy path, such that catching unwinding is zero-cost when no panic occurs. This also allows us to match the code generated by C++ try/catch.
Diffstat (limited to 'src/libpanic_unwind/dummy.rs')
| -rw-r--r-- | src/libpanic_unwind/dummy.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libpanic_unwind/dummy.rs b/src/libpanic_unwind/dummy.rs index 86756326387..30593d3b88a 100644 --- a/src/libpanic_unwind/dummy.rs +++ b/src/libpanic_unwind/dummy.rs @@ -6,9 +6,7 @@ use alloc::boxed::Box; use core::any::Any; use core::intrinsics; -pub fn payload() -> *mut u8 { - core::ptr::null_mut() -} +pub type Payload = *mut u8; pub unsafe fn cleanup(_ptr: *mut u8) -> Box<dyn Any + Send> { intrinsics::abort() |
