From 4a19ef938c3670afb8cc278d3d31a803b19addab Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 26 Nov 2019 09:29:39 +0100 Subject: [PATCH] explain why __rust_start_panic does not take a Box --- src/libstd/panicking.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 8f9a4c05b5702..e0d980fc306b5 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -47,6 +47,8 @@ extern { vtable_ptr: *mut usize) -> u32; /// `payload` is actually a `*mut &mut dyn BoxMeUp` but that would cause FFI warnings. + /// It cannot be `Box` because the other end of this call does not depend + /// on liballoc, and thus cannot use `Box`. #[unwind(allowed)] fn __rust_start_panic(payload: usize) -> u32; }