fix another comment, and make __rust_start_panic code a bit more semantically clear
This commit is contained in:
parent
7524eb2704
commit
1600f7d693
@ -105,7 +105,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any
|
||||
#[rustc_std_internal_symbol]
|
||||
#[unwind(allowed)]
|
||||
pub unsafe extern "C" fn __rust_start_panic(payload: *mut &mut dyn BoxMeUp) -> u32 {
|
||||
let payload = (*payload).take_box();
|
||||
let payload = Box::from_raw((*payload).take_box());
|
||||
|
||||
imp::panic(Box::from_raw(payload))
|
||||
imp::panic(payload)
|
||||
}
|
||||
|
@ -44,8 +44,9 @@ use realstd::io::set_output_capture;
|
||||
extern "C" {
|
||||
fn __rust_panic_cleanup(payload: *mut u8) -> *mut (dyn Any + Send + 'static);
|
||||
|
||||
/// `payload` is actually a `Box<dyn BoxMeUp>`, but we pass this by-reference because the other
|
||||
/// end of this call does not depend on liballoc, and thus cannot use `Box`.
|
||||
/// `payload` is passed through another layer of raw pointers as `&mut dyn Trait` is not
|
||||
/// FFI-safe. `BoxMeUp` lazily performs allocation only when needed (this avoids allocations
|
||||
/// when using the "abort" panic runtime).
|
||||
#[unwind(allowed)]
|
||||
fn __rust_start_panic(payload: *mut &mut dyn BoxMeUp) -> u32;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user