Skip to content

Commit 61486f4

Browse files
committed
expand comment
1 parent 3e96ca2 commit 61486f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libstd/panicking.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,12 @@ fn rust_panic_with_hook(payload: &mut dyn BoxMeUp,
457457
let mut info = PanicInfo::internal_constructor(message, &location);
458458
HOOK_LOCK.read();
459459
match HOOK {
460-
// Some platforms know that printing to stderr won't ever actually
460+
// Some platforms (like wasm) know that printing to stderr won't ever actually
461461
// print anything, and if that's the case we can skip the default
462462
// hook. Since string formatting happens lazily when calling `payload`
463-
// methods, this means that with libpanic_abort, we don't format
464-
// the string at all!
463+
// methods, this means we avoid formatting the string at all!
464+
// (The panic runtime might still call `payload.take_box()` though and trigger
465+
// formatting.)
465466
Hook::Default if panic_output().is_none() => {}
466467
Hook::Default => {
467468
info.set_payload(payload.get());

0 commit comments

Comments
 (0)