expand comment
This commit is contained in:
parent
3e96ca2bf7
commit
61486f4de3
|
@ -457,11 +457,12 @@ fn rust_panic_with_hook(payload: &mut dyn BoxMeUp,
|
||||||
let mut info = PanicInfo::internal_constructor(message, &location);
|
let mut info = PanicInfo::internal_constructor(message, &location);
|
||||||
HOOK_LOCK.read();
|
HOOK_LOCK.read();
|
||||||
match HOOK {
|
match HOOK {
|
||||||
// Some platforms know that printing to stderr won't ever actually
|
// Some platforms (like wasm) know that printing to stderr won't ever actually
|
||||||
// print anything, and if that's the case we can skip the default
|
// print anything, and if that's the case we can skip the default
|
||||||
// hook. Since string formatting happens lazily when calling `payload`
|
// hook. Since string formatting happens lazily when calling `payload`
|
||||||
// methods, this means that with libpanic_abort, we don't format
|
// methods, this means we avoid formatting the string at all!
|
||||||
// the string at all!
|
// (The panic runtime might still call `payload.take_box()` though and trigger
|
||||||
|
// formatting.)
|
||||||
Hook::Default if panic_output().is_none() => {}
|
Hook::Default if panic_output().is_none() => {}
|
||||||
Hook::Default => {
|
Hook::Default => {
|
||||||
info.set_payload(payload.get());
|
info.set_payload(payload.get());
|
||||||
|
|
Loading…
Reference in New Issue