File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 14
14
#![ feature( core_intrinsics) ]
15
15
#![ feature( nll) ]
16
16
#![ feature( panic_runtime) ]
17
+ #![ feature( std_internals) ]
17
18
#![ feature( staged_api) ]
18
19
#![ feature( rustc_attrs) ]
19
20
#![ feature( asm) ]
20
21
21
22
use core:: any:: Any ;
23
+ use core:: panic:: BoxMeUp ;
22
24
23
25
#[ rustc_std_internal_symbol]
24
26
#[ allow( improper_ctypes_definitions) ]
@@ -28,7 +30,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(_: *mut u8) -> *mut (dyn Any + Sen
28
30
29
31
// "Leak" the payload and shim to the relevant abort on the platform in question.
30
32
#[ rustc_std_internal_symbol]
31
- pub unsafe extern "C" fn __rust_start_panic ( _payload : usize ) -> u32 {
33
+ pub unsafe extern "C" fn __rust_start_panic ( _payload : * mut & mut dyn BoxMeUp ) -> u32 {
32
34
abort ( ) ;
33
35
34
36
cfg_if:: cfg_if! {
Original file line number Diff line number Diff line change @@ -104,8 +104,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any
104
104
// implementation.
105
105
#[ rustc_std_internal_symbol]
106
106
#[ unwind( allowed) ]
107
- pub unsafe extern "C" fn __rust_start_panic ( payload : usize ) -> u32 {
108
- let payload = payload as * mut & mut dyn BoxMeUp ;
107
+ pub unsafe extern "C" fn __rust_start_panic ( payload : * mut & mut dyn BoxMeUp ) -> u32 {
109
108
let payload = ( * payload) . take_box ( ) ;
110
109
111
110
imp:: panic ( Box :: from_raw ( payload) )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ extern "C" {
48
48
/// It cannot be `Box<dyn BoxMeUp>` because the other end of this call does not depend
49
49
/// on liballoc, and thus cannot use `Box`.
50
50
#[ unwind( allowed) ]
51
- fn __rust_start_panic ( payload : usize ) -> u32 ;
51
+ fn __rust_start_panic ( payload : * mut & mut dyn BoxMeUp ) -> u32 ;
52
52
}
53
53
54
54
/// This function is called by the panic runtime if FFI code catches a Rust
@@ -637,7 +637,7 @@ pub fn rust_panic_without_hook(payload: Box<dyn Any + Send>) -> ! {
637
637
fn rust_panic ( mut msg : & mut dyn BoxMeUp ) -> ! {
638
638
let code = unsafe {
639
639
let obj = & mut msg as * mut & mut dyn BoxMeUp ;
640
- __rust_start_panic ( obj as usize )
640
+ __rust_start_panic ( obj)
641
641
} ;
642
642
rtabort ! ( "failed to initiate panic, error {}" , code)
643
643
}
You can’t perform that action at this time.
0 commit comments