diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2019-12-26 19:37:14 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2020-03-02 11:43:07 +0000 |
| commit | 5b682354f2c8bf2c825b6229a6a125435f2053dd (patch) | |
| tree | 30e016d4e826f4ef46c532751ae6a695d1a364e4 /src/libstd | |
| parent | bdcc02360f34fe773c38f8ae86111fb831f8ec9e (diff) | |
Fix some minor issues
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/panicking.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 3dd1f09e076..b02cedd5da5 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -67,7 +67,7 @@ cfg_if::cfg_if! { extern "C" { /// The payload ptr here is actually the same as the payload ptr for the try /// intrinsic (i.e., is really `*mut [u64; 2]` or `*mut *mut u8`). - fn __rust_panic_cleanup(payload: *mut u8) -> core::raw::TraitObject; + fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any + Send + 'static); /// `payload` is actually a `*mut &mut dyn BoxMeUp` but that would cause FFI warnings. /// It cannot be `Box<dyn BoxMeUp>` because the other end of this call does not depend @@ -313,7 +313,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> // non-cold function, though, as of the writing of this comment). #[cold] unsafe fn cleanup(mut payload: Payload) -> Box<dyn Any + Send + 'static> { - let obj = crate::mem::transmute(__rust_panic_cleanup(&mut payload as *mut _ as *mut u8)); + let obj = Box::from_raw(__rust_panic_cleanup(&mut payload as *mut _ as *mut u8)); update_panic_count(-1); obj } |
